Page name conditional
Permalink
I have been looking around the forums and various help files and sites, adding to my knowledge like the rest of you guys.
I am trying to write a simple PHP conditional that checks if named block has been edited. If it has then display the edit, if not, then display the page name by default and allow it to be editable.
$test = $c->getCollectionName();
$a = new Area('mainPageTitle');
$a->setBlockLimit(1);
if($a->'mainPageTitle'==""){
setAttribute('mainPageTitle',$test);
}else{
$a->display($c);
}
That is kind of the logic I want to put in, I just can't figure out the function and method combinations ...
WJ
I am trying to write a simple PHP conditional that checks if named block has been edited. If it has then display the edit, if not, then display the page name by default and allow it to be editable.
$test = $c->getCollectionName();
$a = new Area('mainPageTitle');
$a->setBlockLimit(1);
if($a->'mainPageTitle'==""){
setAttribute('mainPageTitle',$test);
}else{
$a->display($c);
}
That is kind of the logic I want to put in, I just can't figure out the function and method combinations ...
WJ
oh so im guessing your going to use versions code, you could get it by the area id
That's a good idea, it is a page title tag and by default there is nothing in there on page creation.
So upon page creation I want to check that value in the DB and if nothing has been edited and inserted for that page (in that block) then by default put the page name in (and keep it editable for later).
I suppose I should just enter the page name in to the block field in the DB so its there upon creation and editable later.
I don't want to mess with core files though, this behavior may change in another theme, so I guess I want the code on the full.php page description.
Does that make sense?
WJ
So upon page creation I want to check that value in the DB and if nothing has been edited and inserted for that page (in that block) then by default put the page name in (and keep it editable for later).
I suppose I should just enter the page name in to the block field in the DB so its there upon creation and editable later.
I don't want to mess with core files though, this behavior may change in another theme, so I guess I want the code on the full.php page description.
Does that make sense?
WJ
well you could make a custom template for the content block, that might be easier as all you have to do to find the right id is to use the sameone. and then use versions code