Hi,
I have installed the gallery module http://dev.cmsmadesimple.org/projects/gallery
In the smarty tag {$image->file} I am getting the full image path, including protocol and domain. Which works fine in http but in https triggers insecure content warnings.
How can I remove at least the protocol, or just change to root relative paths?
eg:
from: http://domain.com/path/to/img/img.jpg
to: //domain.com/path/to/img/img.jpg
or, ideally: /path/to/img/img.jpg
thank you for any help.
Gallery - image protocol [http/s]
Re: Gallery - image protocol [http/s]
It should get the https url when viewed on https - it's getting it from root_url as far as I can tell. I just did a quick test on the latest version and {$image->file} outputs https://etc when viewed on https, and http://etc when viewed on http.
If you really want to strip it though, you could perhaps do something like
{$image->file|replace:"{root_url}":""}
Which may not work if it's a configuration issue causing your problem.
You may wish to check config.php and htaccess for anything forcing the image url back to http - and of course make sure you're not viewing a cached page.
If you really want to strip it though, you could perhaps do something like
{$image->file|replace:"{root_url}":""}
Which may not work if it's a configuration issue causing your problem.
You may wish to check config.php and htaccess for anything forcing the image url back to http - and of course make sure you're not viewing a cached page.
Not getting the answer you need? CMSMS support options
Re: Gallery - image protocol [http/s]
Hi Digi3,
thank you for your reply.
tried using
{$image->file|replace:"{root_url}":""}
but that only worked when viewing on the http version of the site...
So updated confog.php - $config['root_url'] to use the https protocol and updated htaccess to force https and everything is now on the https protocol.
thank you for your help!
thank you for your reply.
tried using
{$image->file|replace:"{root_url}":""}
but that only worked when viewing on the http version of the site...
So updated confog.php - $config['root_url'] to use the https protocol and updated htaccess to force https and everything is now on the https protocol.
thank you for your help!
Re: Gallery - image protocol [http/s]
In newer versions of CMSMS you can actually remove all of the url and path settings in config, they're calculated automatically - that would probably have done the trick too. Glad you figured it out though.
Not getting the answer you need? CMSMS support options