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.
using extra page attributes
Re: using extra page attributes
In order to access extra1/ extra2 / extra3 in UDT you can do this:
1) install CGSimpleSmarty module
2) in UDT use this code:
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.
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');
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.
[solved] Re: using extra page attributes
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.
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.
-
- Forum Members
- Posts: 80
- Joined: Thu Sep 13, 2007 10:50 am
Re: using extra page attributes
Hi,
I used this UDT with the CGSimpleSmarty module installed.
Bob
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');