Show content based on filter from nav menu


#1

I am working on a site where I want the menu to filter a query based on text. As in the image, I would like to query on the records where “categorie==verhuur”.

.
Now I do have for example purposes the following:

<a class="nav-item nav-link" dmx-bind:href="pagelist.php?categorie=verhuur">Verhuur</a>


#2

Hello, do you want to redirect to another page when the navbar item is clicked, or?


#3

Hello Teodor,
That is one of the challenges. Depending on whereabouts. If for example one is looking the index page, they will have to be redirected to the pagelist.php page. But I intend to use pagelist.php for a total of six queries from the nav-menu
<a class="nav-item nav-link" dmx-bind:href="pagelist.php?categorie=verhuur">Verhuur</a> <a class="nav-item nav-link" dmx-bind:href="pagelist.php?categorie=verhuur">Eten en Drinken</a> <a class="nav-item nav-link" dmx-bind:href="pagelist.php?categorie=winkelen">Winkelen</a> <a class="nav-item nav-link" dmx-bind:href="pagelist.php?categorie=actief">Actief en Cultureel</a> <a class="nav-item nav-link" dmx-bind:href="pagelist.php?categorie=diverse">Diverse</a>


#4

So what’s the issue there exactly? You already have the urls set with the URL parameters in the navigation dropdown.
You just need to filter your query then, based on the URL parameter value.


#5

Idea

Define a variable and set it to empty string
image

set that variable as the filter of the connection

image

On the click event of the menu item, set the value of the variable to the required value. This will cause the server connection to be filtered on the value of the variable

image


image

I suspect more importantly for your needs, The value used for the variable could be a dynamic value from a database connection


#6

Thanks for the efford to teach me something, but I can’t make it work. So I will revert to seperate pages for each query. That will take less time.


#7

All you need is to just follow the docs. Here’s explained how to filter a query based on url parameter:


#8

Did that, but did not help much. I will just let it be for the moment.


#9

Well, there is nothing too much that can go wrong there.
Are you sure you set the URL parameter as a value for the GET parameter in app structure and are you sure your properly applied the filter to the query?


#10

Yes I am. But all deleted now, Went back to seperate pages just to keep things at speed, as I will have to deliver shortly.


#11

It really doesn’t make sense to post a topic asking for help, then delete your page when we try to help you …


unlisted #12

#13

Sorry about that, but I was trying to save you and myself time at this stage, for progression sake. I will be back on this topic, but I have to make some production.
The page itself was not deleted, but all the variable stuff etc. was.