Page 1 of 1

[SOLVED]UDT error with $page_alias

Posted: Thu Jan 10, 2008 2:37 pm
by Lesh
Hi i created an UDT called test with the content

Code: Select all

echo $params['text']
This UDT i open in a content page

with

Code: Select all

{test text=$page_alias}
Now i receive following error as well in the preview as on the normal site:

Code: Select all

string(142) "Smarty error: [in content:content_en line 1]: syntax error: invalid attribute name: 'text' 
(Smarty_Compiler.class.php, line 1536)" string(126)
 "Smarty error: [in content:content_en line 1]: syntax error: invalid attribute name: '=' (Smarty_Compiler.class.php, line 1536)" 
string(149) "Smarty error: [in content:content_en line 1]: syntax error: invalid attribute name: '$page_alias' (Smarty_Compiler.class.php, line 1536)"
How can i solve this problem?
Thanks a lot

Re: UDT error with $page_alias

Posted: Thu Jan 10, 2008 2:44 pm
by cyberman
Use {$page_alias} instead :) ...

Re: UDT error with $page_alias

Posted: Thu Jan 10, 2008 2:59 pm
by Lesh
Instead of what?

Because i need it in the UDT that:  $variable=Pagealias

Re: UDT error with $page_alias

Posted: Thu Jan 10, 2008 3:09 pm
by calguy1000
Well, I created a UDT called param_test with this content:

Code: Select all

print_r($params); echo '<br/>';
if( isset($params['alias']) ) echo "DEBUG: alias=".$params['alias'].'<br/>';
and called it like this:

Code: Select all

{param_test param1="value1" alias=$page_alias}
and it worked as expected.

Re: UDT error with $page_alias

Posted: Thu Jan 10, 2008 4:34 pm
by Lesh
Thank you very much it works now!!!