Results 1 to 2 of 2

Hybrid View

  1. #1
    Join Date
    Jun 2013
    Location
    Alberta
    Posts
    2
    Plugin Contributions
    0

    Default Can I add media tags to the stylesheet include?

    Hello, I have two stylesheets, one for the main look of the site, and one for cell phone display (where HTML5 is supported).

    In a test file, external to zencart I have manually coded the sheets in so that they load on appropriate screen widths.
    <link rel="stylesheet" type="text/css" media="screen and (min-width: 1056px)" href="includes/templates/geeVideoProduction/css/stylesheet.css" />
    <link rel="stylesheet" type="text/css" media="screen and (max-width: 1056px), handheld" href="includes/templates/geeVideoProduction/css/smaller_stylesheet.css" />

    I would like to know how I can include the media section when including the stylesheets using the PHP zencart uses to import as much as possible.

  2. #2
    Join Date
    Jun 2013
    Location
    Alberta
    Posts
    2
    Plugin Contributions
    0

    Default Re: Adding HTML5 tags to the stylesheet include

    This may not be the best way to do this, but in my custom stylesheet folder I copied over html_header.php. It had already been modified with the plugin Improved Stylesheet Calls.

    I found the section adding the stylesheets in and modified as follows, thus allowing myself to have entire libraries of CSS (as if I'd ever need it) for the small and large media. Working with this more for those considering something like this, I would suggest three media sizes. However, this gets the cell phones happier for now.:
    <?php
    /**
    * load all template-specific stylesheets, named like "style*.css", alphabetically
    */
    $directory_array = $template->get_template_part($template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css'), '/^style/', '.css');
    while(list ($key, $value) = each($directory_array)) {
    echo '<link rel="stylesheet" type="text/css" href="' . $template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css') . '/' . $value . '" />'."\n";
    }

    $directory_array = $template->get_template_part($template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css'), '/^largemedia/', '.css');
    while(list ($key, $value) = each($directory_array)) {
    echo '<link rel="stylesheet" type="text/css" media="screen and (min-width: 1056px)" href="' . $template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css') . '/' . $value . '" />'."\n";
    }

    $directory_array = $template->get_template_part($template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css'), '/^smallmedia/', '.css');
    while(list ($key, $value) = each($directory_array)) {
    echo '<link rel="stylesheet" type="text/css" media="screen and (max-width: 1056px), handheld" href="' . $template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css') . '/' . $value . '" />'."\n";
    }

 

 

Similar Threads

  1. How do I include the title in the address bar to include the product name?
    By alliedlock in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 2 Aug 2009, 05:59 AM
  2. Replies: 0
    Last Post: 13 Mar 2009, 10:00 PM
  3. Can't add products in Media Manager
    By flipperry in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 7 Mar 2009, 08:14 PM
  4. Product Listing Modification to Include Link to Media Manager Preview
    By sleastack in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 2 Mar 2008, 12:25 AM
  5. HowTo include an IE Conditional Comments stylesheet
    By joelfarris in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 9 Jun 2007, 02:33 AM

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