Recent Topics

[IN PROGRESS] styling sidebar lists

Started by on Nov 20, 2014 – Contents updated: Nov 29, 2014

Nov 20, 2014 03:07    

I understand function of the parameters in _sidebar.inc.php in regard to the styling of the list of widgets, but I want to be able to style individual lists in successive widgets. Can I use the CSS Class: and DOM ID: parameters where they appear in widget configuration to do this? If so, what would I enter in each box to affect such an override? I've had no success in doing that.

Nov 24, 2014 07:32

Hi @tgodfrey,

It's not enough with adding values to CSS Class or DOM ID, the skin must support the $wi_class$ and $wi_ID$ placeholders. Which skin are you currently using?

Please, look at the picture to see how I added a couple of styles to the widgets using evoPress.

Regards!

Nov 24, 2014 08:10

Ah. I see. I am using 'Natural Remedy' which doesn't seem to allow that. The styling for the display of the overall sidebar list is applied to all lists which occur in widgets. So, sidebar a {} is just that. I can work around that with free HTML OK, and that is fine for me, but not for the website owner who would want to see his entries automagically appear on the creation of posts.

Why Natural Remedy? Because with one or two media queries I can get the site to scale properly from 1920px wide desktop screens to tablets. A little bit of fiddling is all that is required. Nice.

In another context, I knocked out the 'sidebar' id from _sidebar.inc.php, but the net effect of that is obviously that all widgets become free html.

No direction home, it would seem!

Nov 26, 2014 08:28

Well, you can update you skin to support the $wi_class$ placeholder and be able to follow what I mentioned before. Just go to the file _sidebar.inc.php of your skin and replace the "block_start" parameter in the skin_container function.

So, you just need to replace this:

PHP

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

with this:

PHP

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

This line should be around number 28 if you didn't apply major modifications in that script before.

I'm sorry, I didn't understand this:

In another context, I knocked out the 'sidebar' id from _sidebar.inc.php, but the net effect of that is obviously that all widgets become free html.

What did you do exactly?

Regards!

Nov 27, 2014 06:13

That's great. I get it now. I have never worked with a skin that had other than the standard

li class="widget"

so I had no idea what to do there!

What I did to get around the problem of the same formatting being applied to every li in the sidebar was simply

Code

-     skin_container( NT_(''), array(

but that precluded the use of any widget other than free html, at least without a good deal of messing about. Fine for someone happy to manually code links, but somewhat limiting for others.

Many thanks for showing the way there.


Form is loading...

powered by b2evolution free blog software – This forum is powered by b2evolution CMS, a complete engine for your website.