Recent Topics

1 Nov 11, 2008 14:16    

Afternoon everyone,

I was asked to add an extra blog for our website and make a different skin for it. All went well and good and then I thought I'd tinker round with the widgets - a little sprinkling of CSS magic should do the trick, or so I thought.

I added a name in a widget's CSS Class parameter (under Blog > Widget > Edit) thinking this I could then target in the skin's style sheet. This didn't work. Looking at the page's source code I see that the 'class' attribute hasn't been added so each widget still has the default 'class="widget'" attached.

What crucial point am I missing here?

Matthew

2 Nov 11, 2008 15:45

When you set widget class it doesn't replace the existing one. So if you set class "qwerty" for Blog title widget you'll get the following in skin

<div class="widget_core_coll_title qwerty">

3 lxsparks Nov 11, 2008 20:08

lxsparks

I'm targeting a widget within a sidebar container, so where would I add the <div> tag with out affecting the other widgets which I don't wish to style?

Extract of code from _sidebar include template based on the Nifty Corners design:-

...notes here...

<div id="sidebar">

<ul>
<?php
// ------------------------- "Sidebar" CONTAINER EMBEDDED HERE --------------------------
// Display container contents:
skin_container( NT_('Sidebar'), array(
// The following (optional) params will be used as defaults for widgets included in this container:
// This will enclose each widget in a block:
'block_start' => '<li class="widget">',
'block_end' => '</li>',
// This will enclose the title of each widget:
'block_title_start' => '<h2>',
'block_title_end' => '</h2>',
// If a widget displays a list, this will enclose that list:
'list_start' => '<ul>',
'list_end' => '</ul>',
// This will enclose each item in a list:
'item_start' => '<li>',
'item_end' => '</li>',
// This will enclose sub-lists in a list:
'group_start' => '<ul>',
'group_end' => '</ul>',
// This will enclose (foot)notes:
'notes_start' => '<div class="notes">',
'notes_end' => '</div>',
) );
// ----------------------------- END OF "Sidebar" CONTAINER -----------------------------
?>
</ul>

...code for b2evolution promotion here...

</div>

4 lxsparks Nov 11, 2008 20:37

lxsparks

Aha, it's come to me at last.

The original skin I've been using must have been designed for a previous version of b2evolution. I have changed the line:-

'block_start' Arrow '<li class="widget">',

to:-

'block_start' Arrow '<li class="$wi_class$">',

and hey presto each widget now has it's own class attached and now the definable class/id's appear :D


Form is loading...