alan Posted May 1, 2012 Posted May 1, 2012 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 ) 2
renobird Posted May 2, 2012 Posted May 2, 2012 Alan, Made that one a few times myself. Mostly when I get an itchy pinky finger and end up capitalizing something unintentionally.
alan Posted May 7, 2012 Author Posted May 7, 2012 Hehe I wish I had that excuse, mine was lack of synaptic activity.
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