Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6662591
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:24:21+00:00 2026-05-26T02:24:21+00:00

I ran into a rather complex problem and I need the tree behavior to

  • 0

I ran into a rather complex problem and I need the tree behavior to help.

I have a table called nodes, this table already has a tree and this tree is used to build a menu.

Now we want to make it possible to create multiple menus so I made the node_menus and menus tables. So Nodes hasAndBelongsToMany Menus

However there is a slight problem, the menus are built but uses $this->Node->find('threaded') so sub menus are possible. All nodes can be used in several menus and all menus need a tree so the nodes can be ordered and sub menus can be created as well.

For that I was thinking about creating one table containing trees for each menu and link a node to each row in the tree table.

So basically I need a trees table with a Trees belongsTo Nodes relation. In this tree i have the fields menu_id, node_id, parent_id, lft and rght.

Now the question is, are multiple trees possible in one table? Say, I want the tree where menu_id is 15. Would it be possible to use find('threaded') with said ID that would return all the data and the Nodes related to the node_id‘s. Including all of the other core functions to create and manipulate the tree.

Is this possible? If not, does anyone have a better solution on how to make multiple menus where nodes can be places in multiple menus that can be ordered and threaded?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T02:24:21+00:00Added an answer on May 26, 2026 at 2:24 am

    Think like the following, then you can do it with a single tree.

    root[hidden node]
    ---- Menu 1
    -------- Item 1.1
    -------- Item 1.2
    -------- Item 1.3
    ---- Menu 2
    -------- Sub Menu 2.1
    ------------ Item 2.1.1
    -------- Item 2.1
    ---- Menu 3
    ---- Menu 4
    ---- Menu 5
    

    I’ve made a menu builder plugins for CakePHP, you can use it if you like 🙂
    https://github.com/torifat/cake-menu_builder

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I ran into a rather tricky problem at one of my clients. They have
I need to make a rather complex query, and I need help bad. Below
I recently ran into a quite complex problem and after looking around a lot
I ran into a rather odd behavior that I don't even know how to
This is the problem I ran into long time ago. I thought I may
I was thinking about this when I ran into a problem using std::ofstream. My
I ran into this problem in a Visual Basic program that uses WMI but
I just ran into a problem when I need to do a goto into
I recently ran into this problem: Rails 3 link_to (:method => :delete) not working
I've just began learning Python and I've ran into a small problem. I need

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.