2012-08-22, 19:03:33
michaellindahl Wrote:Awesome. The I18N plugin is working well. One question I have now come across. I would like to store additional values like colors using the custom fields plugin and then access them in the navigation bar creation component. I then tried using
Code:<?php echo return_custom_field('link-color'); ?>;"></span>
However it would always give me the current page that I am on's link color and not the link color of the page that the program is currently outputting. Is what I'm trying possible?
You need to name your custom field like a valid PHP variable (characters, _, NO -), e.g. linkcolor.
Then you can access it in your component for I18N navigation rendering e.g. like:
Code:
<span style="color:<?php echo $item->linkcolor ? htmlspecialchars($item->linkcolor) : 'black'; ?>;">...</span>