9 years ago
5
Topic
Hi all,

I've created a custom user with an image_upload field. Now I can't find the way to reach the position of its Thumb1 and use it to obtain the image path.
My code is:

<img src="/<? echo $user->get('image_field'); ">

and it works. But if I try:

<img src="/<? echo $user->getThumb1('image_field'); "> 

or

$user->get('image_field')->thumb1

It doesn't works.

any idea?

P.S. The thumb image obviously exist.

Thx 
Abram



Get a VIP membership
693 Posts
rpoy
9 years ago
1
Level 1
Hi Abram,

Does this post help?

regards,

Randy


9 years ago
0
Level 2
Hi Randy and thanks for your answer,
unfortunately it's not exactly my case, cause I know how to use the Thumb of an Item, but I don't know to do it if the image is inside a user profile. 
4229 Posts
Kadministrator
9 years ago
1
Level 1
try doing var_dump($user->get('image_field')), this should tell you which properties exist in the field. Could be the problem is thumb1 should be e.g. thumb0
9 years ago
0
Level 2
As you suggest I wrote:

var_dump($user->get('image_field'))

This is the result

string(19) "images/118/logo.jpg"

no thumbs
4229 Posts
Kadministrator
9 years ago
0
Level 1
Hi,

is this cotnent or list/search? According to the post linked in this thread you need to call them differently depending on the template type

echo $cck->get('field_name')->thumb1; if on content
or echo $item->get('field_name')->thumb1; on list/search

Try using this exact variables (not $user ).
Get a VIP membership