3445 Posts in 1031 Topics by 872 members
|Go to End|
11 December 2009 at 2:16pm
I'm calling it a fundamental error because I've probably made a fairly basic mistake but I can't see it... I want to add a 'news' type section to a site that I am building, as per the following tutorial:
I have created the mysite/code/ArticlePage.php and mysite/code/ArticlePage.php pages, then gone on to create the themes/tutorial/templates/Layout/ArticlePage.ss and themes/tutorial/templates/Layout/ArticleHolder.ss pages. Thinking I can fine-tune these pages later and remove anything that I don't want, I have done a straight cut and paste from the tutorial. I have rebuilt the database http://localhost/dev/build?flush=1 - and as far as I can see, having read and re-read the tutorial, that should be it. Sure enough, the ArticleHolder and ArticlePage page types have appeared in the CMS. I have set the parent page type as 'ArticleHolder' and set up an 'ArticlePage' as a test.
However the parent 'ArticleHolder' page is not displaying the children pages?!
Have I missed something fairly basic?
11 December 2009 at 2:25pm
OK, I've investigated further and found out that the sub-page DOES show in the list when I check the 'show in menus' box in the CMS. However I don't want these subpages to appear in the site navigation! If I had wanted them to appear in the navigation I wouldn't be setting up these pages as ArticleHolder is already a list of subpages! As I said, it's a very fundamental error! So can anybody offer a work-around here?
11 December 2009 at 7:47pm
By default all control loops will filter for 'Show In Menus' if this is unticked it will hide them - as you have found out. The way to do this is to tick the box so that they aren't in the navigation but in the template use the control <% control AllChildren %> instead of <% control Children %> in your holder page. AllChildren ignores the show in menus.
12 December 2009 at 1:31pm
To my rescue again Will! Reckon I owe you a beer or two -- thanks!!
|Go to Top|