GET 24/7 LIVE HELP NOW

Announcement

Announcement Module
Collapse
No announcement yet.

Selecting Items for Child Categories?

Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Selecting Items for Child Categories?

    I have a links system that has categories. Each category either has links or more categories. I need to randomly get 5 links to display in the main content area, if the category only contains more categories. The problem is I only want random links from the categories below the current category.

    If I have:
    -News
    --USA
    ---New York
    ---California
    --Canada
    -Music
    --Rock
    ---AC/DC
    ----Back In Black

    For news, I could have any link in New York, California, or Canada. USA wouldn't have any links as all those would have to either be in New York or California. Another issue is the depth isn't always known. For news, 1 and 2 levels down contain links. For music, the 3rd level contains the links. Is there a way to get random links from only the categories below? Is there a better way to set up the table?
Working...
X