Custom member pages extended

So far I’ve managed to make a good amount of progress but I am now a little lost in how id go about database structure and display to my page. What I have so far is a user login system a user logs in and can create a area for themselves to display a few things, this page is routed to and a page id is passed in. But I now want to make this page to where different users could essentially make layouts using things like columns galleries etc, one user might want a gallery on might want 3 columns one might want both n tons more options like this aswell as allowing the user who made the page to sort these items I managed the logic for this on a single item in a table but I’m wanting full designs what contain different info so I don’t think a repeating table could do this for anything big.

I’d it possible to sort queries from all different tables at the same time?

I am not sure how much of your question I understand, but here’s something that might help.

You can set all possible sort columns in the query builder UI. And in the last column in UI, you can set a condition to apply that. That you can set the value to come from a different source.
Something like:

column1 ASC query1.sortBy == ‘column1A’
column1 DSC query1.sortBy == ‘column1D’
column2 ASC query1.sortBy == ‘column2A’
column2 DSC query1.sortBy == ‘column2D’
column3 ASC $_GET.sortBy == ‘column3A’
column3 DSC $_GET.sortBy == ‘column3D’

I hope you get the idea.
You will have to get creative to use multiple sort columns from DB.

I don’t think this would work in my case but I may be wrong, essentially what I’m trying to do is lets say I have 3 users making a project page each, each page gets a unique page id. then the users basically choose what they want on the page user 1 might want a 3 column layout user 2 might want a list and user 3 a slideshow. id need these components to be able to also be sorted if lets say user 1 and 2 wanted all activated, user 1 might want a slideshow first then list then 3 columns, user 2 might want something like a list first etc. I was looking at the database and the only way I can think of sorting it was if the sort number was on the same database table (by sort number I mean a user input that defines where it goes 1 for first 2 second etc).

It sounds like you need to set up a page structure of rows/columns with each having content applied conditionally.

Rows - require a page reference ID and an order (number) which can be used to sort them
Columns - require a row reference ID and an order so you can order the columns

When the page is loaded, you pull a list of the page’s rows, sorted by their order. For each row (in the server connect API action) use a repeat that repeats the rows and looks for columns that have the corresponding row reference id, again sorted by their column order number.

To display, you could use a repeat region on the SC data (rows) which, because of the repeat used in the SC API, would have a sub array of the columns for that row. Simply use another repeat to access/display these.

does this work like the nested repeat regions tutorial so I have a reference on how to make the repeats? https://docs.wappler.io/t/nested-repeat-regions/5165

Yes, exactly.

For the content of the columns, you are probably going to have a column in your db for the type (chart, slide, text etc.) which you will be able to differentiate using a conditional region

thank you for the help much appreciated :slight_smile:

1 Like

hey just wondering if id put repeat regions on my rows in the display part as won’t this make it repeat only one layout? or would I mash it all into one repeat row?