Self link inside user defined tag?

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
boscopup
Forum Members
Forum Members
Posts: 35
Joined: Wed May 04, 2005 3:48 pm

Self link inside user defined tag?

Post 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
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Self link inside user defined tag?

Post by Dr.CSS »

you may have to use the {literal} your stuff here{/literal} tags...

clik the Source button and put it in there...
boscopup
Forum Members
Forum Members
Posts: 35
Joined: Wed May 04, 2005 3:48 pm

Re: Self link inside user defined tag?

Post 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...
pustofkj
Forum Members
Forum Members
Posts: 19
Joined: Fri Feb 04, 2011 1:57 pm

Re: Self link inside user defined tag?

Post 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());
Post Reply

Return to “CMSMS Core”