Page 1 of 1
[Solved] Same content on multiple pages
Posted: Mon Jul 11, 2011 10:44 am
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
Re: Same content on multiple pages
Posted: Mon Jul 11, 2011 10:46 am
by Jos
Change the content type when creating a new page
Re: Same content on multiple pages
Posted: Mon Jul 11, 2011 11:11 am
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.
Re: Same content on multiple pages
Posted: Mon Jul 11, 2011 12:18 pm
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.
Re: Same content on multiple pages
Posted: Mon Jul 11, 2011 6:44 pm
by DIGI3
Yes, quite easy using CGSimpleSmarty:
get_page_content($alias[,$block][,$assign])
Re: Same content on multiple pages
Posted: Tue Jul 12, 2011 7:26 am
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.
Re: Same content on multiple pages
Posted: Tue Jul 12, 2011 8:32 am
by Jos
Code: Select all
{$cgsimple->get_page_content('om-oss')}
Re: Same content on multiple pages
Posted: Tue Jul 12, 2011 9:26 am
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?
Re: Same content on multiple pages
Posted: Tue Jul 12, 2011 10:19 am
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}
Re: Same content on multiple pages
Posted: Wed Jul 13, 2011 6:33 am
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
