Forum
How do I check for a page attribute value?
I have a check box in the page attribute template. How can I do something on a page if that checkbox is checked (ie value = true)?
This doesn't work:
if (perch_page_attribute('deactivate', true)=='true') {
PerchSystem::redirect('/redirected-page.php');
}
Have you tried just this...
No joy with that either :(
Can you show us your attribute template?
That looks like it should work!
It doesn't :(
Does the page it redirects to have to have been created in Perch for PerchSystem::redirect to work? It does have perch regions on it but was not created by perch itself.
No, it just issues an HTTP
Location:
header.Hmph... no idea why it's not working then!