Page 1 of 1
News image path?
Posted: Sun May 22, 2016 7:13 pm
by nervino
Hello, I'm using cmsms 2.1.3 and News module 2.50.5.
In News module I've created a custom field (type:file) that I use to upload an image.
In old version of the module I used:
Code: Select all
{$entry->file_location}/{$entry->miniatura}
in the template but this doesn't work anymore.
Now I can get the file name with
but I'm unable to get the file path.
How can I do?
Thank you
Re: News image path?
Posted: Mon May 23, 2016 7:49 am
by velden
The $field variable usually only exists in sample templates that iterate the item fields (which the module developer doesn't know upfront will exist).
Try something like (didn't check for exact syntax):
{$entry->file_location}/{$entry->fields.miniatura->value}
Re: News image path?
Posted: Mon May 23, 2016 8:02 am
by nervino
Hi Velden,
{$entry->file_location} doesn't output anything.
I also tried {$entry|print_r} but there isn't the file path in $entry object.
Re: News image path?
Posted: Mon May 23, 2016 8:31 am
by velden
Just tested on new install of cmsms 2.1.3:
Code: Select all
<!-- file location: {$entry->file_location} -->
from within news detail template (summary too) just outputs url to directory of image:
Code: Select all
<!-- file location: http://temp.xxx.nl/cmsms2/uploads/news/id1 -->
Re: News image path?
Posted: Mon May 23, 2016 9:30 am
by nervino
I made a new fresh install and it works. Now I'm going to check the other installation to see what's the issue with it.
Thank you very much for your help!