Hi all,
I'd like to make a custom tag which includes content from another page than the current (loaded/requested) one.
In other words, something like {content}, but with an attribute which points to the "other" page alias or id (for example: {my_content page=%page-alias%}).
I'm new to CMSMS, I don't know which code should I use as basis (which interfaces/functions for DB access etc).
Any hint would be very appreciated. Thanks!
Bojan
include content from another page
Re: include content from another page
Depends on what you want:reljicb wrote: I'd like to make a custom tag which includes content from another page than the current (loaded/requested) one.
In other words, something like {content}, but with an attribute which points to the "other" page alias or id (for example: {my_content page=%page-alias%}).
-- A simple alias (duplicate of another page): ContentAlias
-- A page but with only the content of another: CGSimpleSmarty
Look in forge
Alby
Last edited by alby on Mon Apr 21, 2008 9:49 am, edited 1 time in total.
Re: include content from another page
Thank you Alby,alby wrote: -- A page but with only the content of another: CGSimpleSmarty
this is exactly what I was looking for:
get_page_content($alias,[$block],[$assign]) - Returns the text of a specific content block of another page.
What I actually want is to make a custom tag which I would name "page teaser" tag (you know what I mean: "This article is about... [more]"), to show few lines of text from the given page and block.
Now, my original idea is to use an existing module/tag which fetch me the page content, and to leave first few lines, and the rest to truncate... To your knowledge, does this exist (I did tried to find it online, but unsuccessfully).
Cheers!
Bojan
Last edited by reljicb on Fri Apr 25, 2008 10:29 am, edited 1 time in total.
Re: include content from another page
the news module?
Re: include content from another page
Use get_page_content and truncate modifier of smartyreljicb wrote: get_page_content($alias,[$block],[$assign]) - Returns the text of a specific content block of another page.
What I actually want is to make a custom tag which I would name "page teaser" tag (you know what I mean: "This article is about... [more]"), to show few lines of text from the given page and block.
Alby