Jump to content

Recommended Posts

Posted

In case the mistake I just made helps anyone else...

I wanted to display a file on a page with a default install of PW. So I added a field of type 'file' and rather unimaginatively called it "Files".

Via the admin I then edited a page and added a file and description to a page and added:

foreach($page->files as $file) {
echo "<p>Test output: {$file->description}</p>";
}

to the template.

The result was nothing new displayed :/ Confused I tried lots of things, then wondered if by using the name "Files" for my field I had stumbled on a reserved word that didn't work.

Of course everyone will have seen my error, the field I added was "Files" and the field I am querying is "files".

Lesson well and truly learned (I hope ;))

  • Like 2
Posted

Alan,

Made that one a few times myself. Mostly when I get an itchy pinky finger and end up capitalizing something unintentionally.

:)

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