@cryptichorizon. Thanx again for the reply. Stupid me That should be NULL and indeed did the trick Leaves me with one last question about the foreach loop and included if statement:
Using it this way it is now it is not showing me a drobdown menu, instead it shows me 2 menu items (parent_id = null) followed by de dropdown items (inline) followed by the next menu items (parent_id = null). See applied screenshot:
Not sure where Iâm going wrong within the foreach loop
Again thank you for the rest. I now at least understand the principle.
Edit: I figured out what the reason is for the strange behavior. I use Bootstrap so I need to adjust the layout and classes a bit. Again thank you a lot for your input and patience. I learned a lot the last couple of days.
@cryptichorizon. I was a bit to early with cheering. I adjusted the styles for the dropdown section. So instead of a div I used the more traditional ul tag:
So instead of the main item (Categorieën) having a dropdown menu all sub items are holding a empty dropdown menu. What should I adjust? Thank you in advance.
Edit: Funny enough! I switched the content from the if/else statement arround:
and now it is working. Only mayby, if you have the time, you can explain to me why that is? Because I would like to understand the principle and the other way arround looked more logic to me
Edit: As I said, itâs works now. But when I look at the source, there is a empty dropdown menu for every main item (parrent_id = null) that doesnât have children. What do I have to change in the order / design to prevent this. Thanks
It should automatically render the menu, from parent to child levels.
Note. You should really consider changing your div from the dropdown to just be a ul, and just base the css rules on the level it is on.
Note. I assume the navigation is created by you upon site creation, and cannot be edited by client. If client can edit it, you should escape the values.
@TheRedDevil. I am more than happy with the changes you made and it didnât look messy at all
I noticed that using a div messed things up, and the reason why, the way you explain it, makes sense, so I changed the tag for the dropdown indeed to ul.
You assumed right client canât change the navigation so no problems there.
I like the the if/else statement before actual query and it makes a lot of sense, I only didnât know/was not aware that you could use the AND statement and the execute command in such a way. That offers a lot of possibilities.
The if statement makes a lot of sense. Without the help of @cryptichorizon I wouldnât have gotten this far, but with this if statement I have something like oh yes of course
In other words. This works great. I would like to thank both, you and @cryptichorizon very much. I learned a lot the last couple of days.