VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: channelsurfer on September 24, 2015, 16:17:53 PM

Title: Styling Custom Fields Dropdown String
Post by: channelsurfer on September 24, 2015, 16:17:53 PM
Dear Community,

Any ideas how to use HTML Tags (<br />, <strong>) in a String custom field or how i can manage to style the list element.

My list element looks like this now:

<b>goodMorning</b><br /> (1 Yogalektion, Frühstück) +25,00 €

And I want it like this:

goodMorning
(1 Yogalektion, Frühstück)
+25,00 €


Thanks for any inputs.
Title: Re: Styling Custom Fields Dropdown String
Post by: channelsurfer on September 28, 2015, 15:21:54 PM
 :'( God... This makes me crazy... Looked about thousands rows of code... And still nothing...

Anybody, pls.... I'm almost to despair.
Title: Re: Styling Custom Fields Dropdown String
Post by: GJC Web Design on September 29, 2015, 00:00:00 AM
don't think so

1. you can't have html in a select option
2. the li is generated by chosen JS -- quick Google says no one can get html to display in it
e.g. http://stackoverflow.com/questions/21941516/is-it-possible-to-display-html-content-inside-a-jquery-chosen-plugin-option

3. your html tags are being turned into entities

<option value="70">goodMorning&nbsp;&nbsp;&nbsp;&nbsp;&lt;em&gt;(1 Yogalektion, Frühstück im Frida)&lt;/em&gt; +25,00 €</option>
(have u tried config them as e.g. &lt;  etc  ?  ) i.e the other way round?


I used another JS select replacement script to generate this "select" with html (images in this case)

http://www.marghoobsuleman.com/jquery-image-dropdown

but tried the option html as

<?php echo $language->title_native;?>&lt;br /&gt;nelly&lt;br /&gt;&lt;em&gt;fred&lt;/em&gt;

and renders fine  ->  http://test.gjcwebdesign.com/joomla336/en/
Title: Re: Styling Custom Fields Dropdown String
Post by: channelsurfer on September 29, 2015, 06:48:27 AM
hi,

thank you for the info. i thought so.

I tried "&lt;" and etc. I also tried to use the replacement script but without success. The html tag are still turned in to entities.

:(
Title: Re: Styling Custom Fields Dropdown String
Post by: GJC Web Design on September 29, 2015, 10:36:21 AM
so the problem must be further back where the html is formed....
Title: Re: Styling Custom Fields Dropdown String
Post by: PRO on September 29, 2015, 11:01:18 AM
I would just do it in the template

$field->display='<b>'.$field->display.'</b>';
$field->display=str_replace( '(', '</b><br/> (', $field->display);
$field->display=str_replace( ')', '</b><br/> )', $field->display);