Features / Usability

Features / Usability

How can I use html in the body of a wiki plugin in a Smarty template ?

posts: 8502 Israel

I though I saw it work before Tiki20 but...

On a Tiki 20 I use a PluginTracker to display a form.
I use a smarty template for the display and need to embed a fade wikiplugin that include as body more smarty element (html).

But it shows the html code unless I use a "barbaric" way.

{wikiplugin _name=fade label="Depart" icon="y" bootstrap="y"}{literal}{HTML()}
<div class="row">
	<div class="col-md-6">nom :</div>
	<div class="col-md-6">{/literal}{$f_contact_Nom}{literal}

Anyone has a clever idea ?

posts: 126817 United Kingdom

The body of a wiki plugin is parsed as wiki markup, so if you have html disallowed (as is sensible) it will be escaped unless you put it in an html plugin as you have here.

So either use wiki plugins (like DIVs in this case) or an html one like this, I don't think there's a better solution.

Unless anyone knows better? rolleyes

posts: 8502 Israel

Thanks Jonny,

I tried a few variations before posting.

"wiki plugins (like DIVs in this case)" I used the {DIV()} way in several case. While not happy with it, it work. In this case I have quit a few lines like and fear to hit the DIV wall :-)

I tried the {HTML()} way but I had to escape {/literal}{literal} (as my sample show above) if this is what you mean (?).

I enabled "Allow HTML " but it still display the html code.

I played with security (HTML purifier and Output should be HTML purified) but it still display the html code.

Ideally being in a smarty template, I think that the body of a wikiplugin should follow or at least it should be an option. Of course it may be not as easy as writing it. ;-)