Thread tagged as: Question, Runway

Add field to page attributes to set special id for overriding in some templates

I have added a hidden field with default value to page attributes default template so I can check this value in page templates and perform switch if not 0.

<perch:pages id="isOverlay" type="hidden" default = '0' />

Was planning on overriding like this in certain page templates -

<?php perch_page_attributes_extend(array( 'isOverlay' => 1 )); ?>

Then check value and perform if/else...

The problem I have is that the isOverlay variable is not showing when I check the page attributes array. I get all the other page attributes returning but not isOverlay.

I have republished all pages and individually saved pages but to no avail.

Am I missing something here?


Keith Winter

Keith Winter 0 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

You don't need the hidden field. Just check if isOverlay is set.

Thanks Drew. Got it working. K