How to load image src from secure url



  • I am using {{ Theme::url('img/logo.jpg') }} to load the image to the views. But it doesn't give me secure image url even when I was browsing the site through https. How can I force the Theme to load the image through https?


  • Global Moderator

    Hello @xchitox

    For the time being this is not directly related to AsgardCMS, but package it uses Stylist.
    There is no such option right out of the box, but you can submit PR to that package for this.
    For the time beeing you would manually build this link.

    Change that needs to be done

        /**
         * Returns the theme's public URI location. This is not a full URL. If you wish
         * for a full URL, simply add the site's URL configuration to this path.
         *
         * @param string $file
         * @param bool   $secure
         * @return string
         */
        public function url($file = '', $secure = false)
        {
        	if ($secure) {
        		return secure_url($this->assetUrl($file));
        	}
        	
            return url($this->assetUrl($file));
        }
    

    I'll try to submit this PR asap.

    Thanks.


Log in to reply
 

Looks like your connection to AsgardCms was lost, please wait while we try to reconnect.