21278 Posts in 5728 Topics by 2599 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 980 Views |
-
Children of a Holder page won't Display.

13 April 2010 at 6:08am Last edited: 13 April 2010 6:16am
So, I have a page type which is a container for other pages, let's call them AHolder and AChild. When viewing an AHolder page I want to list the children of that page using the following:
<% control Children %>
<li>
<h2><a href="$Link" title="Read more on "{$Title}"">$Title</a></h2>
<p><strong>$Date.Nice</strong> - $Content.FirstParagraph <a href="$Link" title="Read more on "{$Title}"">Read more >></a></p>
</li>
<% end_control %>This, however is producing a blank page and no error messages. Any ideas?
Regards,
ToddEDIT: I forgot to mention. The children are on the third level of the site tree. So, I have:
Top Level Page
|- AHolder
|-- AChild
|-- AChild
|-- etc... -
Re: Children of a Holder page won't Display.

13 April 2010 at 10:11am
This, however is producing a blank page and no error messages. Any ideas?
Make sure display_errors is set to on in your php.ini file so that you can get some more useful error messages. If you cannot alter this setting simply try and isolate what line is causing the error by removing code bit by bit.
-
Re: Children of a Holder page won't Display.

13 April 2010 at 2:04pm Last edited: 13 April 2010 2:05pm
Thanks for the reply willr. I've made the changes and still no errors. I also noticed that when I do: $Children.Count I get zero for the result. I am stumped. I've also converted the code to match the "Adding News" code from the tutorial-- same result: No children displaying and count is zero.
~ Todd
-
Re: Children of a Holder page won't Display.

15 April 2010 at 9:59am
Did you have the relationship associated with Holder and Children?
eg.
In AHolder.phpClass AHolder extends Page{
static $has_many=array('AChilds'='AChild');
}Then you should be able to use the <% control Children %> loop.
-
Re: Children of a Holder page won't Display.

15 April 2010 at 12:09pm Last edited: 30 April 2010 4:16am
@SSAdmin: Yes, the relationships were in place. I eventually re-coded the models and controllers and all is now well and working. I don't know why, but I'm not complaining. Thanks for the quick replies and suggestions.
~ Todd
| 980 Views | ||
|
Page:
1
|
Go to Top |



