Parent / Childrelationship in forum loop
-
At the risk of looking like a double whammy in regards to the non nesting iterations of our outputted code, just using TRs with different classes, i’ve hit across another wee issue – but this time i’m sure there’s a simple solution I just can’t see the relavent code.
I want to be able to know if a forum has children or not, or more specifically when we move up or down a level in the “xPath” iteration.
I’m using a method of using $GLOBALS->forum_parent but what this currently requires me doing is testing to see if the forum has a parent that is not a category, then checking to see if the parent is the same as the previous forums parent, and then output relavent code to nest the forum in an actual parent child format:
Category
– Forum
– Forum
– – Forum
– – Forum
– Forum
This obviously creates havok and rather messy code for the closing of the nestings.
I realise that for small websites this will look like a formatting issue, but once you reach more than 2 levels in a parent child relationship, the ability to control nested relationships makes a huge difference.
Thanks for the help folks
EDIT:
Ok, i think i’ve found half the solution to the issue, and maybe i can phrase the question better now in BBterms…
I want to know, via PHP, before any code has been sent to the browser for the forum, if it is a FIRST CHILD or a LAST CHILD.
Now obviously, BBpress knows this because it’s outputting bb-last-child bb-first-child css, but how can I access these settings on the front-page.php ?
Thanks alot for all the help
- You must be logged in to reply to this topic.