Search
Other Sourcerer questions
Forum

General CSS template isn't applied to HTML code producted with sourcerer in PHP

Christophe Lebis's Avatar Christophe Lebis
Hello,
soucerer pro, last version, Joola last version

My problem :

I generate html code in a content with a php script include with sourcerer. All work fine but some lines of css of my template are'nt applied to this code.

Exemple :
a script in a content :
<?php
echo '<div class="typo">Hello world !</div>';

In my template, css :
body{font-family: Arial, Helvetica, Verdana, sans-serif;}

Fonts aren't applied to typo, but applied on all others contents (what is normal).

Thanks for an idea.
Peter van Westen's Avatar Peter van Westen ADMIN
How and if your css works is outside the control and responsibility of Sourcerer.

Check your html output to see if the correct css files are loaded.
For more info about how elements get their styling, you can use the Element Inspector of your browser.
Please post a rating at the Joomla! Extensions Directory
Christophe Lebis's Avatar Christophe Lebis
I know that well. The problem is with font-family in body{}. body{font-family:...} isn't applied to html elements created in a php script includes in a content with sourcerer.

It' is easy to rule, with aditionnal css code, but... so strange.
Peter van Westen's Avatar Peter van Westen ADMIN
For more info about how elements get their styling, you can use the Element Inspector of your browser.
Please post a rating at the Joomla! Extensions Directory
Christophe Lebis's Avatar Christophe Lebis
Hello, thanks for your response but itsn't necessary to repeat what I know very well.

I notify to the community this strange thing, to know if somebody has the same thing, or/and has an explanation, I like to know why.

Sincerely
Peter van Westen's Avatar Peter van Westen ADMIN
Do you have this online so I can take a look?
Please post a rating at the Joomla! Extensions Directory
Christophe Lebis's Avatar Christophe Lebis
Yes, you can see that in crm.afvac.com/index.php/requeteur-crm

Confidential information:
(hidden)

Some texts (label, div, p,a) don't herit of body {font-family: "Source Sans Pro",Arial, Helvetica, Verdana, sans-serif;} (but h1 yes ?!)
It's same without Google fonts.

But don't spend time on it, it's easy to rule with css : a,div,p, label{font-family: "Source Sans Pro",Arial, Helvetica, Verdana, sans-serif;} .

Yet, there is a mystery : why must I add a,div,p, label{font-family: "Source Sans Pro",Arial, Helvetica, Verdana, sans-serif;} only for sourcerer ?

Thanks for an idea... or not !

(In fact, it seems that only elements without direct adressing CSS don't herit of font-family ? a lead ?)
Christophe Lebis's Avatar Christophe Lebis
Hello, I find : it's because I use Sourcerer in a sebdlod article. No problem when in a standard Joomla article.

So, Seblod isn't totally compatible with Sourcerer, good to know !

Sorry for the question, but it can help others.

Thanks
Peter van Westen's Avatar Peter van Westen ADMIN
You have your entire code surrounded with <pre> tags. That is probably the result of you copy/pasting code into your editor.
You could have seen this in.... "the Element Inspector of your browser."
Please post a rating at the Joomla! Extensions Directory
Christophe Lebis's Avatar Christophe Lebis
Yes, I had see that <pre> but there is no css line about it in my element inspector, so I didn't thank any effect about font-family.



It seems to be a problem of editor, because this <pre> has been added to my code at saving the article (it's not copy/paste). I'll test to see if I can reproduce that, and how precisely, and only when using Seblod article or not.

Thanks
Christophe Lebis's Avatar Christophe Lebis
Finally, you are right, I must have copied tags {source} {/source}directly in documentation, and I did not matter with html code (between editor and code editor). The only code who is added by editor is {source}<span style="font-family: courier new, courier, monospace;"> but without effect on the view.

In fine, I would have learn to display user agent style on my browser 😐

Sorry, and thanks a lot.
Peter van Westen's Avatar Peter van Westen ADMIN
Happy you have it figured out and working now.
Please post a rating at the Joomla! Extensions Directory
You can only post on the extension support forum if you have an active subscription and you log in

Buy a Pro subscription