Including html in ossn.en.php

Mick Dawlings Posted in Technical Support 1 year ago

I notice I can have some html code in the ossn.en.php file such as <br /> and some others.
Is there a way I can also include a clickable url?
I can make it work but then it shows html code in the lower green bar.

Replies
German Michael Zülsdorff Replied 1 year ago

No, php goes exactly where you placed it.
Right that's why you have to take care whether it fits in that place or not.

Imagine YOU are PHP and programmed to say nothing but "Good morning".
Meeting your friends at 8 a.m. would fit, but meeting them at 8 p.m. would make them wonder. ;)

us MAURICE TAYLOR Replied 1 year ago

Dang @Michael, I'm drowning in knowledge after this lol
Because ossn is build on php I gotta go back over what you wrote to understand it. What I understand so far is. I know that <div> tags don't go into <p> because of html rules. Php goes into the body not the <p> tags but in <?php and ?> if i understand correctly.

German Michael Zülsdorff Replied 1 year ago

Yes and no. Basically, ossn_print() doesn't do any kind of HTML checking . Thus, the developer is responsible for the validity of the resulting code.

Talking about a paragraph for example

<p> ... some more static tags ... ossn_print('a_variable_placeholder'); ... </p>

Here the developer needs to know, that a construct like <div> .... </div> is invalid inside of a paragraph.

So it makes no difference if he would use static hml

<p><div></div></p>

or

<p><?php ossn_print('a_variable_placeholder'); ?></p>

and using a language string like 'a_variable_placeholder' => '<div></div>',
'
Both ways lead to invalid html.

That said, before making any kind of html part of a language string, the developer must verify if it is allowed at all with respect to the surrounding parent tags.

us MAURICE TAYLOR Replied 1 year ago

reading these questions and answers make me realize i have to better formulate my questions. The knowledge im gaining here is diverse. I wonder if it can handle HMTL SEMANTIC layout.

Indonesian Arsalan Shah Replied 1 year ago

Depending on where and in which type of html element string is used.