Forums / Setup & design / Language links within menu?

Language links within menu?

Author Message

Olaf Fichtner

Sunday 04 July 2010 9:15:48 pm

Hello,

I wonder if anyone ever tried to embed language links into for example the top menu. I am sure there must be a method to create a manual link to switch to a language, a link that can be inserted into a menu - but I have not discovered any...

Yannick Komotir

Monday 05 July 2010 8:19:50 am

Hello,

are you try to do this with the switchlanguage module ?

<|- Software Engineer @ eZ Publish developpers -|>
@ http://twitter.com/yannixk

Olaf Fichtner

Monday 05 July 2010 9:19:13 am

I think so... Sorry, I only started recently, with 4.3, so I am not sure how this was done in previous versions. I just searched and it seems that there is a built-in module called "switchlanguage" in 4.3. (heard of it the first time), so the answer should probably be "yes".

Olaf Fichtner

Tuesday 06 July 2010 12:12:57 am

I think I made a little bit progress: I put the content of extension/ezwebin/design/ezwebin/templates/page_header_languages.tpl into extension/ezwebin/design/ezwebin/templates/menu/double_top.tpl, right before the /ul for topmenu-firstlevel.

Language links are correctly showing up in the topmenu now, but they are lining up with all other menu items on the left. Now I try to find a way to get them aligned to the right, while regular menu items should be on the left...

Btw, if I want to use an override for double_top.tpl, where should I put that? I tried extension/ezwebin/design/ezwebin/override/templates, but there was no change...

Olaf Fichtner

Wednesday 14 July 2010 6:51:10 am

OK, solved. I am sure there may be a more elegant way to do this, but I got it working this way:

As I said, I copied the code from the languages template into the double top menu template, between the closing ul for the first line and the closing div. I put the code into a ul with the id "topmenu-language".

Next I copied all CSS settings regarding "topmenu-firstlevel" into my override CSS, renaming "firstlevel" to "language" and added a "float:right" to "div#topmenu ul#topmenu-language li", because I wanted the regular menu items on the left, while language links should be on the right. In the same section I changed the separator image setting from left bottom to right bottom and copied the separator and selected link background image to the override image folder.

To highlight the selected language, I changed "li.selected" in these sections to "li.current_siteaccess". Unfortunately the language code does not know "firstli" to designate the first link (though that probably could be done), so there is a separator line on the right edge, but I can live with that.

Maybe this helps someone to break the "typical ezP layout" that sometimes gets mentioned here on the forums. And if someone has a better solution, don't be shy...

eZ debug

Timing: Jan 18 2025 04:16:21
Script start
Timing: Jan 18 2025 04:16:21
Module start 'content'
Timing: Jan 18 2025 04:16:22
Module end 'content'
Timing: Jan 18 2025 04:16:22
Script end

Main resources:

Total runtime1.3242 sec
Peak memory usage4,096.0000 KB
Database Queries200

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0054 588.8281180.8359
Module start 'content' 0.00541.1913 769.6641558.1953
Module end 'content' 1.19670.1274 1,327.8594337.3750
Script end 1.3241  1,665.2344 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00420.3148210.0002
Check MTime0.00160.1199210.0001
Mysql Total
Database connection0.00080.060010.0008
Mysqli_queries1.255994.84752000.0063
Looping result0.00200.15311980.0000
Template Total1.296297.920.6481
Template load0.00200.152520.0010
Template processing1.294297.733520.6471
Template load and register function0.00020.013110.0002
states
state_id_array0.00110.080110.0011
state_identifier_array0.00150.113320.0007
Override
Cache load0.00170.1280210.0001
Sytem overhead
Fetch class attribute can translate value0.00190.146730.0006
Fetch class attribute name0.00140.104860.0002
XML
Image XML parsing0.00110.081030.0004
class_abstraction
Instantiating content class attribute0.00000.001160.0000
General
dbfile0.00230.1743270.0001
String conversion0.00000.000430.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 13
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs