Developer forum

Forum » Templates » menus on sites with several languages

menus on sites with several languages


Reply
Hi,

How do you guys solve the following problem:

Im having a site with a number of languages(websites)

In order to keep the number of master layout files to one (now translation on this level has been fixed ;-) ) I do need to set the parentid of the menu.

My first attempt was to translate the ID like this:
            ul title="Footermenu" class="dwnavigation hmenu" id="FooterNavigation" settings="startlevel:3;endlevel:4;template:LIClean.xslt;expandmode:all;parentid:<--@Translate(ID,'1224')-->">/ul>

this didnt work out,

Next attembt was to use an old bug, where you couldnt render a "absolute" menu from another website/language - this has been fixed, so it dint work either.

Third attempt was to use the <--@Lang--> in the page layout files like this:
.html)-->

of cause didnt work either, but worth the shot ;-)

Last pathetic attempt:
Using the old stylesheets, to see if I could render the menus in the new layout. Since some of the other settings from the stylesheets are used as fallback in the layouts, I thought ther ecould be a chance here...but NO!

So any idea how to add a menu using a parentid on a multlingual website, without having to do a new set of templates for each language?

/Regin Madsen

Replies

 
Nicolai Høeg Pedersen
Reply
Using 19.2.0.9 there is a brand new setting called parenttag that can be used instead of parentid setting.

It uses a word which can be added to the pages properties navigation settings.

See screendump attached
Capture.PNG
 
Reply
OK, nice - the parenttag - what value shall it match?
 
Nicolai Høeg Pedersen
Reply
Have a look at the screendump.

On the pages properties, navigation dialog, you have something called "Navigation tag". You give this a name on language x, and use the value of this field as your parenttag value.

Then on language y, find another page give it the same "navigation tag" value.

Then when the master template is used on language x it will take the children from the page with the navigation tag, and when used on language y, it will take the children from the page there with the same navigation tag....
 
Reply
hmmm think that was exactly what I did, but doesnt seem to work though
See the screenshot
/R
Screen shot 2011-02-10 at 15.39.17 .png
 
Nicolai Høeg Pedersen
Reply
Try removing startlevel and endlevel... What level is your parenttag vauue situated?
 
Reply
hmmmm....

Well first of all: Now it seems to be as it should.

However I have had a lot of problems. I have to menues this way

First of all It would only render the first navigationtag, the rest was just the entire menustructure.

Secondly I had to move my menus to level1, before it even worked.

Then I did some testing, found that it seem like only the first tag was rendered correct, and deleted the testpage (which at that moment was the only page with a navtag on).

Now none of the menues was renderede correctly!
So I did revert the deleted page, from the trashbin, and removed the navigationtag on that page, and now it works like a charm. No problems what so ever!

I have copy pasted navigationtags, so they were correct for sure. So why this behavior? No idea!

But lets say It was just some kinda fraud, if Ill experience that again Ill let you know.

Thanks for changes - this will really bring the translation system to a new league!

Regin Madsen
haug-it ApS

 

You must be logged in to post in the forum