ridgedale Posted November 11, 2017 Posted November 11, 2017 Reference: PW 3.0.62 and uikit3 based site using the Regular-Master profile. I've setup a hidden page and template (sitePreferences - with no associated template file) containing site-wide preferences/settings, however I can't get the field content to display. I've tried the following which either display nothing or break the site: <?php echo $item->siteChairperson; ?> <-- nothing gets displayed <?php echo $field->siteChairperson; ?> <-- nothing gets displayed <?php =page()->siteChairperson ?> <-- breaks site <?php echo $field = $fields->get('siteChairperson'); ?> <-- displays the text siteChairperson instead of the name. <?php =sitePreferences()->siteChairperson?> <-- breaks site <?php echo $field->get($siteChairperson); ?> <-- breaks site Any assistance would be greatly appreciated.
ridgedale Posted November 11, 2017 Author Posted November 11, 2017 Further extensive research revealed the solution to be to use the following code referring to the Page path and field reference rather than the field reference: <?php echo $pages->get("/site-prefs")->siteChairperson; ?>
Macrura Posted November 11, 2017 Posted November 11, 2017 or $sitePrefs = $pages->get("template=sitePreferences"); echo $sitePrefs->siteChairperson; //etc..
Klenkes Posted November 11, 2017 Posted November 11, 2017 or echo $pages->get(1234)->siteChairperson;// where 1234 is the id of the settings page
ridgedale Posted November 13, 2017 Author Posted November 13, 2017 Hi Macrura and Klenkes, Thanks for your feedback. Much appreciated.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now