Hi, I searched through the documentation, and read some posts about this, but haven't been able to solve this. I just upgraded from 1.x to 2.1.1. In my old site I used in many places:
{eval var=$cgsimple->get_page_content('pagealias')}
I'm not sure what to replace that with in 2.1.1. I used the old code to pull content from one page into another.
Thank you for any assistance.
Get Page Content
Re: Get Page Content
You can use the core {page_attr} tag now
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
-
cpansewicz
- Forum Members

- Posts: 142
- Joined: Fri Jun 17, 2011 12:22 am
Re: Get Page Content
Thank you. I did see that in another post, and read the documentation, but am unsure how to implement this for importing content from one page into another. Could you provide an example?
Re: Get Page Content
Examples:
Code: Select all
++++++++++
{page_attr page='how-cmsms-works' key='title'}
++++++++++
{page_attr page='how-cmsms-works' key='_dflt_'}
++++++++++
{page_attr page='how-cmsms-works' key='_dflt_' assign='othercontent'}
{eval var=$othercontent}
++++++++++
{page_attr page='how-cmsms-works' key='someothercontentblockname'}
-
cpansewicz
- Forum Members

- Posts: 142
- Joined: Fri Jun 17, 2011 12:22 am
Re: Get Page Content
Thank you! That worked. I appreciate the working example.
-
cpansewicz
- Forum Members

- Posts: 142
- Joined: Fri Jun 17, 2011 12:22 am
Re: Get Page Content
One more question, would:
{eval var=$cgsimple->get_page_content($child.alias)}
convert to:
{eval var=$page_attr page="($child.alias)" key="_dflt_"}
Thank you. I use this a lot for generating tabbed content.
{eval var=$cgsimple->get_page_content($child.alias)}
convert to:
{eval var=$page_attr page="($child.alias)" key="_dflt_"}
Thank you. I use this a lot for generating tabbed content.
Re: Get Page Content
It's (almost) in the examples above:
Code: Select all
{page_attr page=$child.alias key='_dflt_' assign='othercontent'}
{eval var=$othercontent}
Probably this will work too:
{eval var={page_attr page=$child.alias key='_dflt_'}}
-
cpansewicz
- Forum Members

- Posts: 142
- Joined: Fri Jun 17, 2011 12:22 am
Re: Get Page Content
Ok, thank you. I have several templates that I wrote that worked with CMS 1.xx, I will have to adapt them to the new cms, but I don't know enough of smarty.
-
cpansewicz
- Forum Members

- Posts: 142
- Joined: Fri Jun 17, 2011 12:22 am
Re: Get Page Content
Thanks again, that worked! Would you be able to help with these two lines of code from CMS 1.xx:
1. {foreach from=$cgsimple->get_children($page_alias, true, $children) item='child' name='panel'}
and
2. {$cgsimple->get_page_title($child.alias)}
I converted the -> to :: in my code, but I think there is something else that I need to do to get these statements to work.
1. {foreach from=$cgsimple->get_children($page_alias, true, $children) item='child' name='panel'}
and
2. {$cgsimple->get_page_title($child.alias)}
I converted the -> to :: in my code, but I think there is something else that I need to do to get these statements to work.


