Getting a page's content block

General project discussion. NOT for help questions.
Post Reply
forbairt
Forum Members
Forum Members
Posts: 19
Joined: Tue Feb 12, 2008 8:40 am

Getting a page's content block

Post by forbairt »

Short time reader / fan (started last week and have templated 4 sites so far and I'm LOVING it)

My problem is I'd like to be able to grab a content block from a page (not the current page)

I'm having difficulty finding out if its possible to do this ?

I was hoping that {content} would have some form like {content page="about"} but I'm assuming it doesn't as there is no documentation on it ? (or I can't find it at any rate)

Any help would be appreciated. Before you ask I could go and write a module to do this ... but I was hoping it would already exist ...

If not and there is any interest I may make a module to do this ?

Thanks for any help,
James
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Getting a page's content block

Post by calguy1000 »

get the cgsimplesmarty module it has a function to do just that.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
forbairt
Forum Members
Forum Members
Posts: 19
Joined: Tue Feb 12, 2008 8:40 am

Re: Getting a page's content block

Post by forbairt »

cheers calguy1000 get_page_content($alias,[$block],[$assign]) looks to be exactly what I'm after
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Getting a page's content block

Post by calguy1000 »

you may have to 'eval' the results with the smarty {eval} tag to get the content rendered properly
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
lucid
Forum Members
Forum Members
Posts: 29
Joined: Mon Nov 12, 2007 2:48 pm

Re: Getting a page's content block

Post by lucid »

So just a tip I thought that I would put here.

- You can us $cgsimple in another page content. ( I think that's right, if someone knows a way you can that would be great).
- So I created a UDT to extract and display the content block

hope this helps
Post Reply

Return to “General Discussion”