Forum
Alter Contact Form through Perch Admin
Hi,
I have a form that is sending contacts through to the admin area. It is also sending through a hidden field called active with a number 0 as the value. Does anyone know how I can edit the from in the perch admin area so that the user can change that to 1? (Or display a checkbox - true / false only in the Perch Admin Area)?
We need to see your template.
Thanks for replying Rachel -
What I want to do is take that hidden variable - active and allow the person in perch admin to change it to 1 (probably a dropdown) to signify that it is live. The intention is then to display all submissions on site if active=1.
But I don't know where to add it to the template or another one so that the option to change is only shown in perch admin.
You'd need to do something like:
I've tried that but the "Viewing a Response" page in the perch admin lists the following;
Basically it just leaves the Live bit blank. I have the template in the templates/content folder. Is that correct?
Plus none of it is editable. How do I let the Admin user edit a form response without it appearing on the form? Or am I barking up the wrong tree here completely?
Ah I've just realised it's added the option box to the region for the template under Pages. I understand why it's done that but it's actually the response form I'm trying to allow the Administrator to alter - ie view each response and change live to yes so that I can display it on another page. Is that possible?
I know this would be easier using comments App but I've already used the comments App for something else so I need a work around using a form.
Why could you not use the Comments app with a different form template?
Hi.
Ok I'm trying to go down this route but I'm really stuck now (IE using the comments app with a different form), and I can't work out why.
sell-your-horse.php page - code is essentially;
sellyourhorse_form.html is;
sellyourhorse.html;
It's esentially the comment.html and comment_form.html pages with changes to the ID.
However it doesn't post.
The debug for the form - sellyourhorse_form.html shows;
But comparing it to a comment form that works - there appears to be an insert missing.
Can anyone help tell me where I'm going wrong?
The form ID needs to be
comment
. You shouldn't need to change the other IDs. You only need to change the template if you want to collect different fields.Again, thank you. Sorted, I understand now.
Actually Drew, I do need to collect different fields;
How do I get the comments form (that can be edited by admin) in Perch admin to display a different template for this specific input?
Is it just a case of adding some kind of IF:ELSE routine in the comment.html template based on the comment parent id?
I'm not completely sure what you're trying to do. Could you give an example?
I have a customised comments form and comment.html template - comment_form.html that obviously uses comment.html in the perch admin. I have created another form sellyourhorse_form.html that has different fields that now posts these.
When I now go to comments and view the comment posted via the sellyourhorse_form in the perch admin, the template it is using to display the info is the comment.html and not sellyourhorse.html as displayed in the code above.
I therefore assume all of the comments (irrelevant of parentID) use the same comment.html template for Perch Admin. How do I customise that template so that it accomodates the different fields from the two different forms?
Does that make sense?
I would include all the fields you need in your
comment.html
master template and then use task-specific templates for display on the site.Thanks, that's what I ended up doing, bit clunky but I think it's because I'm trying to put round pegs in square holes but had to find a solution with it being time critical. I'm going to go back and rework through it all using forms instead when time permits.
Cheers Steve