Jump to content

Recommended Posts

Posted

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.

Posted

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; ?>

 

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
×
×
  • Create New...