Jump to content

Headlines not working...


onjegolders
 Share

Recommended Posts

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:

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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