*Solved* Parameters in MenuManager to a User defined Tag (UDT)

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Locked
SimonSchaufi

*Solved* Parameters in MenuManager to a User defined Tag (UDT)

Post 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?
Last edited by SimonSchaufi on Thu Sep 20, 2007 3:23 pm, edited 1 time in total.
alby

Re: Parameters in MenuManager to a User defined Tag (UDT)

Post 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
Last edited by alby on Thu Sep 20, 2007 9:16 am, edited 1 time in total.
SimonSchaufi

Re: Parameters in MenuManager to a User defined Tag (UDT)

Post 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;
Last edited by SimonSchaufi on Thu Sep 20, 2007 9:19 am, edited 1 time in total.
alby

Re: Parameters in MenuManager to a User defined Tag (UDT)

Post 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
Last edited by alby on Thu Sep 20, 2007 9:32 am, edited 1 time in total.
SimonSchaufi

Re: Parameters in MenuManager to a User defined Tag (UDT)

Post 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
alby

Re: Parameters in MenuManager to a User defined Tag (UDT)

Post 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
SimonSchaufi

Re: Parameters in MenuManager to a User defined Tag (UDT)

Post by SimonSchaufi »

yeah, now it works!

what was the problem now?
Last edited by SimonSchaufi on Tue Oct 16, 2007 11:25 am, edited 1 time in total.
alby

Re: Parameters in MenuManager to a User defined Tag (UDT)

Post by alby »

SimonSchaufi wrote: yeah, not it works!

what was the problem now?
???
I clear cache and working on my test

Alby
SimonSchaufi

Re: *Solved* Parameters in MenuManager to a User defined Tag (UDT)

Post 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! ;)
Last edited by SimonSchaufi on Thu Sep 20, 2007 3:27 pm, edited 1 time in total.
Locked

Return to “Modules/Add-Ons”