[solved] Re-using contents on the same website (avoiding redundancy)

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
ottom
Forum Members
Forum Members
Posts: 13
Joined: Sun Jul 13, 2008 1:27 pm

[solved] Re-using contents on the same website (avoiding redundancy)

Post 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'}
Last edited by ottom on Sun Oct 05, 2008 4:14 pm, edited 1 time in total.
alby

Re: Re-using contents on the same website (avoiding redundancy)

Post 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
ottom
Forum Members
Forum Members
Posts: 13
Joined: Sun Jul 13, 2008 1:27 pm

Re: Re-using contents on the same website (avoiding redundancy)

Post 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.
alby

Re: Re-using contents on the same website (avoiding redundancy)

Post 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
ottom
Forum Members
Forum Members
Posts: 13
Joined: Sun Jul 13, 2008 1:27 pm

Re: Re-using contents on the same website (avoiding redundancy)

Post 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)"
???
alby

Re: Re-using contents on the same website (avoiding redundancy)

Post 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
ottom
Forum Members
Forum Members
Posts: 13
Joined: Sun Jul 13, 2008 1:27 pm

Re: Re-using contents on the same website (avoiding redundancy)

Post 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.
nhaack

Re: Re-using contents on the same website (avoiding redundancy)

Post 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
ottom
Forum Members
Forum Members
Posts: 13
Joined: Sun Jul 13, 2008 1:27 pm

Re: Re-using contents on the same website (avoiding redundancy)

Post 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.
Post Reply

Return to “Modules/Add-Ons”