Jump to content

[Solved] $page->page_reference_field is false when referenced page is unpublished


Recommended Posts


I'm wondering if I now stumble upon an intended behavior or if this has changed between PW2.6 and later Versions (I'm on a PW3 master currently, but with ooold templates).

I have a use case where a newsletter is created (with the Help of the MailChimp Newsletter module) based on a news page/article and where the editor can preview the newsletter content.
Before the update to PW3 (says the editor) it was possible to have the origin news page unpublished (so it is not visible in the front end), but preview the newsletter showing the referenced news' page contents.
In the newsletter template there is a` if ($page->newsletter) { $n = $page->newsletter; ... } ` condition, where $n then "feeds" other content variables in that template.
`$page->newsletter` is a page reference field and in there the origin news page is selected. but this page is unpublished - and `$page->newsletter` is false for that template. (I played around with the other options for the page reference input field, as an array it would be empty in this case).
Now I'm wondering, since the news page is referenced and selected in that field (I have the option on to allow unpublished pages for the selection), why can I not access this (unpublished) page in my template? And, has this changed compared to earlier PW versions? My editor insists that this was possible before the update.
Is there a way to "get" the referenced (but unpublished) page (ID) for this template usage?




Link to comment
Share on other sites

  • Webrocker changed the title to [Solved] $page->page_reference_field is false when referenced page is unpublished

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...