Show sub-pages excerpt at parent page?
|
17 posts
|
Can’t find it anywhere at forum. I need to show excerpts from sub-pages at parent page. Basically I want to make page looks like Articles. I have: #Main_Page So I want show all Sub_pages at Main_page. Can anyone give me opinion how can I do it? Thank you! |
|
1493 posts
|
Try putting this code on Main_Page, zigmat:
Adjust the style/layout as you wish. (I put in most things thinking it would be easier to take them out than to add them in.) That will sort the pages alphabetically by title. If you simply want them in the order they were created, then change this line:
to read like this:
You can find a lot more about this in the docs on listing pages, or in the navigation guide. |
|
3 posts
|
Also, you can just remove
from the children method to use the order from the Admin page, if you want them in an arbitrary order. |
|
17 posts
|
Ok. Thank you! It’s works great. But I have one more. #Main_Page So I need show all Sub_sub_pages at Main_page without showing there Sub_pages. I think it need to be something like this | foreach ($this->find(’/Sub_page_1/,/Sub_page_2/,/etc/’)->children(array(‘order’ => ‘title ASC’)) as $child): ?> | But this doesn’t seems to work. |
|
1493 posts
|
You could use this on “Main_Page”:
If you don’t need “Main_Page” in the list, then take out everything except the There is a lot like this you can find in the navigation guide! |
|
17 posts
|
No, you give me some navigation (sitemap), I know how to do that it is simple. What I need is to fetch all Sub_sub_pages and view them on #Main_Page like content or excerpt. Your first example is what something what I need. But I need to show on #Main_Page all Sub_sub_pages content like Title, content (excerpt), tags and etc, without viewing there Sub_pages. |
|
17 posts
|
I think it can be something like this:
But this code not work but if it worked anyway it will show only childrens from one of the Sun_pages. P.S. Sorry I didn’t get how to format code with bc., and normal <code></code> doesn’t work. |
|
17 posts
|
Yotaa! Something is working :)
It’s working, but when I’m trying to sort it and adding in children() this array(‘order’ => ‘title ASC’) it’s stop working. What the problem? And how to add more than one search in find(’‘)? |
|
17 posts
|
So I will tell you what I want to do and will be glad if you will help me. In Wordpress and ModX it was simple. I have: #Portfolio: I want to take all subpages from Web and Graphic Design and show them at Portfolio. In Eiderdown and Private Villa I want to add custom field (tab) and add there thumbmail picture. It should look something like this – LINK But after all my work it looks like this – LINK I figure out how to fetch data from specific subpage and etc. But i don’t understand how to show image from tab. Any opinion? |
|
17 posts
|
Please, some one… |
|
3 posts
|
You should just be able to add a line like this:
Assuming the tab has a fully formed <img> tag. |