Page 1 of 1
[solved] Re-using contents on the same website (avoiding redundancy)
Posted: Mon Sep 22, 2008 1:27 pm
by ottom
Hello,
I would like to reuse some contents of some content pages on the same website (global content blocks are not quite appropriate for that). How do I do this? Is it possible to use the content-function with special parameters?
However, this does not work:
{content page='28'}
Re: Re-using contents on the same website (avoiding redundancy)
Posted: Mon Sep 22, 2008 1:39 pm
by alby
ottom wrote:
I would like to reuse some contents of some content pages on the same website (global content blocks are not quite appropriate for that). How do I do this? Is it possible to use the content-function with special parameters?
However, this does not work:
{content page='28'}
View PageLinks contenttype (for alias page) or CGSimpleSmarty module
Alby
Re: Re-using contents on the same website (avoiding redundancy)
Posted: Mon Sep 22, 2008 2:22 pm
by ottom
Hi Alby,
Do you mean with PageLinks just placing an external link to an existing page? I want to use different templates for the same content, thus this would not work.
I have installed CGSimpleSmarty. For the first experiment I have just pasted on a content page
{$cgsimple->get_page_content(home)}. The alias of the start page is "home" indeed. However, I get an error:
string(160) "Smarty error: [in preview:cmspreviewK63fQx line 100]: syntax error: unrecognized tag: $cgsimple->get_page_content(home) (Smarty_Compiler.class.php, line 446)" string(125) "Smarty error: [in preview:cmspreviewK63fQx line 100]: syntax error: unrecognized tag '' (Smarty_Compiler.class.php, line 590)"
Du you have an experience with that? I am using CMSMS v1.4 by the way.
Re: Re-using contents on the same website (avoiding redundancy)
Posted: Mon Sep 22, 2008 2:47 pm
by alby
ottom wrote:
Do you mean with PageLinks just placing an external link to an existing page? I want to use different templates for the same content, thus this would not work.
No, external and internal link but you cannot use an other template
ottom wrote:
I have installed CGSimpleSmarty. For the first experiment I have just pasted on a content page {$cgsimple->get_page_content(home)}. The alias of the start page is "home" indeed. However, I get an error:
Maybe
{$cgsimple->get_page_content('home')} is betterĀ
Alby
Re: Re-using contents on the same website (avoiding redundancy)
Posted: Mon Sep 22, 2008 7:18 pm
by ottom
Unfortunatelly this does not work either for '...':
string(162) "Smarty error: [in preview:cmspreviewrsTjN5 line 100]: syntax error: unrecognized tag: $cgsimple->get_page_content('home') (Smarty_Compiler.class.php, line 446)" string(125) "Smarty error: [in preview:cmspreviewrsTjN5 line 100]: syntax error: unrecognized tag '' (Smarty_Compiler.class.php, line 590)"
The same is true for "...":
string(162) "Smarty error: [in preview:cmspreviewA0Ncj3 line 100]: syntax error: unrecognized tag: $cgsimple->get_page_content("home") (Smarty_Compiler.class.php, line 446)" string(125) "Smarty error: [in preview:cmspreviewA0Ncj3 line 100]: syntax error: unrecognized tag '' (Smarty_Compiler.class.php, line 590)"

Re: Re-using contents on the same website (avoiding redundancy)
Posted: Mon Sep 22, 2008 8:57 pm
by alby
ottom wrote:
string(162) "Smarty error: [in preview:cmspreviewrsTjN5 line 100]: syntax error: unrecognized tag: $cgsimple->get_page_content('home') (Smarty_Compiler.class.php, line 446)" string(125) "Smarty error: [in preview:cmspreviewrsTjN5 line 100]: syntax error: unrecognized tag '' (Smarty_Compiler.class.php, line 590)"
But you display in preview or in site?
Alby
Re: Re-using contents on the same website (avoiding redundancy)
Posted: Wed Sep 24, 2008 7:58 am
by ottom
preview or live: both.
The difference is just the place where the error is displayed. In preview mode the message appears on top of the page outside the layout. When published, it appears instead of the contents inside the layout.
Re: Re-using contents on the same website (avoiding redundancy)
Posted: Wed Sep 24, 2008 10:25 am
by nhaack
Hey Ottom,
probably the content dump plug-in could help you:
http://dev.cmsmadesimple.org/projects/contentdump/ Part of its intention is to re-use content in different places.
Best
Nils
Re: Re-using contents on the same website (avoiding redundancy)
Posted: Sun Oct 05, 2008 4:13 pm
by ottom
$cgsimple->get_page_content('home') and $cgsimple->get_page_content(home) actually does work but not within content of a page. I could create a simple plug-in which uses this code to get content from another page and use {myplugin page=home} in the content.