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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 18:30:58
Script start
Timing: Jan 18 2025 18:30:58
Module start 'layout'
Timing: Jan 18 2025 18:30:58
Module start 'content'
Timing: Jan 18 2025 18:30:58
Module end 'content'
Timing: Jan 18 2025 18:30:58
Script end

Main resources:

Total runtime0.8549 sec
Peak memory usage4,096.0000 KB
Database Queries69

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0059 589.0469152.6250
Module start 'layout' 0.00590.0027 741.671939.4453
Module start 'content' 0.00850.8441 781.1172588.5781
Module end 'content' 0.85260.0022 1,369.695316.1641
Script end 0.8549  1,385.8594 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.3927160.0002
Check MTime0.00140.1606160.0001
Mysql Total
Database connection0.00140.159910.0014
Mysqli_queries0.773690.4899690.0112
Looping result0.00070.0851670.0000
Template Total0.810394.820.4051
Template load0.00210.246620.0011
Template processing0.808294.531620.4041
Template load and register function0.00010.014810.0001
states
state_id_array0.00150.179310.0015
state_identifier_array0.00360.426020.0018
Override
Cache load0.00190.2170480.0000
Sytem overhead
Fetch class attribute can translate value0.00140.164920.0007
Fetch class attribute name0.00170.195290.0002
XML
Image XML parsing0.00110.131820.0006
class_abstraction
Instantiating content class attribute0.00000.0038140.0000
General
dbfile0.00100.1181210.0000
String conversion0.00000.000940.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
7content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
7content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
10content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 31
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs