Welcome to Geeklog, Anonymous Monday, December 23 2024 @ 06:48 am EST

Geeklog Forums

Different backgrounds for various blocks


Earnest

Anonymous
What would be required to make Geeklog allow us to use different backgrounds for individual blocks? On some blocks I do not want a title to display. I may simply wish to include an image. For others I may wish a title and a different background color. Is this at all possible?

TIA!
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
You can override the template for each block individually. See this old posting for the basics and the functions.php of your theme for more details.

bye, Dirk
 Quote

Status: offline

beewee

Forum User
Full Member
Registered: 08/05/03
Posts: 969
Location:The Netherlands, where else?
Quote by: Earnest

What would be required to make Geeklog allow us to use different backgrounds for individual blocks? On some blocks I do not want a title to display. I may simply wish to include an image. For others I may wish a title and a different background color. Is this at all possible?

TIA!



I'm using a block template called 'blank' for several years, couldn't live without it...

If you only want to give blocks on one side a different background, change leftblocks.thtml and/or rightblocks.thtml since they give the all blocks on that side a different background color, and give all blocks a transparent background.
Dutch Geeklog sites about camping/hiking:
www.kampeerzaken.nl | www.campersite.nl | www.caravans.nl | www.caravans.net
 Quote

HughJohnson

Anonymous
You can use the {block_id} as a css class or id inside of the block template file, and change the backgrounds via your stylesheet. There can be issues with special characters but if your careful about how you choose your block id's it works great.
 Quote

Status: offline

beewee

Forum User
Full Member
Registered: 08/05/03
Posts: 969
Location:The Netherlands, where else?
Quote by: HughJohnson

You can use the {block_id} as a css class or id inside of the block template file, and change the backgrounds via your stylesheet. There can be issues with special characters but if your careful about how you choose your block id's it works great.



I didn't know that {block_id} actually worked as a theme variable? Tried it once in GL 1.3.11, and that didn't work so I used the old Chameleon plugin instead.
Dutch Geeklog sites about camping/hiking:
www.kampeerzaken.nl | www.campersite.nl | www.caravans.nl | www.caravans.net
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Quote by: HughJohnson

You can use the {block_id} as a css class or id inside of the block template file, and change the backgrounds via your stylesheet. There can be issues with special characters but if your careful about how you choose your block id's it works great.


If you're referring to {blockid} (no underscore) - that was removed in 1.5.0rc2 (and never was available in any final version):
- Removed the fake {blockid} for the block templates as it was actually derived
from the block title, resulting in layout changes when you changed the block
title. It also didn't work properly with non-ASCII languages. Updated
style.css and the block templates accordingly

bye, Dirk
 Quote

HughJohnson

Anonymous
Quote by: Dirk

Quote by: HughJohnson

You can use the {block_id} as a css class or id inside of the block template file, and change the backgrounds via your stylesheet. There can be issues with special characters but if your careful about how you choose your block id's it works great.


If you're referring to {blockid} (no underscore) - that was removed in 1.5.0rc2 (and never was available in any final version):
- Removed the fake {blockid} for the block templates as it was actually derived
from the block title, resulting in layout changes when you changed the block
title. It also didn't work properly with non-ASCII languages. Updated
style.css and the block templates accordingly

bye, Dirk



Ahh yes I see now the site I used it on is still running "Geeklog 1.3.12cvs". I guess now I am glad I never upgraded it (It's not used for much).

Just curious but why was the blockid removed?
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Hmm. 1.3.12 was released as 1.4.0. I thought {blockid} only existed in the pre-release versions of 1.5.0 ...

I've already quoted the reasons for the removal above: It wasn't the real block id but a fake one based on the block title. So changing the block title (manually or automatically, e.g. by switching the language) could affect your layout. Plus you could end up with an empty id in non-ASCII languages (e.g. Japanese).

It simply wasn't usable in the real world.

bye, Dirk
 Quote

All times are EST. The time is now 06:48 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