Forum

Thread tagged as: Question, Configuration, Forms

Updating Perch Forms through Perch CMS Console

Is there a way to configure a Perch Form so my customer can update the select menu options for the Perch CMS console?

Ryan McGuire

Ryan McGuire 0 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Yes, you can use a <perch:content /> tag within the options attribute in your template.

Can you give me a quick example on how I use this in a form template.

Here is an example of one of my selects:

<perch:input type="select" id="date" label=" Date" required="true" placeholder="Preferred Tour Date..." options="Tues 1/5/16, Tues 1/12/16, Tues 1/19/16, Tues 1/26/16, Tues 2/2/16, Tues 2/9/16, Tues 2/16/16, Tues 2/23/16, Tues 3/1/16, Tues 3/8/16, Tues 3/15/16, Tues 3/22/16, Tues 3/29/16 " />

How would I update this with the <perch:content /> tag?

Also, is there a way to have the first item appear in the select input versus using the limited supported placeholder option?

Drew McLellan

Drew McLellan 2638 points
Perch Support

It would be something like

<perch:input type="select" id="date" label=" Date" required="true" placeholder="Preferred Tour Date..." options="<perch:content id="options" />" />

This doesn't seem to work. How would I use two sets of "" in a single tag and not cause an error?

(e.g., options="<perch:content id="availability"")

Also, where would this editable region appear in the console?

Drew McLellan

Drew McLellan 2638 points
Perch Support

They're parsed at different times, so the nesting isn't an issue.

If it appears in the control panel or not depends entirely on context. Can you tell me how this is being used?

You can see the form here: https://xraise.classe.cornell.edu/get-involved.html. My goal is to be able to give my client the ability to change the availability times from the Perch CMS console versus updating the HTML template.

Drew McLellan

Drew McLellan 2638 points
Perch Support

How are you displaying the form? Is it in a perch_content() region?

I using the following: <?php perch_form('form.html'); ?>

Can I use a perch_content region to display a form?

Rachel Andrew

Rachel Andrew 394 points
Perch Support

Yes, as described in the documentation here https://docs.grabaperch.com/docs/form/page-functions/

This is a amazing! I've been doing it the hard way for so long ;) It was never clear to me in the documentation to use the perch_content for forms. I've updated my template and now I'm able to edit the select options with the CMS console. Thank you!