Page 1 of 1

[SOLVED]How to have changing GCB on each page

Posted: Fri Jan 02, 2009 6:39 pm
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?

Re: How to have changing GCB on each page

Posted: Fri Jan 02, 2009 6:53 pm
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

Re: How to have changing GCB on each page

Posted: Fri Jan 02, 2009 10:26 pm
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

Re: How to have changing GCB on each page

Posted: Fri Jan 02, 2009 11:10 pm
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 ?

Re: How to have changing GCB on each page

Posted: Sat Jan 03, 2009 12:28 am
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

Re: How to have changing GCB on each page

Posted: Sat Jan 03, 2009 6:39 am
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