Page 1 of 1

Self link inside user defined tag?

Posted: Sat Jul 15, 2006 8:03 pm
by boscopup
There may be some better way to do this than what I'm trying to do, so feel free to suggest complete alternatives. :)

I have a members-only menu that shows up when someone logs in. To make it easier to edit the member menu (which needs to be added to two different templates), I created a user defined tag - {member_menu}. I did this when I was using clean urls that 0.13 defaults to, but... since calendar is broken when clean urls are used (can't change months), I turned off clean urls. I can change the member links to use the non-clean format, but I thought... Hey, I should be using {cms_selflink} and then if calendar gets updated and I decide to one day turn clean urls back on, I don't have to change all the links in my member's menu.

So... Is there a way to use the {cms_selflink} tag within a user defined tag? Or do I need to hard code those urls? When I tried using the tag, it put the actual tag in my url. :P

Re: Self link inside user defined tag?

Posted: Sat Jul 15, 2006 9:13 pm
by Dr.CSS
you may have to use the {literal} your stuff here{/literal} tags...

clik the Source button and put it in there...

Re: Self link inside user defined tag?

Posted: Sat Jul 15, 2006 9:25 pm
by boscopup
Thanks, but this isn't in a content page. It's in the template itself, so I'm already working with source. :) I need some way to have one set of menu links that is used in two separate templates, only having to edit them in one place, and preferably using the cms_selflink functionality so I don't have to edit all those links later. Hopefully that makes some sense...

Re: Self link inside user defined tag?

Posted: Wed Apr 27, 2011 11:43 am
by pustofkj
Hi, you can use function smarty_cms_function_cms_selflink instead of {cms_selflink} call... as below:

Code: Select all

global $gCms;

$params = array('page' => 'my-page-alias', 'text' => 'Link to MY PAGE');  // possibly other parameters
echo smarty_cms_function_cms_selflink($params, $gCms->GetSmarty());