using extra page attributes

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
markS
Forum Members
Forum Members
Posts: 58
Joined: Wed Aug 20, 2008 3:04 pm

using extra page attributes

Post by markS »

Hello,
       Firstly I'd like to thank all the contributors to this cms, it has proved to be a fantastic system for me.  I really appreciate all the hard work everyone has put into this, hopefully I'll be able to contribute something back before too long.

I've just installed v1.4.1 and I have a question regarding the new  'Extra Page Attributes'.

I found this post http://forum.cmsmadesimple.org/index.php/topic,23777.msg115672.html#msg115672, that explains how to use them in the context of the menu manager: $node->extra1 

That seems clear enough, but I'd like to use those values within a UDT but I can't seem to expose the values within my tag, how should I reference them(I'm trying to use the value in extra1 to restrict the view of certain pages)?  Do I need a particular module installed?

Thanks in advance for any help you can give me.

Mark.
User avatar
Augustas
Forum Members
Forum Members
Posts: 241
Joined: Wed Oct 17, 2007 6:09 pm

Re: using extra page attributes

Post by Augustas »

In order to access extra1/ extra2 / extra3 in UDT you can do this:
1) install CGSimpleSmarty module
2) in UDT use this code:

Code: Select all

global $gCms;
$cgsimple = $smarty->get_template_vars('cgsimple');
$extra1 = $cgsimple->get_page_content($page_alias, 'extra1');
Here, "$page_alias" is the ID or Alias of the page.

If you don't want to install CGSimpleSmarty module, you can at least look at PHP code of this module in order to see an example how the "extra1" is retrieved.
http://FollowTheRoad.com/ - living on the road...
http://www.kligys.com/ - asmeninis blog'as...
markS
Forum Members
Forum Members
Posts: 58
Joined: Wed Aug 20, 2008 3:04 pm

[solved] Re: using extra page attributes

Post by markS »

Many thanks for getting back to me on this.  I eventually achieved what I was trying to do with a different technique, but I'm grateful that you've explained this to me.

Maybe I should dig around in the source some more to get a better understanding of what's going on under the hood...

Thanks again.

Mark.
SideshowBob
Forum Members
Forum Members
Posts: 80
Joined: Thu Sep 13, 2007 10:50 am

Re: using extra page attributes

Post by SideshowBob »

Hi,

I used this UDT with the CGSimpleSmarty module installed.

Code: Select all

global $gCms;
$page_alias = $smarty->get_template_vars('page_alias');
$cgsimple = $smarty->get_template_vars('cgsimple');
echo $cgsimple->get_page_content($page_alias, 'extra1');
Bob
Post Reply

Return to “CMSMS Core”