Change file path in Gallery module?

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
pwg
Forum Members
Forum Members
Posts: 191
Joined: Tue Aug 01, 2006 1:48 am
Location: Sydney

Change file path in Gallery module?

Post by pwg »

Perhaps a silly question, but is there a way to change the file path in the Gallery module?
I looked over the Gallery files (quickly) but couldn't see where to change them.

I've been using a CDN, which caches all images from a set URL, for other modules and like the functionality and page speed increases.

So rather than the full image file path being used in templates in {$image->image}, I'd either like to set the CDN path or just the immediate file path, without the domain part being included and hard code the CDN path into Gallery templates. Hopefully this makes sense.

I could use LISE, but this is an older site with a few hundred galleries, so that seems like a bit more work.

Thanks for any help.

Cheers,

Paul
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1629
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: Change file path in Gallery module?

Post by DIGI3 »

I'm not too familiar with the module, but could you use |replace in $image->file to replace the current url with the CDN url? {$image->file|replace:$url:$cdnurl} - probably not as efficient as hardcoding it in the module but arguably easier.

If Gallery uses the config.php setting for uploads_url you could also try setting the cdn url there so it applies globally.
Not getting the answer you need? CMSMS support options
pwg
Forum Members
Forum Members
Posts: 191
Joined: Tue Aug 01, 2006 1:48 am
Location: Sydney

Re: Change file path in Gallery module?

Post by pwg »

Thanks so much for the reply DIGI3, a pretty simple solution that will work in the short term - much appreciated!

I will need to check efficiency and would prefer to be able to change the base Gallery URL, but I've now had a better look over the Gallery files and still can't see where to change, so this will do for now.

Cheers,
Paul
Post Reply

Return to “Modules/Add-Ons”