• 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  [ 14 posts ] 
Author Message
 Post subject: Tip: Easily display the content of all sub-pages (child pages)
PostPosted: Wed Jun 18, 2008 2:42 am 
Offline
Power Poster
Power Poster
User avatar

Joined: Mon Apr 24, 2006 1:01 am
Posts: 811
Location: Deatsville, AL
If you want to display the content of all child pages of the current page:
1. Download and install the CGSimpleSmarty module
2. Put this in your template:
Code:
<h2>Child page content (experimental)</h2>
<h2>Child page content (experimental)</h2>
{foreach from=$cgsimple->get_children('','',$children) item='child'}
    {if $child.show_in_menu}
        <h3><a href="/{$child.alias}/">{$cgsimple->get_page_title($child.alias)}</a></h3>
        {$cgsimple->get_page_content($child.alias)}
    {/if}
{/foreach}


Thank you VERY MUCH to calguy1000 for helping me with this! :) :D ;D

_________________
Note: I don't have time to take on any more projects. I'm quite busy. I may be too busy to reply to emails or messages. Thanks for your understanding. :)


Top
 Profile  
 
 Post subject: Re: Tip: Easily display the content of all sub-pages (child pages)
PostPosted: Thu Jun 19, 2008 5:32 pm 
Offline
Power Poster
Power Poster
User avatar

Joined: Sun Jan 22, 2006 3:24 am
Posts: 433
Location: Syracuse, NY
That is an extremely helpful bit of code. Thank you for sharing!

Michael

_________________
Michael


Top
 Profile  
 
 Post subject: Re: Tip: Easily display the content of all sub-pages (child pages)
PostPosted: Wed Jul 09, 2008 2:29 pm 
Offline
New Member

Joined: Wed Jul 09, 2008 2:28 pm
Posts: 9
Booya - Great bit of code there - Thanks!


Top
 Profile  
 
 Post subject: Re: Tip: Easily display the content of all sub-pages (child pages)
PostPosted: Tue Jul 15, 2008 1:41 pm 
Offline
Forum Members
Forum Members

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

Sorry but I dont see how this would replace the pageblock module?
Am I overlooking something here?

Id like it very very much if somebody could explain to me how I can make pageblocks with this and how I can convert my old pageblocks to this new type of blocks it would be great!

Dejo

[edit]

Got it going its actually pretty easy ones u take a good look  ;)

I think that it would be very useful if there was a Tutorial of this because I could understand that some would not know what to do.

Thanks Elijah very useful bit of code!


Last edited by denli on Wed Jul 16, 2008 10:44 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Tip: Easily display the content of all sub-pages (child pages)
PostPosted: Thu Jul 17, 2008 8:43 am 
Offline
Forum Members
Forum Members

Joined: Tue Sep 04, 2007 12:26 pm
Posts: 77
Hi Again!  ;D

I am almost there!

I got one question:
How do I get extra content blocks out of a child page?  :-\

I got a content block for images, and table data but I only succeed in importing the child Title and content.
I tried every ting I could think of but it just wont work!

I hope someone knows how to do this!


Top
 Profile  
 
 Post subject: Re: Tip: Easily display the content of all sub-pages (child pages)
PostPosted: Sat Jul 19, 2008 2:41 am 
Offline
Power Poster
Power Poster

Joined: Fri Mar 30, 2007 2:28 am
Posts: 472
See this http://forum.cmsmadesimple.org/index.ph ... 540.0.html

_________________


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


Top
 Profile  
 
 Post subject: Re: Tip: Easily display the content of all sub-pages (child pages)
PostPosted: Mon Aug 11, 2008 5:32 am 
Offline
Power Poster
Power Poster
User avatar

Joined: Fri May 05, 2006 7:55 pm
Posts: 293
Location: New Haven, CT
MAybe I am just tired, but can someone plz explain this to me? I tried to understand it several times :-/. It seems like it just pulls child pages?

but what if I have real child pages.... but I want page blocks....? :(? Does this really do the same function as page blocks?

_________________
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: Tip: Easily display the content of all sub-pages (child pages)
PostPosted: Mon Aug 11, 2008 4:44 pm 
Offline
Power Poster
Power Poster
User avatar

Joined: Fri May 05, 2006 7:55 pm
Posts: 293
Location: New Haven, CT
OK, so I am awake now, and still don't get it.

I need a system that lets my end-user easily add blocks of content to a page. This just seems to agregate the child pages, is that correct?

I have top-level pages that have child pages that ALSO have content blocks. (What I used to call page blocks)

Basically, it's a simple 3 column layout. Column 1==navigation. Column 2 == content. Column 3 == little blocks of content that the client adds on as needed.

With pageblocks, they just clicked, "Add a block" and did. It was super easy! Everyone loved it. I had each content block in it's own div, so that it created a little border at the bottom! Bellisimo!

But now there seems no way to do this?

Do have to downgrade my CMS install to an older one?

I already have this job & am coding it :( Didn't realize that page blocks would be removed... :(!

I miss you page blocks. *pours out a 40*

_________________
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: Tip: Easily display the content of all sub-pages (child pages)
PostPosted: Tue Aug 12, 2008 4:03 pm 
Offline
Power Poster
Power Poster
User avatar

Joined: Fri May 05, 2006 7:55 pm
Posts: 293
Location: New Haven, CT
I posted a response, or tried to!

yea, it works. sorry all.

_________________
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: Tip: Easily display the content of all sub-pages (child pages)
PostPosted: Wed Aug 13, 2008 5:21 pm 
Offline
Forum Members
Forum Members

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

Mark or Streever (or both): Could you please explain how you got the Page Blocks to work? I have the same problem with the "Add Block" link not showing up. Is there anything I can do to make it work like in the version Savaii ??

Jonathan


Top
 Profile  
 
 Post subject: Re: Tip: Easily display the content of all sub-pages (child pages)
PostPosted: Fri Sep 26, 2008 1:51 pm 
Offline
Forum Members
Forum Members

Joined: Tue Sep 04, 2007 12:26 pm
Posts: 77
jubasolo wrote:
Hi, there

Mark or Streever (or both): Could you please explain how you got the Page Blocks to work? I have the same problem with the "Add Block" link not showing up. Is there anything I can do to make it work like in the version Savaii ??

Jonathan


Jonathan,

This is not about solving the pageblock problem. The pageblocks are no longer supported so this is about a new way of making a new cind of pageblocks, better if you ask me!.

Ill try to explain please don't bite me if you already know or if my English is not zo good.

First thing I did is copy my default template and ad this:
Code:
<div style="float: right;">{print showbutton=true script=true}</div>
<div class="lijn"></div>
<table class="info-blok">
<tr >
<td class="title-blok" colspan=2 ><h1 class="front-h4">{content block="titel" oneline="true"} (u kunt deze pagina gebruiken voor printen of info aan te vragen.</h4></td></tr>
<tr >
<td class="afbeelding-blok">{content block="afbeelding"}</td>
<td class="omschrijving">{content block="omschrijving"}</td></tr>
<tr>
<td class="afbeelding-blok"></td>
<td class="data">{content block="data"}</td>
</tr>
<tr>
<td  colspan="2" class="offerte-knop">Offerte/info aanvragen over {title}:</br>{cms_module module='FormBuilder' form='pat-contact'}</td></tr>
</table>


Under {content} I use the divs and tables becouse the child that I use to take the info out of is also visible.
Wy well now I can display only the wanted product instead of a collection of children. This single product page can be used to print or ask for info.

If you dont use the child (pageblock) to show then this:
{content block="titel" oneline="true"}
{content block="afbeelding"}
{content block="omschrijving"}
{content block="data"}

Is more then you will need.(this way you use the child like pageblocks)
I call the above mentioned template Input-content or you could call it "pageblock".

Then I make a second template which is the product page in my situation this page collects al the children beneath.
I call this Template "product-page". This is actually the template u use for the pages that you want to show their children wich use the template "input-content".

Code:
{foreach from=$cgsimple->get_children('','',$children) item='child'}
    {if $child}
<div class="lijn"></div>
<table class="info-blok">
<tr >
<td class="title-blok" colspan=2 ><h1 class="front-h4">{$cgsimple->get_page_content($child.alias,'titel')}</h4></td></tr>
<tr >
<td class="afbeelding-blok">{$cgsimple->get_page_content($child.alias,'afbeelding')}</td>
<td class="omschrijving">{$cgsimple->get_page_content($child.alias,'omschrijving')}</td></tr>
<tr>
<td class="afbeelding-blok"></td>
<td class="data">{$cgsimple->get_page_content($child.alias,'data')} </td>
</tr>
</table>
</br>
    {/if}
{/foreach}


So now when you want a page block in this new setup you just ad a new page in your admin/pages
You gif this page the template "input-content" you place this page under the page you want to get the info into.
Next go to the page (parent of that child) that needs to collect this info and gif this the template "product-page" (the name in my situation).

Now it should work, you can put as many pages (pageblocks) under the page with template "product-page" as you want like you used to with the old pageblocks.

That's all I did to make it work for me! remember you need CGSimpleSmarty module
for this to work.

I like this contribution because you can ad edit the new pageblocks on the same page as where you ad edit your pages.

I hope this was helpful for you?


Top
 Profile  
 
 Post subject: Re: Tip: Easily display the content of all sub-pages (child pages)
PostPosted: Thu Nov 27, 2008 6:53 pm 
Offline
Forum Members
Forum Members

Joined: Wed Aug 13, 2008 3:09 pm
Posts: 19
Thanks for your help and your most wonderful explanation.

I somehow got the Page Blocks to work, but only in English. So I did not try your suggestions. I forgot to answer your reply, which I am sorry for. Thanks for your time.

Today I discovered a reply which explains the solution to my original problem though. So to all friends of Page Blocks, please look at this thread, and your problems with language in Page Blocks are gone:

http://forum.cmsmadesimple.org/index.php?topic=24627


Jonathan


Top
 Profile  
 
 Post subject: Re: Tip: Easily display the content of all sub-pages (child pages)
PostPosted: Thu Dec 25, 2008 10:33 pm 
Offline
New Member

Joined: Fri Mar 23, 2007 12:10 am
Posts: 2
really nice, works fine here. is it possible to display child pages depending on their template? i couldnt figure out which object i can access to retrieve information about the childs template-id or name.


Top
 Profile  
 
 Post subject: Re: Tip: Easily display the content of all sub-pages (child pages)
PostPosted: Mon Dec 07, 2009 12:10 pm 
Offline
Forum Members
Forum Members

Joined: Thu Oct 15, 2009 11:11 am
Posts: 58
Code:
<dl>
<dt>{$cgsimple->get_page_title($child.alias)}</dt>
<dd>{$cgsimple->get_page_content($child.alias, 'pullout')}</dd>
<dd><a href="/{$child.alias}/" title="{$cgsimple->get_page_title($child.alias)}">Learn more »</a></dd>
</dl>


... where 'pullout' is the name of the content block to grab text from.

Hi - I've been using this successfully, but now I want to grab an image from a child page, but can't seem to get it to work - any ideas ?

This is what I have on each page :-

Code:
{capture assign='page_image'}{content_image block='Page Image' dir='images/Gallery/gallery1' urlonly='true'}{/capture}


So I need to replace 'pullout', with the name of a content block that contains the image -'Page Image'

Code:
<dl>
<dt>{$cgsimple->get_page_title($child.alias)}</dt>
<dd>{$cgsimple->get_page_content($child.alias, 'Page Image')}</dd>
<dd><a href="/{$child.alias}/" title="{$cgsimple->get_page_title($child.alias)}">Learn more »</a></dd>
</dl>


I can't seem to return any reference to this content block at all.

Any help greatly appreciated.

All the best


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 

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