Jump to content

Filename on Image only on Userlist


Christian
 Share

Recommended Posts

Try <img src="<?php echo $page->MyImageField->url; ?>" />.

@JanRomero: It's really nice that you help, - but your example isn't correct, at least for fields with multiple images, what is the default. Your example only works if the image field is set to accept only _one_ image, and not _multiple_. With multiple imagesfield, you need to specify the image you want to use, e.g.:

$page->images->first()->url
$page->images->last()->url
$page->images->eq(0)->url  // is the first image
$page->images->eq(1)->url  // is the second image

etc.

have a look at:

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

Hi Arian, I'm not trying to put any custom template with this. I just defined picture field on my user and add some field on my table and it only display image name on /access/users/. Do I need to define or override a processwire template to do this?

Link to comment
Share on other sites

Oh I think I understand - do you want the user's image to show up when viewing the User list through the admin panel - Access > Users ?

EDIT: If you're running the dev version of PW, that is really easy to do now that the Users page uses Lister - just choose the image field from the columns tab. Like this:

post-985-0-22420400-1404575186_thumb.jpg

Is this what you are looking to do?

Link to comment
Share on other sites

I'll post the same answer I posted in response to your Lister thread issue, just in case someone else is confused.

"Ah - I guess you must have upgraded a 2.4 stable installation to dev - that is why Lister wasn't installed by default !"

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