Forums / Setup & design / Multi language en custom menu.

"Please Note:
  • At the specific request of Ibexa we are changing this projects name to "Exponential" or "Exponential (CMS)" effective as of August, 11th 2025.
  • This project is not associated with the original eZ Publish software or its original developer, eZ Systems or Ibexa".

Multi language en custom menu.

Author Message

laurent le cadet

Thursday 11 August 2005 7:14:17 am

Hi,

I made a custom menu to have a drop down list :


<div class="isuga">
<form action="" method="get">
<select name="l_isuga" id="l_isuga" onchange="window.location=this.form.l_isuga.options[this.form.l_isuga.selectedIndex].value;">
                  <option value="" selected="selected">----------------------------------------------</option>
{section name=isuga loop=fetch( content, list, hash( parent_node_id, 102 ) )}
                  <option value="{$:item.url}">{$:item.name}</option>
{/section}
</select>
</form>
</div>

It's ok but as I have a multilanguage site, this way, it can't be used only for the default language.

What must I do with the value {$:item.url} to print a good URL (/fr/my_url or /en/my_url) ?

The name {$:item.name} in the dropdown list is translated but the URL is wrong.

Yhanks.

Laurent

Hans Melis

Thursday 11 August 2005 7:53:01 am

Hi,

ezurl should catch that one:

<option value={$:item.url|ezurl}>{$:item.name|wash}</option>

Yes, the double quotes have been left out intentionally as ezurl adds them, unless you call it with |ezurl(no).

Does that work?

Hans
http://blog.hansmelis.be

laurent le cadet

Thursday 11 August 2005 8:05:29 am

Hi Hans,

You smarter than me ;)

Thanks

Laurent

laurent le cadet

Thursday 11 August 2005 8:09:49 am

just one more thing...

How can I dothe same with a singleimage

<a href="/espace_etudiants"><img src={"images/une_etudiants.jpg"|ezdesign} alt="Espace étudiants" /></a>

Hans Melis

Thursday 11 August 2005 8:15:09 am

It's not entirely clear to me what you want to do, but I guess you want to change the url around the image :)

Fairly similar to the above solution:

<a href={"/espace_etudiants"|ezurl}><img... /></a>

Hans
http://blog.hansmelis.be

laurent le cadet

Thursday 11 August 2005 8:17:41 am

You are right again.

Many thanks.

Laurent

laurent le cadet

Wednesday 17 August 2005 5:55:20 am

Hi again,

I still need some help with the different langage.
I have images which are background of a <div> and this images are title of folders (just for a better design).
Is it possible to make a {swich} around the <div> tags based on the siteaccess to make differents {case} ?

Regards.

Laurent