This topic was discussed a few years ago in another thread but I was unable to find a resolution/solution, hence the repost.
I'd like to know if there is a way to insert one page's rendered code into another. I know I can get the content blocks from a page using CGSimpleSmarty functions, but what I need it to get the complete rendered HTML code instead.
My use-case is this: I would like editors to be able to create pages with multiple visual components in any desired sequence. Each component has different types of content and slightly different rendering. I'm trying to set this up using child pages, where each child page is a different "module/component". Code on the parent page reads all the available child pages and inserts their rendered HTML in the sequence they appear in the child page tree.
I want to make this scalable by being able to add more templates for these child page modules which means that I cannot assume all the necessary logic to render the content blocks for all possible variations can be coded into the master page template - hence the need to be able to read the rendered code for each child page.
I hope all this makes sense and someone can recommend a simple solution. I'm fine with writing a UDT to do this if that's what it takes, but would appreciate being pointed in the right direction.
PS: I don't want to use the {embed} tag for this because of the iframes that will be inserted into the final markup.
TIA
-S
Get rendered page code
Re: Get rendered page code
Ok just figured I can use a combination of {menu} and {fetch} to pull the rendered page code for child pages. Is there a better way that accesses the data locally instead of making http requests via fetch?
Thanks,
-S
Thanks,
-S
Re: Get rendered page code
I created http://dev.cmsmadesimple.org/projects/cacheremotefile for this, but I only get the plain page content
Grtz. Rolf
Grtz. Rolf
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Re: Get rendered page code
Thanks for the tip Rolf. Caching the pull makes sense and I will give your module a try.
What do you mean when you say "plain page content"? If your module is a wrapper for file_get_contents, and I use to pull from a page, does it not return full rendered markup?
Thanks,
Sanjay
What do you mean when you say "plain page content"? If your module is a wrapper for file_get_contents, and I use to pull from a page, does it not return full rendered markup?
Thanks,
Sanjay
Re: Get rendered page code
I generate content from i.e. CGBlog module at website #1
http://www.zeijen.nu/feeds/feed-svz-nieuws
And embed it with the cache_remote_file tag in website #2
http://sportvereniging.zeijen.nu/
http://www.zeijen.nu/feeds/feed-svz-nieuws
And embed it with the cache_remote_file tag in website #2
http://sportvereniging.zeijen.nu/
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Re: Get rendered page code
Ok that is great - thanks for the clarification.
Do you happen to know of anyway to do this on the same site without having to make a http request, a way to pre-render the requested page right from the database perhaps?
Sanjay
Do you happen to know of anyway to do this on the same site without having to make a http request, a way to pre-render the requested page right from the database perhaps?
Sanjay