User defined Tags -- Conditions are not checked -- give the solution

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
kumaran
Forum Members
Forum Members
Posts: 30
Joined: Thu Apr 03, 2008 6:43 am

User defined Tags -- Conditions are not checked -- give the solution

Post by kumaran »

Greetings Friends,

I get the values from user defined tags(UTD). But I unable to check the if condition. Please look the following my code.

Please give the solution...

Page name is test

activelink----- UDT
===============

$pageurl=count(explode('/',$_REQUEST["page"]));
if($pageurl==1)
{
echo $pagename=$_REQUEST["page"];
}
else
{
echo $pagename=end(explode('/',$_REQUEST["page"]));
}


Global Content blocks
-----------------------------
{if activepagelinktest eq 'test'} welcome {/if}

Please give the solution for me...

Regards

Kumaran
alby

Re: User defined Tags -- Conditions are not checked -- give the solution

Post by alby »

kumaran wrote: I get the values from user defined tags(UTD). But I unable to check the if condition. Please look the following my code.
You display the value (echo) then you don't have any value.
And where is your UDT (activelink) call?

Alby
kumaran
Forum Members
Forum Members
Posts: 30
Joined: Thu Apr 03, 2008 6:43 am

Re: User defined Tags -- Conditions are not checked -- give the solution

Post by kumaran »

Hi Alby,

I call the {activelink} in global content pages. But inner i check the condition for example below.

{if activelink eq 'test'} get the blank of the result is empty. How I check the condition...

Please guide me, very urgent...

Thanks & Regards

Kumaran
NaN

Re: User defined Tags -- Conditions are not checked -- give the solution

Post by NaN »

The active link should be the page alias of the currently displayed page, shouldn't it?
Use {get_template_vars} to see what template vars contains what data.
You don't need an UDT to get the active link.
alby

Re: User defined Tags -- Conditions are not checked -- give the solution

Post by alby »

NaN wrote: The active link should be the page alias of the currently displayed page, shouldn't it?
yes, if it's then:

Code: Select all

{if $page_alias eq 'test'} welcome {/if}
or indeed (not tested):

Code: Select all

global $gCms;

$pageurl=count(explode('/',$_REQUEST["page"]));
if($pageurl==1)
{
   $pagename=$_REQUEST["page"];
}
else
{
   $pagename=end(explode('/',$_REQUEST["page"]));
}   

$gCms->smarty->assign('activepagelinktest', $pagename);

and:
{if $activepagelinktest eq 'test'} welcome {/if}


Alby
Post Reply

Return to “Developers Discussion”