[Solved] Same content on multiple pages

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
volcanoboy

[Solved] Same content on multiple pages

Post by volcanoboy »

Hi,

is there a way (or a tag) that can make me display the {content} from a specific page on another? Without using Global Content Blocks. So i can just specify the alias of a certain page and display that on another page.


Cheers
Last edited by volcanoboy on Wed Jul 13, 2011 6:33 am, edited 1 time in total.
Jos
Support Guru
Support Guru
Posts: 4020
Joined: Wed Sep 05, 2007 8:03 pm

Re: Same content on multiple pages

Post by Jos »

Change the content type when creating a new page
volcanoboy

Re: Same content on multiple pages

Post by volcanoboy »

hmm...Not enterily sure what you mean. What should I change the Content Type to?

Basicly I have a very stripped down version of the website without all the styling an images and would just like it to pull what's in the {content} block on another page on this one.
Jos
Support Guru
Support Guru
Posts: 4020
Joined: Wed Sep 05, 2007 8:03 pm

Re: Same content on multiple pages

Post by Jos »

I was thinking of content type "Internal Page Link", but that might not be what you were looking for.

I think the CGSimpleSmarty module will suit your needs.
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1803
Joined: Wed Feb 25, 2009 4:25 am

Re: Same content on multiple pages

Post by DIGI3 »

Yes, quite easy using CGSimpleSmarty:
get_page_content($alias[,$block][,$assign])
volcanoboy

Re: Same content on multiple pages

Post by volcanoboy »

hey,

I'm really trying to get my head around this. I've used the module on other parts of the page and they are working as intended. But this one I just can't get to work. I've tried all these:

Code: Select all

</br>{$cgsimple->get_page_content($om-oss)}
</br>{$cgsimple->get_page_content('om-oss','content')}
</br>{$cgsimple->get_page_content($om-oss,$block,$assign)}
</br>{$cgsimple->get_page_content('$om-oss','content')}
</br>{$cgsimple->get_page_content('$om-oss','$block')}
</br>{$cgsimple->get_page_content($om-oss,$content)}
I guess there is something missing in my tag? I'm not getting errors but I'm not getting any content either.

What I'm trying to do is to have the content of a page with alias "om-oss" showing in the content block of a page with page alias "hovedside". Hope you can help me out with this one.
Jos
Support Guru
Support Guru
Posts: 4020
Joined: Wed Sep 05, 2007 8:03 pm

Re: Same content on multiple pages

Post by Jos »

Code: Select all

{$cgsimple->get_page_content('om-oss')}
volcanoboy

Re: Same content on multiple pages

Post by volcanoboy »

thanks that works when I put it in my template. Is it possible to put these in content boxes? I get errors when I do.

Also another problem is that if I put this in my template and my om-oss page have global content blocks it just prints out the name of that content block instead of the content.

Any way to avoid that?
Jos
Support Guru
Support Guru
Posts: 4020
Joined: Wed Sep 05, 2007 8:03 pm

Re: Same content on multiple pages

Post by Jos »

There is an example in the help page that comes with CGSimpleSmarty, to use the eval function

You can copy/paste this in your page template and see what it does:

Code: Select all

{content block='extracontentalias' label='page alias for extra content' oneline='true' assign='extracontentalias'}
{if !empty($extracontentalias)}
{$cgsimple->get_page_content($extracontentalias,'','extracontent')}
{eval var=$extracontent}
{/if}
volcanoboy

Re: Same content on multiple pages

Post by volcanoboy »

thanks. That works great :-)
I'm abit blank when it comes to these things.

But it's not possible to use cgsimple in normal content blocks is it? It has to be in the actual template?

Thanks again :-)
Locked

Return to “CMSMS Core”