1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Styles for a Parent - Child relationship

Discussion in 'XenForo Development Discussions' started by SchmitzIT, Nov 27, 2011.

  1. SchmitzIT

    SchmitzIT Well-Known Member

    For my add-on, I have unsuccesfully been trying to figure out the following. I'm probably making things a lot more complicated than I should, so I figured I'd ask and see if someone has a clever little trick.

    I have a parent/child relationship in my database tables. Categories being the parent, and links being the children.

    I composed a query that retrieves a list of Categories with the underlying links, by means of a simple JOIN.Now I want the front-end code to essentially loop through the categories, assign them one particular style, then add the different links below the category, and when done, move to the next category. I also would not mind somehow seeing something clever being done to position the categories in a way that has them spread out evenly across three or so columns.

    And ideas would be highly appreciated :)

    Thanks.
     

Share This Page