ridgedale Posted November 11, 2017 Share 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. Link to comment Share on other sites More sharing options...
ridgedale Posted November 11, 2017 Author Share 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; ?> Link to comment Share on other sites More sharing options...
Macrura Posted November 11, 2017 Share Posted November 11, 2017 or $sitePrefs = $pages->get("template=sitePreferences"); echo $sitePrefs->siteChairperson; //etc.. Link to comment Share on other sites More sharing options...
Klenkes Posted November 11, 2017 Share Posted November 11, 2017 or echo $pages->get(1234)->siteChairperson;// where 1234 is the id of the settings page Link to comment Share on other sites More sharing options...
ridgedale Posted November 13, 2017 Author Share Posted November 13, 2017 Hi Macrura and Klenkes, Thanks for your feedback. Much appreciated. Link to comment Share on other sites More sharing options...
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