Jump to content

Recommended Posts

Posted

I just tried to implement headlines for the first time in a site and using the sample code of Ryan's:

<?php echo $page->get("headline|title"); ?>

I definitely have headline field attached to the template and it's not empty, not sure why the title is getting used and not the headline?

Could anyone point in the right direction?  :rolleyes:

Posted

Hi onjegolders,

You might try printing out all the fields of your page as well as their values. You will see if your page's headline field is there or not.


foreach($page->fields as $field)      echo "<p>{$field->name}: " . $page->get($field->name) . "</p>";
 
  • Like 1
Posted

Another way to display all fields is to use the "MarkupPageArray plugin module, which is installed by default and adds a render() function to all fields that return a PageArray (as many functions in ProcessWire do)." #

echo $page->render();
  • Like 2

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...