Welcome to Geeklog, Anonymous Thursday, March 28 2024 @ 09:32 am EDT

Geeklog Forums

Block with custom formatting?


Status: offline

RickW

Forum User
Full Member
Registered: 01/28/04
Posts: 240
Location:United States
I have a block that is an RSS feed for Active Virus Alerts. When there aren't any outbreaks, the rss is empty so I end up with just the title of a block and a single list dot.

What I would like to do, is make this block look different than the rest. When there is an active virus in the list, I want the links to be bold and bright red. I'm also thinking about putting a bright red border around the whole block.

But when the RSS is empty, instead of a single list dot, I would just like the statement "No active outbreaks" in a green color.

Is any of this possible? Since the RSS overwrites whatever is in Block Content, I can't put in any custom code.
www.antisource.com
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
In 1.3.10, all the list items in the feed have a class="list-feed", so you could use CSS to change the text color, etc.

Not sure if Geeklog should display the block at all when the feed doesn't contain any items ...

bye, Dirk
 Quote

Status: offline

RickW

Forum User
Full Member
Registered: 01/28/04
Posts: 240
Location:United States
Quote by Dirk: In 1.3.10, all the list items in the feed have a class="list-feed", so you could use CSS to change the text color, etc.

Not sure if Geeklog should display the block at all when the feed doesn't contain any items ...

bye, Dirk


That will definitely be helpful, but I have 4 different feeds and growing. I need to do something for this one particular feed. Perhaps in the next release, on the blocks editing page, there could be a field in the css section so you could set your own custom css class for the list items? Smile
www.antisource.com
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Another option would be to use custom block headers and footers for the blocks. Every block has a unique name that you can use to identify it and override the block's default header / footer templates in the theme's functions.php file.

The old Clean theme has a functions.php that should give you some ideas. The original idea was first described here.

My point is that you could define your own classes, set them in the custom block header and then use inheritance to change the list style.

bye, Dirk
 Quote

Status: offline

RickW

Forum User
Full Member
Registered: 01/28/04
Posts: 240
Location:United States
Thanks, that should work great for what I need to do.
www.antisource.com
 Quote

All times are EDT. The time is now 09:32 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content