Results 1 to 3 of 3
  1. #1
    Join Date
    May 2007
    Posts
    5
    Plugin Contributions
    0

    Default More control on layouts only by CSS Stylesheet?

    I've searched the forum here for a while and can't find an answer to this (or a contributed module) so I thought I'd ask the question. If I used the wrong words please direct me to the answer :-)

    Now, I love CSS. I want to layout every detail of my site using CSS but I'm finding it a little tough. For example: In the product listing zen outputs the following html:

    HTML Code:
    <tr  class="productListing-odd">
       <td class="productListing-data" align="center"><a href="http://www.mysite.co.uk/index.php?main_page=document_general_info&amp;cPath=10&amp;products_id=1040"><img src="images/noimg.JPG" alt="Full Height Base Units" title=" Full Height Base Units " width="100" height="80" class="listingProductImage" /></a></td>
       <td class="productListing-data"><h3 class="itemTitle"><a href="http://www.mysite.co.uk/index.php?main_page=document_general_info&amp;cPath=10&amp;products_id=1040">Full Height Base Units</a></h3><div class="listingDescription">Full Height Base Units available in different sizes.</div></td>
       <td class="productListing-data" align="right"><br /><br /><a href="http://www.mysite.co.uk/index.php?main_page=document_general_info&amp;cPath=10&amp;products_id=1040">... more info</a><br /><br /></td>
      </tr>
    What I really want is more classes/spans/divs in there by default. For example:

    HTML Code:
    <span class="listingprodid1040">
    <tr  class="productListing-odd">
       <td class="productListing-data" align="center"><a href="http://www.mysite.co.uk/index.php?main_page=document_general_info&amp;cPath=10&amp;products_id=1040"><img src="images/noimg.JPG" alt="Full Height Base Units" title=" Full Height Base Units " width="100" height="80" class="listingProductImage" /></a></td>
       <td class="productListing-data"><h3 class="itemTitle"><a href="http://www.mysite.co.uk/index.php?main_page=document_general_info&amp;cPath=10&amp;products_id=1040">Full Height Base Units</a></h3><div class="listingDescription">Full Height Base Units available in different sizes.</div></td>
       <td class="productListing-data" align="right"><br /><br /><a href="http://www.mysite.co.uk/index.php?main_page=document_general_info&amp;cPath=10&amp;products_id=1040">... more info</a><br /><br /></td>
      </tr>
    </span>
    Simply adding a style over the whole row with (for example) the product ID built automatically into the class name means I can always make certain products look certain ways - even though they share the same core features zen cart provides (like write a review, displaying the image and so on). This could also be applied to other things as well, for example, the product type.

    So, to do this I can quite easily go and rewrite the PHP that generates the product listing and add the tags I want BUT I'd rather not go rewriting scripts if it's already been done and I just haven't found the zen way.

    Further, if it hasn't been done, is it something that others would fine useful? In which case perhaps someone can point me the write way to contributing my alterations back?

    Many Thanks
    Steve
    http://www.kinsbury.co.uk

  2. #2
    Join Date
    Jun 2003
    Posts
    33,721
    Plugin Contributions
    0

    Default Re: More control on layouts only by CSS Stylesheet?

    Adding the span does what that you can't already do with the existing tags?
    Please do not PM for support issues: a private solution doesn't benefit the community.

    Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

  3. #3
    Join Date
    May 2007
    Posts
    5
    Plugin Contributions
    0

    Default Re: More control on layouts only by CSS Stylesheet?

    (appologies for the long absense)

    Quote Originally Posted by Kim View Post
    Adding the span does what that you can't already do with the existing tags?
    Yes, in my case I need to change the look of a particular product, in the example code above, product id 1040, so I could perhaps put a border around just this item using some CSS like:
    Code:
    .listingproductid1040 {
        border-style:thin;
        border-color:black;
        border-type:solid;
    }
    Using the CSS, I could do other neat things like call in a "sale price" graphic or change the background colour of just this section.

    Setting a style to a specific product ID is not likely to be within the needs of the majority, but setting a style by product type may well be. For example, giving the option of style "product - general" different to "document - general" may be useful for others. I'm still new to Zen, but perhaps it could be a simple as introducing a <span> for every attribute applied to an item? Then if someone creates a new attribute they will get a style they can use across the whole item?

    Anyway, before I start hacking the code and destroy my easy upgrade path, is there a CSS solution already out there and if not, would anyone be interested in me posting my code changes as I go for future reference?

 

 

Similar Threads

  1. How do I create a css stylesheet for only my shopping cart page.
    By bigstore in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 21 Feb 2012, 04:26 PM
  2. I want to add more stylesheet and more Javascript
    By shabizon in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 21 Oct 2010, 04:25 PM
  3. CSS Stylesheet for One Product Only?
    By limelites in forum General Questions
    Replies: 4
    Last Post: 19 Jun 2010, 04:46 PM
  4. want to reposition an image using css. what is css to control this?
    By what44 in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 10 Nov 2007, 05:03 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