CMS MADE SIMPLE FORGE

Babel: Multilingual site

 

[#4697] [PATCH] New command page_id / page_alias

avatar
Created By: Ludovic LANGE (llange)
Date Submitted: Thu Mar 18 08:40:05 -0400 2010

Assigned To: Pierre-Luc Germain (plger)
Version: Babel: Multilingual site 0.3.4
CMSMS Version: None
Severity: Major
Resolution: None
State: Open
Summary:
[PATCH] New command page_id / page_alias
Detailed Description:
Sometimes, it can be desirable to have the id or alias of a corresponding page
in another language.

In particular, when you template (or first page) doesn't use menus - sometimes
you have to "hardcode" links.

With {babel action="menu"}, you have only full URLs, and with {menu
start_level="2"} you will have a full hierarchy.

This patch adds a new action (in fact, two) :
{babel action="page_id" page="....."} will echo the id of the corresponding page
in the current language.
You can assign it to a Smarty variable ( {babel action="page_id" page="...."
assign="my_variable"} ) to re_use it in {cms_selflink page=$my_variable}.

The other syntax is : {babel action="page_alias"} and returns the alias instead
of the id.

The patch applies to current SVN : http://pastebin.com/YNCExams

Regards,

Ludovic


History

Comments
avatar
Date: 2010-03-18 11:48
Posted By: Ludovic LANGE (llange)

New version of the patch, to account for a little caching bug in CMSMS :
http://pastebin.com/cY89BfAn
      
avatar
Date: 2010-03-18 14:07
Posted By: Pierre-Luc Germain (plger)

This is definitely a FR and not a bug report. This being said, that's a very
interesting feature that should be added to the next release.
BTW, feel free to request to join the project if you're interested.
      
Updates

Updated: 2010-03-18 11:48
resolution_id: => 5