Get and use uploads_path in a template

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.
Post Reply
User avatar
webform
Power Poster
Power Poster
Posts: 525
Joined: Sat Nov 25, 2006 3:39 pm

Get and use uploads_path in a template

Post by webform »

Is it possible to get and use the uploads_path (/var/www/domain.com/uploads) in a template or do i need to hard code it?

I'm trying to use getimagesize($item->image) in a template but I can't use {uploads_url} as i get no output. If i hardcode the uploads_path instead i get a result for getimagesize.
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1829
Joined: Wed Feb 25, 2009 4:25 am

Re: Get and use uploads_path in a template

Post by DIGI3 »

I'm guessing this is LISE, if you look at the default templates they use ->GetImagePath(true), which you could probably adapt.

If you can't get that to work, you can always brute force it:
{$myimagepath = "{uploads_url}/{$item->image}"}
getimagesize($myimagepath)
Not getting the answer you need? CMSMS support options
Post Reply

Return to “CMSMS Core”