hi
that makes sense but I get this error:
Fatal error: Call to a member function on a non-object in manager/includes/document.parser.class.inc.php on line 836
on my template I have:
[[OpenBlogDiv]]
[*content*]
[[CloseBlogDiv]]
snippets:
OpenBlogDiv
<?php
if($modx->documentObject[’parent’] == 2) {
$open=’<div class="start_my_div">’;
return $open;
}
?>
CloseBlogDiv
<?php
if($modx->documentObject[’parent’] == 2) {
$close=’</div>’;
return $close;
}
?>
I am trying to add an extra div to my content section if the document being requested is a child of a given parent (2 in this case). document 2 is a container. the reason for this is that otherwise my client would need to manually add the <start_my_div> div every time they created a new document INSIDE container#2.
I had hoped I could stop this by modifying the template:
if($documentParent=2) { print the open div }
[*content*]
if($documentParent=2) { print the close div }
this is only on certain pages. perhaps there is a better way of doing it?
hope this is clear enough
thanks