Forum
perch_content_custom in Page not showing as new region in backend
I have added a content to the page, but it is not showing in backend as new region. In the content, I have added perch member has tag to rectrict viewing for members with insufficient credential or tag.
Page
<?php perch_content_custom('profile_private'); ?>
Content
<perch:member has-tag="officer">
<div class="col-sm-8 col-md-8 col-lg-8 bor-wrap bc-gray nopad br-3 pull-right mr-top-20">
<h4 class="fs-26 fc-dgray bor-bot"><perch:content id="PriInfoTitle" type="text" label="Private Profile info" required="true" title="false" /></h4>
<perch:repeater id="Priprofileinfo" label="Labels">
<p class="bg-white cs-one"><strong><perch:content id="PrivateInfoLabels" type="select" label="Private Profile label"
options="Home number, Mobile Number,#1 Contact name, #1 contact number,Home address,Bank account number" allowempty="false" required="false" />:</strong> <span style="padding-left:10px"><perch:content id="profileInfotext" type="text" label="Label content" required="true" title="false" /></span></p>
</perch:repeater>
<div class="col-lg-12 profile-about-me">
<perch:content id="PriMoreInfo" type="textarea" label="Other information" markdown="true" editor="markitup" imagewidth="640" imageheight="480" />
</div>
</div>
</div></perch:member>
Have you tried
<?php perch_content('profile_private'); ?>
reload the page then check backend?You'd not usually use
perch_content_custom
unless you're setting special options.perch_content_custom does not define new regions https://docs.grabaperch.com/functions/content/perch-content-custom/
@Simon When i define <?php perch_content('profile_private'); ?> the region is visible to perch:member has-tag="officer", also added into the backend to edit the region.
If you can guide me on how to protect a region to be hidden if a member is logged in with the pre-defined tag to view the spesific content would be really helpful.
If you want to create the region programmatically then you can use perch_content_create - this is detailed on the documentation link I posted earlier in the thread, but just using perch_content_custom is not going to create your region. You need to create it in some way first - as that page explains.
That is working fine. But the content wrapped is not showing even though the member logged in has the tag.
Sorted. But the is a </perch:member> showing in the source code.
You will need to show us more of your template/page code and your Diagnostics Report for us to do more than make guesses.
Template code
Diagnostics
Looks ok - which function are you using to display this template?
This is the part of the page to display it.
Can you use
perch_content_custom()
instead ofperch_content()
here?perch_content()
is cached at edit time, whereasperch_content_custom()
is rendered live.@Drew Excellent. That worked, Thanks.