• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: [SOLVED] CGSimpleSmarty help with nested pages (replacement
PostPosted: Mon Jul 07, 2008 12:05 am 
Offline
Forum Members
Forum Members

Joined: Fri Oct 26, 2007 2:56 am
Posts: 25
Hi

The Page Blocks module has been discontinued in favour of using actual pages and page templates and CGSimpleSmarty module to emulate Page Blocks. (see: index.php/topic,22988.0.html)

It's great, it means that page blocks and the page structure are all kept together with the benefit of a clean and clear page structure and the ability to move page Block positions.

I have successfully replaced Page Blocks on all my pages except one where there is a need for nested page blocks. It all works except for the third level page (the Page Block nested within a Page Block) where only the actual {content} content shows up but {content block="Publication logo"} does not.

Here are snippets of the code used in the 3 templates that list Page Blocks of publications categories and then Page Blocks of the publications within these categories:

TOP LEVEL (main Publications page):

Code:
{content}

{foreach from=$cgsimple->get_children('','',$children) item='child'}
{$cgsimple->get_page_content($child.alias)}   
  {foreach from=$cgsimple->get_children($child.alias,'',$subchildren) item='subchild'}               
  {$cgsimple->get_page_content($subchild.alias,'Publication logo')}
   {$cgsimple->get_page_content($subchild.alias)}
  {/foreach}      
{/foreach}

SECOND LEVEL (repeating 'Publications Categories'):

{content}

THIRD LEVEL (repeating 'Publications' for each 'Publications Category'):

{content block="Publication logo"}
{content}


Can anyone see where I'm going wrong? Is it possible to nest "Page Blocks" using this method?

Any help appreciated.

Thanks.


Last edited by spod_dmd on Mon Jul 07, 2008 1:03 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: [SOLVED] CGSimpleSmarty help with nested pages (replacem
PostPosted: Mon Jul 07, 2008 12:52 am 
Offline
Forum Members
Forum Members

Joined: Fri Oct 26, 2007 2:56 am
Posts: 25
Hi All

Solved it myself.

Rather than use the actual content block name 'Publication logo' from {content block="Publication logo"} I used the way it appears in the 'prop_name' column of the 'cms_content_props' table of the database which was the name of the block with all spaces replaced by an under score e.g. 'Publication_logo'.

So:
{$cgsimple->get_page_content($subchild.alias,'Publication logo')}

...should read:

{$cgsimple->get_page_content($subchild.alias,'Publication_logo')}

...note the addition of the underscore, that's the only change.

So, yes, nesting Page Blocks using this method works just great if you remember this one small quirk.


Top
 Profile  
 
 Post subject: Re: [SOLVED] CGSimpleSmarty help with nested pages (replacement for Page Blocks)
PostPosted: Sun Jul 20, 2008 12:19 pm 
Offline
Forum Members
Forum Members

Joined: Tue Sep 04, 2007 12:26 pm
Posts: 77
Your a live saver!
thanks a lot was looking for this answer.
Thanks to Applejack for pointing this one out to me!

dejo


Top
 Profile  
 
 Post subject: Re: [SOLVED] CGSimpleSmarty help with nested pages (replacement for Page Blocks)
PostPosted: Tue Jul 22, 2008 12:02 pm 
Offline
Power Poster
Power Poster

Joined: Fri Mar 30, 2007 2:28 am
Posts: 472
Hi spod_dmd

Thanks very useful tip. Now I don't suppose you have tried randomising the output. What I am looking to do is say that their are 10 child arrays but at any one time you just want to show 3 but have these randomised?

_________________


Website Design & Production
http://www.applejack.co.uk


Top
 Profile  
 
 Post subject: Re: [SOLVED] CGSimpleSmarty help with nested pages (replacement for Page Blocks)
PostPosted: Wed Jul 23, 2008 12:01 am 
Offline
Forum Members
Forum Members

Joined: Fri Oct 26, 2007 2:56 am
Posts: 25
Oh now you're getting tricky!

No I haven't tried this yet but, off the top of my head, if I did I think I'd probably create a User Defined Tag to generate the random IDs and use the UDT in conjunction with the template (or something like that!).

I will try and have a go when I have some time and see what happens.


Top
 Profile  
 
 Post subject: Re: [SOLVED] CGSimpleSmarty help with nested pages (replacement for Page Blocks)
PostPosted: Wed Jul 23, 2008 9:01 am 
Offline
Power Poster
Power Poster

Joined: Fri Mar 30, 2007 2:28 am
Posts: 472
Hi spod_dmd

Would be useful to have though. I am a Perl programmer so I don't really know much PHP or Smarty so I am unsure of some of the syntax etc Hope you manage to crack it I would be very interested.

I look forward to hearing from you.

_________________


Website Design & Production
http://www.applejack.co.uk


Top
 Profile  
 
 Post subject: Re: [SOLVED] CGSimpleSmarty help with nested pages (replacement for Page Blocks)
PostPosted: Mon Aug 11, 2008 4:48 pm 
Offline
Power Poster
Power Poster
User avatar

Joined: Fri May 05, 2006 7:55 pm
Posts: 293
Location: New Haven, CT
I keep hearing this is a replacement for pageblocks, but is it really? I dropped in the code & it seems to just pull in the child pages..... which isn't at all what people are describing, so I am imagining I am doing something wrong.

_________________
If I help you, please give good karma. If I'm rude, give me bad karma. I like to know where I balance out in the end :).


Top
 Profile  
 
 Post subject: Re: [SOLVED] CGSimpleSmarty help with nested pages (replacement for Page Blocks)
PostPosted: Mon Aug 11, 2008 5:13 pm 
Offline
Power Poster
Power Poster

Joined: Fri Mar 30, 2007 2:28 am
Posts: 472
Nope that is exactly what it does i.e. pull in content from child pages from which you can choose which content blocks title etc what you want to use. This makes it very powerful as you can reuse content separated from formatting anywhere.

However I don't see this as an adequate replacement for Page Blocks for the very reason that it doesn't contain formatting as this is very much orientated to techie use not for a client.

Therefore I think unless something better comes along Page Blocks should continue. There is also an issue with integrating cgisimple content with the search engine as it doesn't find content in relation to its context.

_________________


Website Design & Production
http://www.applejack.co.uk


Top
 Profile  
 
 Post subject: Re: [SOLVED] CGSimpleSmarty help with nested pages (replacement for Page Blocks)
PostPosted: Mon Aug 11, 2008 7:53 pm 
Offline
Administrator
Administrator
User avatar

Joined: Thu Mar 09, 2006 5:32 am
Posts: 10237
Location: Arizona
I've heard that Page Blocks still work...

_________________
Extensions » Modules/Tags click the name of the module/tag or Help to the right to get the parameters it takes
Right click and view source is a great way to see what you have to work with
Check ver. CMSMS, PHP, server OS, in System Information page
Default content, read it here, http://multiintech.com/defaultcontent/
People are Wonderful Business is Great Life is Terrific
Image


Top
 Profile  
 
 Post subject: Re: [SOLVED] CGSimpleSmarty help with nested pages (replacement for Page Blocks)
PostPosted: Mon Aug 11, 2008 8:03 pm 
Offline
Power Poster
Power Poster
User avatar

Joined: Fri May 05, 2006 7:55 pm
Posts: 293
Location: New Haven, CT
They do!
They stopped working on one site of mine, and reading Elijah's comments, I thought he was not discontinuing them--i.e. getting rid of them.

_________________
If I help you, please give good karma. If I'm rude, give me bad karma. I like to know where I balance out in the end :).


Top
 Profile  
 
 Post subject: Re: [SOLVED] CGSimpleSmarty help with nested pages (replacement for Page Blocks)
PostPosted: Wed Aug 13, 2008 1:37 pm 
Offline
Forum Members
Forum Members

Joined: Wed Aug 13, 2008 8:42 am
Posts: 10
Hi,

???...Errrr.... Sorry, but my experience is PageBlocks 0.1.5 does NOT work with the CMSMS 1.4.1 using Apache 2 and PHP 5...

Here is the bug I found : http://forum.cmsmadesimple.org/index.php/topic,24694.0.html

Anyway, it seems a better solution to use "CGSimply" (not sure it's the right name...) because it seems to use the page content tree to construct blocks... (that's what I do with Typo3), instead of using a "special" type of content.

Right now I am going back to use Typo3 because i don't have the time to reinstall CMSMS and try cgsimply, but I will probably try CMSMS for the next site I have to create. Note that Typo3 is not bad, but it is way too much complicated... :-\

I also had a question : why are you using a table layout (tables, tr, td...) with dirty html attributes (align...) instead of using a div layout and a css stylesheet ? Optimizing the smarty code is important, but don't forget to optimize your HTML/CSS code too !  ;)

See you.


Top
 Profile  
 
 Post subject: Re: [SOLVED] CGSimpleSmarty help with nested pages (replacement for Page Blocks)
PostPosted: Thu Aug 14, 2008 5:54 pm 
Offline
Forum Members
Forum Members

Joined: Wed Aug 13, 2008 3:09 pm
Posts: 19
Hi, Mathieu

try if it works in English!

It seems to me it works in English, but in no other language.

I have notified Ted of the problem, since Elijah has withdrawn.

Perhaps Page Blocks is going to be discontinued. It would be a pity though. I like that module very much. But maybe they come up with something even better.

Jonathan


Top
 Profile  
 
 Post subject: Re: [SOLVED] CGSimpleSmarty help with nested pages (replacement for Page Blocks)
PostPosted: Thu Aug 14, 2008 6:58 pm 
Offline
Forum Members
Forum Members

Joined: Wed Aug 13, 2008 3:09 pm
Posts: 19
Also take a look at my final / temporary solution:

http://forum.cmsmadesimple.org/index.ph ... #msg120417


Top
 Profile  
 
 Post subject: Re: [SOLVED] CGSimpleSmarty help with nested pages (replacement for Page Blocks)
PostPosted: Sun Oct 12, 2008 9:08 am 
Offline
Forum Members
Forum Members

Joined: Tue Sep 04, 2007 12:26 pm
Posts: 77
Hi all

I hope someone can help me with this one!

Is it posible to point a specific page/template to get te content from and if its empty that it doesn't create a empty div or table?

I am using 2 different field of content and they got a different setup. But now when I create a page both content fields create a new div with this new page-block trick, one got the content I entered but the other a empty div because it uses different names for the content blocks (input fields).

Hope someone can help!

thanks
Denli


Top
 Profile  
 
 Post subject: Re: [SOLVED] CGSimpleSmarty help with nested pages (replacement for Page Blocks)
PostPosted: Tue Oct 14, 2008 8:55 am 
Offline
Administrator
Administrator
User avatar

Joined: Thu Mar 09, 2006 5:32 am
Posts: 10237
Location: Arizona
@denli

You may want to delete this and start a new thread for your problem...

_________________
Extensions » Modules/Tags click the name of the module/tag or Help to the right to get the parameters it takes
Right click and view source is a great way to see what you have to work with
Check ver. CMSMS, PHP, server OS, in System Information page
Default content, read it here, http://multiintech.com/defaultcontent/
People are Wonderful Business is Great Life is Terrific
Image


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Arvixe - A CMSMS Partner