Page 1 of 1

Using Load() to pull in the content of another page [solved]

Posted: Tue Mar 24, 2009 2:06 pm
by memerson
I am researching the API commands for CMSMS and found a method called Load() which, as far as I can tell, allows the user to load in content taking the id of the page. I'm hoping to use this method to pull in content from sub-pages within a main page.

Example:

The page "Recent Work" is in my navigation menu, and this page has two sub pages - let's call them Work Page 1 and Work Page 2. Currently the Recent Work page is blank but I want to incorporate smarty tags to pull in the titles and maybe a small thumbnail from both pages Work Page 1 and Work Page 2.

I tried implementing $content_obj->Load(id) } (where "id" is the content_id of the sub page) but this does not work as I think I'm calling it from the wrong object. If anyone knows more details about this or maybe a better method to use, please let me know! This would help me immensely.

Regards
Michael

Re: Using Load() to pull in the content of another page

Posted: Tue Mar 24, 2009 8:36 pm
by alby
memerson wrote: The page "Recent Work" is in my navigation menu, and this page has two sub pages - let's call them Work Page 1 and Work Page 2. Currently the Recent Work page is blank but I want to incorporate smarty tags to pull in the titles and maybe a small thumbnail from both pages Work Page 1 and Work Page 2.
to pull in the titles and maybe a small thumbnail from both pages
Because you not set image/thumbnail in these page and use Menumanager for diplay them

Alby

Re: Using Load() to pull in the content of another page

Posted: Tue Mar 24, 2009 8:46 pm
by RonnyK
To get the data from another page in another page, you can use the "Internal Pagel Link" content-type.

Ronny

Re: Using Load() to pull in the content of another page

Posted: Wed Mar 25, 2009 10:23 am
by memerson
Thanks for your responses, but I just discovered a module called CGSimpleSmarty which allows me to pull in child content from a root menu item:

Code: Select all

<h3><a href="/{$child.alias}/">{$cgsimple->get_page_title($child.alias)}</a></h3>
<img src="uploads/images/{$cgsimple->get_page_content($child.alias, 'image')}" />
..within the linked template.

Re: Using Load() to pull in the content of another page

Posted: Fri Mar 27, 2009 12:43 pm
by memerson
mark wrote: Then please put [solved] in the subject line of first post...
done, sorry  :-\