News image path?

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
nervino
Power Poster
Power Poster
Posts: 448
Joined: Sun Dec 28, 2008 12:15 pm

News image path?

Post 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

Code: Select all

{$field->value}
but I'm unable to get the file path.

How can I do?

Thank you
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: News image path?

Post 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}
nervino
Power Poster
Power Poster
Posts: 448
Joined: Sun Dec 28, 2008 12:15 pm

Re: News image path?

Post 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.
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: News image path?

Post 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 -->
nervino
Power Poster
Power Poster
Posts: 448
Joined: Sun Dec 28, 2008 12:15 pm

Re: News image path?

Post 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!
Locked

Return to “CMSMS Core”