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

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
memerson
Forum Members
Forum Members
Posts: 14
Joined: Mon Mar 23, 2009 5:03 pm

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

Post 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
Last edited by memerson on Fri Mar 27, 2009 12:43 pm, edited 1 time in total.
alby

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

Post 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
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm
Location: Raalte, the Netherlands

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

Post by RonnyK »

To get the data from another page in another page, you can use the "Internal Pagel Link" content-type.

Ronny
memerson
Forum Members
Forum Members
Posts: 14
Joined: Mon Mar 23, 2009 5:03 pm

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

Post 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.
memerson
Forum Members
Forum Members
Posts: 14
Joined: Mon Mar 23, 2009 5:03 pm

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

Post by memerson »

mark wrote: Then please put [solved] in the subject line of first post...
done, sorry  :-\
Post Reply

Return to “Developers Discussion”