Page 1 of 1
*Solved* Parameters in MenuManager to a User defined Tag (UDT)
Posted: Thu Sep 20, 2007 8:05 am
by SimonSchaufi
I am not a smarty professional so i am looking for somebody who can help me:
(
Smarty Capture Link)
I want to call a UDT in the MenuManager with one parameter which is the URL.
It doenst work like this:
Code: Select all
{capture name=uri}
{$node->url}
{/capture}
{if $smarty.capture.uri ne ''}
<div id="test">{switch_lang url="$smarty.capture.uri"}</div>
{/if}
but like this:
Code: Select all
...
{if $smarty.capture.uri ne ''}
{$smarty.capture.uri}
{/if}
but that doenst help me.
Code: Select all
string(149) "Smarty error: [in module_db_tpl:MenuManager;languages line 19]:
syntax error: $smarty. is an unknown reference (Smarty_Compiler.class.php, line 2126)"
this doenst work as well:
Code: Select all
{assign var='name' value='{$node->url}'}
The value of $name is {$name}.
Is there i way this can work?
Re: Parameters in MenuManager to a User defined Tag (UDT)
Posted: Thu Sep 20, 2007 9:11 am
by alby
SimonSchaufi wrote:
It doenst work like this:
Code: Select all
{capture name=uri}
{$node->url}
{/capture}
{if $smarty.capture.uri ne ''}
<div id="test">{switch_lang url='{$smarty.capture.uri}' }</div>
{/if}
Try this:
Code: Select all
{capture name=uri}{$node->url}{/capture}
{if $smarty.capture.uri ne ''}
<div id="test">{switch_lang url='$smarty.capture.uri' }</div>
{/if}
Alby
Re: Parameters in MenuManager to a User defined Tag (UDT)
Posted: Thu Sep 20, 2007 9:17 am
by SimonSchaufi
output is:
$smarty.capture.uri
this is the udt:
Code: Select all
global $gCms;
$content_id = $gCms->variables['content_id'];
$contentops =& $gCms->GetContentOperations();
$contentobj = $contentops->LoadContentFromId($content_id);
$content_alias = $contentobj->Alias();
$url = $params['url'];
$lang = substr($content_alias, 0, 2);
$alias = substr($url, 2);
echo $gCms->config["root_url"].DIRECTORY_SEPARATOR."index.php?".$gCms->config["query_var"]."=".$lang.$alias;
Re: Parameters in MenuManager to a User defined Tag (UDT)
Posted: Thu Sep 20, 2007 9:29 am
by alby
SimonSchaufi wrote:
output is:
$smarty.capture.uri
this is the udt:
global $gCms;
$content_id = $gCms->variables['content_id'];
$contentops =& $gCms->GetContentOperations();
$contentobj = $contentops->LoadContentFromId($content_id);
$content_alias = $contentobj->Alias();
$url = $params['uri'];
$lang = substr($content_alias, 0, 2);
$alias = substr($url, 2);
echo $gCms->config["root_url"].DIRECTORY_SEPARATOR."index.php?".$gCms->config["query_var"]."=".$lang.$alias;
Alby
Re: Parameters in MenuManager to a User defined Tag (UDT)
Posted: Thu Sep 20, 2007 9:47 am
by SimonSchaufi
the parameter is url, not uri!
does it work in your cms? can you test it, please?
i have cmsms 1.1.2
Re: Parameters in MenuManager to a User defined Tag (UDT)
Posted: Thu Sep 20, 2007 10:26 am
by alby
SimonSchaufi wrote:
the parameter is url, not uri!
does it work in your cms? can you test it, please?
i have cmsms 1.1.2
my mistake, in my test i used
uri.
Ok, my test working. udt is same and in menu template:
Code: Select all
{capture name=uri}{$node->url}{/capture}
{if $smarty.capture.uri ne ''}
<div id="test">{switch_lang url=$smarty.capture.uri}</div>
{/if}
Alby
Re: Parameters in MenuManager to a User defined Tag (UDT)
Posted: Thu Sep 20, 2007 10:35 am
by SimonSchaufi
yeah, now it works!
what was the problem now?
Re: Parameters in MenuManager to a User defined Tag (UDT)
Posted: Thu Sep 20, 2007 10:45 am
by alby
SimonSchaufi wrote:
yeah, not it works!
what was the problem now?

I clear cache and working on my test
Alby
Re: *Solved* Parameters in MenuManager to a User defined Tag (UDT)
Posted: Thu Sep 20, 2007 3:20 pm
by SimonSchaufi
ok the problem was the "" and to write the first block in one line.
This helped me to build the FIRST multilingual homepage where you can switch between the language of each site! Yeah!
