Welcome to Geeklog, Anonymous Wednesday, December 25 2024 @ 11:11 pm EST

Geeklog Forums

Different template for certain blocks.


Status: offline

destr0yr

Forum User
Full Member
Registered: 07/06/02
Posts: 324
Trying to use different styles for different blocks... I just want a particular block to stand out more than others.

An example can be seen here: www.geeklook.com with the theme tester block.
-- destr0yr
"I love deadlines. I like the whooshing sound they make as they fly by." -- Douglas Adams
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Assuming this was supposed to be a question - you can override the default block templates.

bye, Dirk
 Quote

Status: offline

destr0yr

Forum User
Full Member
Registered: 07/06/02
Posts: 324
Quote by Dirk: Assuming this was supposed to be a question

Question

Neutral i feel like a no talent luser.

-- destr0yr
"I love deadlines. I like the whooshing sound they make as they fly by." -- Douglas Adams
 Quote

Status: offline

Blaine

Forum User
Moderator
Registered: 07/16/02
Posts: 1232
Location:Canada
magical
It is possible to give any defined block a unique look. This is one feature that can be accomplished by the functions.php file located in your theme directory.

Look at the theme clean for example that uses logic in the functions.php to apply a different block treatment for the left and right blocks.

This is how it works:

In the lib-common.php function COM_getBlockTemplate, a check is done:
Text Formatted Code

 if( !empty( $_BLOCK_TEMPLATE[$blockname] ))

 


You can see that the actual blockname is used in the variable name so it's unique for every defined block. This variable could then be defined anywhere, but we have functions.php in the theme directory so it woujld be theme specific.

An example: if in the theme functions.php you set this variable for a block. You would have a unique look for just this one block - the admin block.
Text Formatted Code

$_BLOCK_TEMPLATE['admin_block'] = 'blockheader-adminblock.thtml,blockfooter-adminblock.thtml';

 

Geeklog components by PortalParts -- www.portalparts.com
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Quote by destr0yr: Neutral i feel like a no talent luser.

Sorry about the snide remark. After reading your post, I wasn't sure whether you had a question or wanted to show us something. The absence of a question mark didn't make it any clearer ...

bye, Dirk Oops!
 Quote

Status: offline

destr0yr

Forum User
Full Member
Registered: 07/06/02
Posts: 324
Quote by Dirk:
Sorry about the snide remark.

Don't worry about it. You and Blaine have helped me in the past more times than I can count. Reason I felt like a `luser' is 'cuz I do technical support (for Internet/Email with customers that have no clue what they are doing) and when people aren't clear and concise I get thoroughly annoyed. Neutral Some of the questions people ask you on here makes me laugh... My question above made me laugh at myself.

Anyways, thank you to both of you. Cool
-- destr0yr
"I love deadlines. I like the whooshing sound they make as they fly by." -- Douglas Adams
 Quote

Status: offline

lestat

Forum User
Chatty
Registered: 11/15/03
Posts: 64
Hello,

From below, Blaine explains how to use different block template and I got that, but what I can't find or figure out is how to change 'other' blocks. For example, I have a form using a static pages block. Is there a way to find out how to change the static page blocks? Or what about the Topic Manager or the User Manager? Thanks.

Quote by Blaine: It is possible to give any defined block a unique look. This is one feature that can be accomplished by the functions.php file located in your theme directory.

Look at the theme clean for example that uses logic in the functions.php to apply a different block treatment for the left and right blocks.

This is how it works:

In the lib-common.php function COM_getBlockTemplate, a check is done:
Text Formatted Code

 if( !empty( $_BLOCK_TEMPLATE[$blockname] ))


 


You can see that the actual blockname is used in the variable name so it's unique for every defined block. This variable could then be defined anywhere, but we have functions.php in the theme directory so it woujld be theme specific.

An example: if in the theme functions.php you set this variable for a block. You would have a unique look for just this one block - the admin block.
Text Formatted Code

$_BLOCK_TEMPLATE['admin_block'] = 'blockheader-adminblock.thtml,blockfooter-adminblock.thtml';


 
 Quote

All times are EST. The time is now 11:11 pm.

  • 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