Hi i d like to styel my views rows with some rounded corners style, as far as i understand i need to add a top and a bottom div. so i can use a background then fill the row with a color. I am then trying to figure out which template files inside the view module to override. I think all i have to do is to isolate the necessary template and make a copy of it in my root folder then start working there. So my question is: which one is the file i need to work with? Any hint?
Then a little detail i ve been thinking about to refine my views.I know you can add a frame to any image with image-cache but I have some back-ground coloring style using the odd/even selector for the view s row, so i d need to apply 2 different frame/colors depending on the position of the row. I can t really see how to do that, maybe some extra back-ground using the z-index?...
Simone
Let s see: I think the proper file would be:
module/views/theme/views-view-unformatted.tpl.php
and i ve tried to modify it in this way
<?php if (!empty($title)): ?> <h3><?php print $title; ?></h3> <?php endif; ?> <?php foreach ($rows as $id => $row): ?> <div id=top-view> </div> <div class="<?php print $classes[$id]; ?>"> <?php print $row; ?> </div> <div id=bottom-view> </div> <?php endforeach; ?>
then adding some background to div.views-view-top in my style.css
no results so far
Simone
On Sat, Dec 13, 2008 at 2:53 PM, simone-www. io-lab. org cimo75@gmail.com wrote:
Hi i d like to styel my views rows with some rounded corners style, as far as i understand i need to add a top and a bottom div. so i can use a background then fill the row with a color. I am then trying to figure out which template files inside the view module to override. I think all i have to do is to isolate the necessary template and make a copy of it in my root folder then start working there. So my question is: which one is the file i need to work with? Any hint?
Then a little detail i ve been thinking about to refine my views.I know you can add a frame to any image with image-cache but I have some back-ground coloring style using the odd/even selector for the view s row, so i d need to apply 2 different frame/colors depending on the position of the row. I can t really see how to do that, maybe some extra back-ground using the z-index?...
Simone
-- .wmv , .wma , .pps along with all proprietary Windows formats won t be accepted and/or viewed....
views-view-fields--myview.tpl.php
seems to be a more accurate candidate as it should address only the rows of that view code inside is: (and no really an idea of what to do with it)
<?php // $Id: views-view-fields.tpl.php,v 1.6 2008/09/24 22:48:21 merlinofchaos Exp $ /** * @file views-view-fields.tpl.php * Default simple view template to all the fields as a row. * * - $view: The view in use. * - $fields: an array of $field objects. Each one contains: * - $field->content: The output of the field. * - $field->raw: The raw data for the field, if it exists. This is NOT output safe. * - $field->class: The safe class id to use. * - $field->handler: The Views field handler object controlling this field. Do not use * var_export to dump this object, as it can't handle the recursion. * - $field->inline: Whether or not the field should be inline. * - $field->inline_html: either div or span based on the above flag. * - $field->separator: an optional separator that may appear before a field. * - $row: The raw result object from the query, with all data it fetched. * * @ingroup views_templates */ ?> <?php foreach ($fields as $id => $field): ?> <?php if (!empty($field->separator)): ?> <?php print $field->separator; ?> <?php endif; ?>
<<?php print $field->inline_html;?> class="views-field-<?php print $field->class; ?>"> <?php if ($field->label): ?> <label class="views-label-<?php print $field->class; ?>"> <?php print $field->label; ?>: </label> <?php endif; ?> <?php // $field->element_type is either SPAN or DIV depending upon whether or not // the field is a 'block' element type or 'inline' element type. ?> <<?php print $field->element_type; ?> class="field-content"><?php print $field->content; ?></<?php print $field->element_type; ?>> </<?php print $field->inline_html;?>> <?php endforeach; ?>
On Sat, Dec 13, 2008 at 3:58 PM, simone-www. io-lab. org cimo75@gmail.com wrote:
Let s see: I think the proper file would be:
module/views/theme/views-view-unformatted.tpl.php
and i ve tried to modify it in this way
<?php if (!empty($title)): ?>
<h3><?php print $title; ?></h3> <?php endif; ?> <?php foreach ($rows as $id => $row): ?> <div id=top-view> </div> <div class="<?php print $classes[$id]; ?>"> <?php print $row; ?> </div> <div id=bottom-view> </div> <?php endforeach; ?>
then adding some background to div.views-view-top in my style.css
no results so far
Simone
On Sat, Dec 13, 2008 at 2:53 PM, simone-www. io-lab. org cimo75@gmail.com wrote:
Hi i d like to styel my views rows with some rounded corners style, as far as i understand i need to add a top and a bottom div. so i can use a background then fill the row with a color. I am then trying to figure out which template files inside the view module to override. I think all i have to do is to isolate the necessary template and make a copy of it in my root folder then start working there. So my question is: which one is the file i need to work with? Any hint?
Then a little detail i ve been thinking about to refine my views.I know you can add a frame to any image with image-cache but I have some back-ground coloring style using the odd/even selector for the view s row, so i d need to apply 2 different frame/colors depending on the position of the row. I can t really see how to do that, maybe some extra back-ground using the z-index?...
Simone
-- .wmv , .wma , .pps along with all proprietary Windows formats won t be accepted and/or viewed....
-- .wmv , .wma , .pps along with all proprietary Windows formats won t be accepted and/or viewed....
On 13 Dec 2008, at 14:53, simone-www.io-lab.org wrote:
Hi i d like to styel my views rows with some rounded corners style, as far as i understand i need to add a top and a bottom div. so i can use a background then fill the row with a color. I am then trying to figure out which template files inside the view module to override. I think all i have to do is to isolate the necessary template and make a copy of it in my root folder then start working there. So my question is: which one is the file i need to work with? Any hint?
Use the Views theming wizard, that will make a function for your template.php and the contents of a template for your view with the fields printed out.
hi i forgot to mention that i use view 2 in D6 and there isn t a theme wizard (not that i am aware of) Anyway i figure out by myself: i have created a views-view-fields--myview.tpl.php file in the theme directory the content for this file was found under "theme:information" in the view settings. I ve wrapped the whole code with a div and given it a class, i have then added a top div and a bottom div, with a class for each as well. Then in my style.css i had to do a bit of playing around with bottom/top even/odd classes and i got the result i wanted, this was my real first module/theming override and that i got the trick ithink there will be some more... In my case I have a fixed width for my views so i don t really need it but i see how adding div s like right/left bottom/top corners with top/bottom bars you could make a flexible rounded corner box. I hope this thread can help somebody else and that somebody will confirm that i ve used the proper way to hack my view. thanks Simone
On Sat, Dec 13, 2008 at 9:06 PM, Nicolas Borda forums@ipwa.net wrote:
On 13 Dec 2008, at 14:53, simone-www.io-lab.org wrote:
Hi i d like to styel my views rows with some rounded corners style, as far as i understand i need to add a top and a bottom div. so i can use a background then fill the row with a color. I am then trying to figure out which template files inside the view module to override. I think all i have to do is to isolate the necessary template and make a copy of it in my root folder then start working there. So my question is: which one is the file i need to work with? Any hint?
Use the Views theming wizard, that will make a function for your template.php and the contents of a template for your view with the fields printed out. -- Nicolas
-- [ Drupal support list | http://lists.drupal.org/ ]