have a cms snippet in the top navigation, when on one of these pages i would like to set the css class current.
In the navigation template, i can tell when i am on one of my cms pages, what i need to do is pass the css smarty variable to my snippet. The question is how?
If in the nav template i set
[{assign var=“classcur” value=‘class=“current”’}]
It does not appear in the cms snippet (wird nicht ersetzt)
cause the cms page you wants to link to is loaded into $oCont and the actual page you are on in $oContent, you can check if the title of them both are equal. You can also check on idents or oxid, I#m not sure why i did use the title for this purpose.
In my cms snippet, smarty is not parsed (or php).
Create a manual piece of cms - write the following
[{assign var=“classcur” value=‘test"’}]
[{$classcur}]
<?php echo “test2”; ?>
and when you include this anywhere, nothing is shown?
…another way round it, would be search and replace.
But how do i get this [{oxcontent ident=bartelsnav}] into a smarty variable ?
I tried this
[{assign var=“newtest” value=‘oxcontent ident=bartelsnav’}]
but it does not work
have a look inside the oxcontent function to see which parameter it supports. you will find a hint how to assign it to a variable
core/smarty/plugins/function.oxcontent.php