[SOLVED]How to have changing GCB on each page

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Post Reply
TheLastLegion
Forum Members
Forum Members
Posts: 54
Joined: Sun Dec 21, 2008 4:01 am

[SOLVED]How to have changing GCB on each page

Post by TheLastLegion »

i've the latest version 1.5.1 and i had a question and i think i had the solution following the suggestions from this topic:
http://forum.cmsmadesimple.org/index.ph ... 184.0.html

so i needed unique GCB on each page as i didnt want to continually keep on creating new templates just to have different GCB code every time so i thought i get unique and do this:

Code: Select all

{global_content name='{$page_alias}'}
however it keeps on spitting out:

Code: Select all

string(61) "Smarty error: unable to read resource: "globalcontent:{staff"" '}
so i went back to make sure my page and GCB name were the same
and it was

Code: Select all

{global_content name='staff'}

Code: Select all

	3	Staff	normalleftblank	Content	admin

any clues?
Last edited by TheLastLegion on Sat Jan 03, 2009 6:39 am, edited 1 time in total.
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm

Re: How to have changing GCB on each page

Post by RonnyK »

IF you want different content per page, then you could better call a second content-block in the template, to get a second edit-area, while editing a page...

Ronny
nhaack

Re: How to have changing GCB on each page

Post by nhaack »

I second that. Concerning how you call the GCB, I thing it needs to be

Code: Select all


{global_content name=$page_alias}

instead of 

{global_content name='{$page_alias}'}

Or am I wrong? But as Ronny said, if you you want to add unique content to each page, what's wrong with additional content blocks?

Code: Select all


{content block="name_of_second_block"}

Best
Nils
TheLastLegion
Forum Members
Forum Members
Posts: 54
Joined: Sun Dec 21, 2008 4:01 am

Re: How to have changing GCB on each page

Post by TheLastLegion »

Well said!
thxs for clearing up what ronny was trying to say and giving me that

Code: Select all

{global_content name=$page_alias}
works!

thxs!

now i want to know, what other "variables" are there i know theres $page_alias, $title, where can i find all of the "variables" to substitute ?
nhaack

Re: How to have changing GCB on each page

Post by nhaack »

Try out this: http://wiki.cmsmadesimple.org/index.php ... plate_vars

That should give you an overview of what's available... check the other pages of the documentation wiki as well. They will provide a lot of answers to many questions you may have. Using google to search the forum is also a very effective way to find solutions. Try to search documentation and forum before posting ;)

Best
Nils
TheLastLegion
Forum Members
Forum Members
Posts: 54
Joined: Sun Dec 21, 2008 4:01 am

Re: How to have changing GCB on each page

Post by TheLastLegion »

i do very often for most of my answers

that page share_your_tags is the first time i finally see the content on it

fyi: on google chrome share_your_tags_here page is just a big blank page, and you've to scroll half-way down the little scrollbar to see content, just to let you know

thxs
Post Reply

Return to “Layout and Design (CSS & HTML)”