Use metadata value as class in design area menu


(David Wallace) #1

Hi

 

I'm trying to change the class of a nav menu item so I can change it's colour according to a value in metadata.

 

Here's the snippet of the parse file

 

             <ul class="menu">
             <MySource_ASSET>
               <li class="<MySource_PRINT var=asset_metadata_MenuColour_key />"><MySource_PRINT var="asset_short_name_linked" /></li>
 
I've tried a few different combinations but nothing I do seems to output anything.
 
What is the correct way to use metadata keywords in a "menu_normal" design area?

 

Thanks

 

Dave

 


(Bart Banda) #2

That should be it, but can't remember if _key is supported within a design print tag like that.

 

And also, you might need quotes around the actual var.

 

What does this give you?

<li class="<MySource_PRINT var="asset_metadata_MenuColour" />"><MySource_PRINT var="asset_short_name_linked" /></li>

(David Wallace) #3

Thanks Bart, that worked.