Before I hire a developer I thought I would ask the forum on how this is done.
I am developing a restaurant platform, there are 3 data types
Users
Restaurants
Dish Images
One user can add multiple restaurants. In the admin panel, I am struggling to allow the user to change which restaurant they decide to edit. I have made a repeating group with an edit button as seen in the screenshots which displays a list of the restaurants associated to a user, but unsure how I change the information in the admin panel to match the selection.
I have a repeating group which needs to change to match the selection and general text elements on the page. I believe this needs to be done via custom states however unsure.
Basically, when the user presses edit it needs to change the repeating groups information alongside general elements to match the restaurants information.
As always thanks for this! It has solved my issues with the repeating group.
What would you suggest about the other elements on the page? For example, I have a text element and a yes or no element which stands for is the restaurant published or not.
They also need to change to reflect the selection of the edit button on ‘change restaurants’ . For example, when edit is pressed the text should say Welcome (Name) from Restaurant Name) and the published toggle should reflect if the restaurant is published in the database
I have attached a couple of screenshots which I hope help.
Send the data to the parent group of the element (probably best to include the RG inside this group as well), then make all references to that group’s data.
I.e. for the toggle element, just set the value to the parent groups Restaurant’s Published
Then set the Dishes RG data source to the parent group’s restaurant’s dishes.
Thanks for this, so just to confirm I need to group the elements together.
You don’t have to, but it will make things much simpler…
Then you just use a ‘display data’ workflow action when a restaurant in the restaurant RG is clicked, and send the current cell’s restaurant to the Restaurant group. Then everything inside that group can simply refer to the parent group’s Restaurant as it’s data source.
Please see what I have done below, I don’t think I am doing it right.
For the display data workflow I was setting this when the ‘edit’ button is pressed on the change restaurants pop up but I am not sure what element to set the display data too. I have grouped all the elements discussed in a group, called group collective.
You need to display the data in the parent group of the elements which will be referring to it (i.e. in your case the Group Collective).
The fact that it’s showing red means there must be a type mismatch between the data you’re trying to display and the data the group is set up to display…
So presumably the Group Collective doesn’t have ‘Restaurant’ as it’s content type - so you need to make sure you set that in the group properties editor.
I have been able to get elements to change based upon the users selection ‘edit’. However, when they press ‘published’ which is a toggle it is not populating the current restaurants publish setting. I am not sure how to get that to link.
I currently have a workflow which is when is when the toggle value is changed it makes a publish change to the last restaurant in the list - I assume this is where I am going wrong?
Okay got you, sorry trying to get my head around it. So in the thing to change section with the toggle, do I need to change ‘things to change’ the parent group’s restaurant instead?
One issue that has caused although I am sure it’s easily fixed, I have a settings pop up which needs to display the current information on that restaurant. When pressed, it should show the initial content such as the name, address so the user can change this information.
For example, If I am editing a certain restaurant and press settings it needs to show me the information of that specific restaurant so I can change that specific one.
I thought the right thing to do, is to send data to that popup…and then set the initial content as something…