Forum

Thread tagged as: Problem

regionID available when using perch_content_custom()

I can get the value of regionID in my template when I use perch_content(). But when I use perch_content_custom() to do the same, regionID is not available in the template.
(I need perch_content_custom() to filter the data.)

I have done a <perch:showall> to verify and regionID is not in the list.

Question
Is there a way to get the value of regionID and itemID into the template, when it is called with perch_content_custom() ?

Example
index.php

perch_content_create('Reiki1', array(
    'template' => 'reikicoursedays.html',
    'multiple' => true,
    'edit-mode' => 'singlepage'
));

perch_content('Reiki1'); <!-- will show the regionID -->
perch_content_custom('Reiki1', array('page'=>'/reiki.php','template'=>'reikicoursedays.html')); <!-- not showing the regionID -->

Template /templates/content/reikicoursedays.html

<!--* reikicoursedays.html file *-->
<perch:content id="regionID" type="hidden" />
<perch:content id="itemID"    type="hidden" />
<h2>
    <perch:content id="alineakop" type="text" label="Alinea Kop" required="true" title="true" />
</h2>
<perch:content id="alineatekst" type="textarea" size="m" markdown="true" label="Alinea Tekst" required="true"/>
<perch:showall>
René Banus

René Banus 0 points

  • 3 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

regionID is an internal value to Perch, it's not something you should be using in your templates.

Well,
Querying Both itemId and regionID serves me very well.

I have made an extension on your Ctrl-E function that will jump to the right region page in perch admin.

access regions from front end on github

Due to this function I have kept customers from choosing Wordpress. It’s going to be a big help in selling perch I find. So I’m very happy with being able to use these two variables.

I was going to ask you for adding this edit functionality to the main perch code.

Question Is there a way to get these two variables from a perch_content_custom() call ?

Thanks, René