Thanks for putting up with me !:)
It really feels like most of what I want will be here, eventually :
Going back to [url=http://doc.silverstripe.com/doku.php?id=tutorial:2-extending-a-basic-site]Tutorial 2[/url]:
A user creates a new ArticlePage, writes their article, puts in the date, but forgets to add their name.
How can I create a function from ArticlePage_Controller that sends back a boolean as to whether or not this particular ArticlePage has an author?
return this->'Author' !="" ? true : false;
Q. Is 'this->'Author' ' the correct way to get access to the data in the database as created by the user?
I realise that this is possible in the templating system with <% if $Author != ""> but what if I wanted to know whether or not a combination of things were in existence? Or at least a certain amount of the available fields were filled in?
Example: A postal address doesn't necessarily have to have all parts of the available fields to be correct. Example, some addresses have just building names, others have street numbers and names, some have suburbs and cities, others have just one or the other. So if we determine that a certain number of fields need to be entered to be correct, then we can count the number of fields and determine whether or not this entry has a postal address.
$postal = false;
$count = 0;
if (this->'Postal_Street' != "")
if (this->'Postal_Suburb' !="")
if (this->'Postal_Postcode' != "")
return $count > 2? true : false;
Then in the template, this particular child would be queried if it had a postal address, and if it did,you would set up HTML code for the address and then you could query each field individually.