Hi
can anybody help me!
i need specific css for a category so i made a file c_1.css
the problem is that i must use browser css too for that category only,
is this possible?
i tried ie7_c_1.css but it loads in all categores![]()
Hi
can anybody help me!
i need specific css for a category so i made a file c_1.css
the problem is that i must use browser css too for that category only,
is this possible?
i tried ie7_c_1.css but it loads in all categores![]()
I don't think that you can do that without a bit of coding. I might be wrong but I can't see a way.
Firstly, I'd really have a think about why you need a IE specific stylesheet for every category. Is it possible to do this in some other way?
If you really need this feature then you are going to need to edit:
includes/templates/yourtemplate/common/html_header.php
In this file there is a chunk of code that looks for the appropriate stylesheets and includes them in the page. You will need to alter this to look for the IE specific stylesheets too and possible wrap them in <-- -->. The code your looking for looks like this:
If that just confuses you then post again.Code:/** * load stylesheets on a per-page/per-language/per-product/per-manufacturer/per-category basis. Concept by Juxi Zoza. */ $manufacturers_id = (isset($_GET['manufacturers_id'])) ? $_GET['manufacturers_id'] : ''; $tmp_products_id = (isset($_GET['products_id'])) ? (int)$_GET['products_id'] : ''; $tmp_pagename = ($this_is_home_page) ? 'index_home' : $current_page_base; $sheets_array = array('/' . $_SESSION['language'] . '_stylesheet', '/' . $tmp_pagename, '/' . $_SESSION['language'] . '_' . $tmp_pagename, '/c_' . $cPath, '/' . $_SESSION['language'] . '_c_' . $cPath, '/m_' . $manufacturers_id, '/' . $_SESSION['language'] . '_m_' . (int)$manufacturers_id, '/p_' . $tmp_products_id, '/' . $_SESSION['language'] . '_p_' . $tmp_products_id ); while(list ($key, $value) = each($sheets_array)) { //echo "<!--looking for: $value-->\n"; $perpagefile = $template->get_template_dir('.css', DIR_WS_TEMPLATE, $current_page_base, 'css') . $value . '.css'; if (file_exists($perpagefile)) echo '<link rel="stylesheet" type="text/css" href="' . $perpagefile .'" />'."\n"; }
Nick
iszent.com
thanks, I'm not confused only a bit
i use extensive css to position options and attributes
and all browsers do them differently, because i use position:relative
take a look
https://www.voucher-checks.com/quick...page-p-13.html
i got them to work for one product type but if i use other options for a different product it will be all messed up
i wanted to use some hack to import the styles via product descriptions, i got shunned by DR. Bytes and others for even thinking of it
http://www.zen-cart.com/forum/showth...=158986&page=2
i appreciate your time :)
OK - well you can edit the code above to include some extra stylesheets where you need them. That is possible.
The other thing is to add a unique id to each attribute so that you can apply code to each attribute dependent on what it is rather than it's position on the page. So 'colour' always receives its own styling. That involves a bit of an edit of attributes.php . I have outlined it a few times on the forum.
Nick
iszent.com
how can i give an id to each option?
it is generated dynamically on an array
In tpl_modules_attributes at about line 30 look for
change it toCode:<div class="wrapperAttribsOptions">
The first bit of that strips certain things out of the option name and makes it lowercase. Then this version of the option name is used as an Id. If you have other awkward characters in your option names then you might need to strip them out as well.Code:<?php $new2= strip_tags($options_name[$i]);?> <?php $new3=str_replace(' ', '', $new2);?> <?php $new3=str_replace(':', '', $new3);?> <?php $new4=strtolower($new3);?> <div class="wrapperAttribsOptions" id="attributeBox-<?php echo $new4 ?>">>
Nick
iszent.com
thanks I'll try it and let you know :)
thanks,
It works wonderful
only the swatches do not get any id, any idea
your help is greatly appreciated
Yeah, they are slightly separate. So you need to add in there too. Find this:
and wrap it in a div like this:Code:<?php if ($options_attributes_image[$i] != '') { ?> <?php echo $options_attributes_image[$i]; ?> <?php } ?>
I think that should work but I just made it up and haven't tested itCode:<div class="wrapperAttribsImage" id="attribute-image-<?php echo $new4 ?>"> <?php if ($options_attributes_image[$i] != '') { ?> <?php echo $options_attributes_image[$i]; ?> <?php } ?> </div>![]()
Nick
iszent.com
Flexible Attributes in Free Addons automates an id for each attribute - essentially
<div class="wrapperAttribsOptions">
gets an id like
<div class="wrapperAttribsOptions" id="<?php echo $options_wrapper_id[$i];?>">
where $options_wrapper_id is set previously in attributes.php:
$options_wrapper_id[] = 'wAttrib-' . $products_options_names->fields['products_options_id'];
You can globally set styling for an attribute in all products where it appears, or in an individual product with a per-product stylesheet.