Results 1 to 10 of 13

Hybrid View

  1. #1
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,942
    Plugin Contributions
    96

    Default Re: Background images not showing on https pages

    You'll need two file changes. First, create the https_images.css file that contains only the image-related references, with those references based on your shared-SSL server, for example:
    Code:
    body {background-image: url(https://supersonic.accountservergroup.com/~myaccountname/mywebsite.co.uk/includes/templates/mytemplate/images/bk.png);}
    Then, update one of files (or create a new file) in /includes/templates/YOUR_TEMPLATE/auto_loaders to contain:
    Code:
    if ($request_type == 'SSL') {
      $loaders[] = array('conditions'    => array('pages' => array ('*')),
                         'css_files'     => array('https_images.css' => 20002),
                        );
    }
    Leave your normal stylesheet alone, picking up the images using the ../images notation. That path to the files will be picked up on non-SSL accesses.

  2. #2
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,303
    Plugin Contributions
    1

    Default Re: Background images not showing on https pages

    Quote Originally Posted by lat9 View Post
    You'll need two file changes. First, create the https_images.css file that contains only the image-related references, with those references based on your shared-SSL server, for example:
    Code:
    body {background-image: url(https://supersonic.accountservergroup.com/~myaccountname/mywebsite.co.uk/includes/templates/mytemplate/images/bk.png);}
    Then, update one of files (or create a new file) in /includes/templates/YOUR_TEMPLATE/auto_loaders to contain:
    Code:
    if ($request_type == 'SSL') {
      $loaders[] = array('conditions'    => array('pages' => array ('*')),
                         'css_files'     => array('https_images.css' => 20002),
                        );
    }
    Leave your normal stylesheet alone, picking up the images using the ../images notation. That path to the files will be picked up on non-SSL accesses.
    This is great, thank you.

    Somethings not quite right though. I've created the css file and a new autoloader file with the contents

    PHP Code:
    <?php
    if ($request_type == 'SSL') {
      
    $loaders[] = array('conditions'    => array('pages' => array ('*')),
                         
    'css_files'     => array('https_images.css' => 20002),
                        );
    }
    The https_images.css does not appear in the page source on https pages - the login for example. If I remove the SSL condition check so the code looks like

    PHP Code:
    <?php

      $loaders
    [] = array('conditions'    => array('pages' => array ('*')),
                         
    'css_files'     => array('https_images.css' => 20002),
                        );
    then the https_images.css is applied and is in the page source of the https page.

    Seems a bit strange

  3. #3
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,942
    Plugin Contributions
    96

    Default Re: Background images not showing on https pages

    Yes, the $request_type is set pretty early in a page's generation. I'm not sure how the version of the CSS/JS loader I was using compares to yours, but you could try adding a global statement in case that code is pulled in by a function call:
    Code:
     
    <?php
    global $request_type;
    if ($request_type == 'SSL') {
      $loaders[] = array('conditions'    => array('pages' => array ('*')),
                         'css_files'     => array('https_images.css' => 20002),
                        );
    }

  4. #4
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,303
    Plugin Contributions
    1

    Default Re: Background images not showing on https pages

    That'll do nicely, thank you for your help.

 

 

Similar Threads

  1. Templage Images not showing up on secure pages....
    By BlackOrchidCouture in forum General Questions
    Replies: 3
    Last Post: 19 Oct 2010, 07:14 PM
  2. Images not showing in HTTPS
    By DarrenQ in forum General Questions
    Replies: 15
    Last Post: 20 Jun 2010, 03:30 AM
  3. Images on product pages not showing
    By TzuLady in forum General Questions
    Replies: 2
    Last Post: 15 Apr 2010, 09:06 AM
  4. Images showing as http on https
    By IDW in forum General Questions
    Replies: 6
    Last Post: 12 Apr 2010, 02:36 AM
  5. Images not showing when customer use HTTPS
    By mmambou in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 3 May 2009, 09:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg