Multiple pages parameters to one page

Hi there,

I'm building a social media app and I want to use one page as a galery page for photo's.
I have a user profile page and a group page. Posts can be placed in both. A post can contain an image. The posts collection has a PostedBy_Ref and a Group_Ref.

On the galery page I have a grid view widget with an image widget in it. I place a backend query to my posts collection on the grid view.

I have a button towards the galery on both the profile page and the group page. If the user is on a profile page and he/she clicks the button, the user reference is being passed as a parameter and if the user is on the group page and clicks the button, the group reference is passed as a parameter.

Now I'm looking for a way to show the proper results. I can't seem to figure this out...

If I want to use the filter system on the backend query of the grid view, then I have to choose between either the group_Ref or the user_Ref parameter (choosing both creates an AND filter).

Simply put, how can I make sure the galery shows the group photo's when coming from a group page and shows the user photo's when coming from a profile page?

I want to avoid creating 2 seperate pages in order to reduce the file size of the final app.

Kind Regards

1
5 replies