Forum

Thread tagged as: Forms, MailChimp, Shop

Including an existing form template in another

Just wondering if there's a DRY way to do what I'm wanting to achieve. I'm using the shop app to sell tickets/registration to events. I've got a shop template I'm using to list forthcoming events, but if no events are scheduled I'd like to display an existing 'sign-up to be notified when' form.

So the form I'm displaying elsewhere using <?php perch_mailchimp_form('subscribe.html'); ?> appearing in my shop template as if coded like so:

…
<perch:noresults>
             <perch:form id="subscribe" app="perch_mailchimp">
               …
              </perch:form>
</perch:noresults>
…

Hope that makes sense.

Pete Aylward

Pete Aylward 0 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Perfect: I've never spotted Template Includes before.

Thanks Drew.