User-Submitted Custom Module - Edit & Delete links?

Building our first site with User Submitted Custom Modules, and I cannot figure out how to get an “edit” link. Am I missing it in the properties picker or is like BC’s ?A=Edit.

It’s in the components manager:


We only have one use case so far with customer submitted content and just inserted that form in the details page of the module.

Thanks so much for repsponding.

That does add the input, edit, and delete forms, but how do you access them for a specific item? In BC we had {{item.editUrl}} that we added to the list layout.

I need the tag for the edit url.

Thanks,
Shannon

There’s no dedicated URL for editing a custom module item if I’m not wrong. In BC that URL would call the edit layout as definded in the web app settings. In Treepl I think you can basically insert the edit form on any page, as long as you pre-populate the form fields correctly:
grafik
We put the form in the detail layout of the custom module so the default code works out of the box.
If you put the edit form on any other page, you’d probably have to pass a parameter in the url of that page with the item id of the item to be edited, and render that items content on the page into a collection so you can pre-populate the form fields correctly. But I havn’t tried this yet TBH.
@Adam.Wilson Am I right with this?

Ok, got that working! THANK YOU.

Now how would I provide a list of items with the option to view - edit - delete?
Here’s a screenshot of one of my BC websites that we need to convert.

Ok, this is how I would do it. I’d do one detail page with the item details AND the edit form. In the list view I’d link the edit icon to the detail page of the item and pass a parameter along in the url (like ?edit=true). On the detail page I would do an if statement checking for the url parameter hence render either the items details or the edit form.
The delete form I would probably try to put in a modal window. Though that means I have to render hidden containers in a for/endfor loop for each item on the list page.

2 Likes

Yep. This is how I’d approach it.

Got it. I’m also using nested modules. I’m planning to pass the parent id in the url to the insert form page.
Is there a more elegant way to pass the parent id to the child’s insert page other than through the url?

Thanks!
Shannon

If the item is nested in another module item then its ID should be included in the Liquid data.
Below is an example from the Docs which shows the ParentId under the parent object:
image

So something like this should get you the ID:
{{this.parent.ParentId}}

@shannonlynd Just a side question: How did you do this “Download to Excel” function on this page?

I implemented this example from StackOverflow. It works beautifully.

1 Like

Thanks, @shannonlynd!