Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help with Customizing Navigation Menus
#9
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>
(uses black, if linkcolor is not set; htmlspecialchars for security reasons, if you use a text field as opposed to a dropdown)
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply


Messages In This Thread
Help with Customizing Navigation Menus - by sal - 2012-08-20, 14:10:46
Help with Customizing Navigation Menus - by sal - 2012-08-21, 16:50:33
Help with Customizing Navigation Menus - by sal - 2012-08-21, 16:57:06
Help with Customizing Navigation Menus - by sal - 2012-08-21, 17:09:13
Help with Customizing Navigation Menus - by mvlcek - 2012-08-22, 19:03:33



Users browsing this thread: 2 Guest(s)