News:

Support the VirtueMart project and become a member

Main Menu

Styling Custom Fields Dropdown String

Started by channelsurfer, September 24, 2015, 16:17:53 PM

Previous topic - Next topic

channelsurfer

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.

channelsurfer

#1
 :'( God... This makes me crazy... Looked about thousands rows of code... And still nothing...

Anybody, pls.... I'm almost to despair.

GJC Web Design

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/
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

channelsurfer

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.

:(

GJC Web Design

so the problem must be further back where the html is formed....
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

PRO

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);