Welcome, Guest. Please login or register.
Did you miss your activation email?
06 Oct 2008, 10:39

Login with username, password and session length
Home Chat Help Search Calendar Login Register
Pages: [1]
Print
Author Topic: Tip: Easily display the content of all sub-pages (child pages)  (Read 2099 times)
0 Members and 1 Guest are viewing this topic.
Elijah Lofgren
I follow Jesus Christ, enjoy reading, writing, helping people, and making websites.
Power Poster
***

Karma: 80
Offline Offline

Posts: 832

Location: Deatsville, AL



WWW
« on: 17 Jun 2008, 22:42 »

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! Smiley Cheesy Grin
Logged

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. Smiley
My CMSMS site: http://www.elijahlofgren.com/
cnymike
Power Poster
***

Karma: 1
Offline Offline

Posts: 383

Location: Syracuse, NY


Climate is what we expect, weather is what we get.


« Reply #1 on: 19 Jun 2008, 13:32 »

That is an extremely helpful bit of code. Thank you for sharing!

Michael
Logged

Michael
timmahoney
Forum Member
*

Karma: 0
Offline Offline

Posts: 1


« Reply #2 on: 09 Jul 2008, 10:29 »

Booya - Great bit of code there - Thanks!
Logged
denli
Forum Member
*

Karma: 0
Offline Offline

Posts: 19


« Reply #3 on: 15 Jul 2008, 09:41 »

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  Wink

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 Edit: 16 Jul 2008, 06:44 by denli » Logged
denli
Forum Member
*

Karma: 0
Offline Offline

Posts: 19


« Reply #4 on: 17 Jul 2008, 04:43 »

Hi Again!  Grin

I am almost there!

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

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!
Logged
applejack
Forum Member
*

Karma: 0
Offline Offline

Posts: 132


« Reply #5 on: 18 Jul 2008, 22:41 »

See this http://forum.cmsmadesimple.org/index.php/topic,23540.0.html
Logged
streever
Power Poster
***

Karma: 2
Offline Offline

Posts: 261


« Reply #6 on: 11 Aug 2008, 01:32 »

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....? Sad? Does this really do the same function as page blocks?
Logged
streever
Power Poster
***

Karma: 2
Offline Offline

Posts: 261


« Reply #7 on: 11 Aug 2008, 12:44 »

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 Sad Didn't realize that page blocks would be removed... Sad!

I miss you page blocks. *pours out a 40*
Logged
mark
Available for Consults
Support Guru
Power Poster
****

Karma: 125
Offline Offline

Posts: 5758

Location: Arizona


Keepin an eye out for you...


WWW
« Reply #8 on: 11 Aug 2008, 17:51 »

You know diff. now...
Logged

Go to Extensions Modules/Tags click the name of the module/tag or the word Help to the right to get the parameters it takes...
Not sure what ver. CMSMS, PHP, server OS, etc. try the Support Tool in your page...
CMSMS hosting available now, with installation, let me know if your interested...

WHY oh why, can anyone tell me, does it seem like no one reads all the pages that come with a default install.

OK if you removed the default content read it here... http://multiintech.com/default/
streever
Power Poster
***

Karma: 2
Offline Offline

Posts: 261


« Reply #9 on: 12 Aug 2008, 12:03 »

I posted a response, or tried to!

yea, it works. sorry all.
Logged
jubasolo
Forum Member
*

Karma: 0
Offline Offline

Posts: 16


« Reply #10 on: 13 Aug 2008, 13:21 »

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
Logged
denli
Forum Member
*

Karma: 0
Offline Offline

Posts: 19


« Reply #11 on: 26 Sep 2008, 09:51 »

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?
Logged
Pages: [1]
Print
Jump to: