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

Geeklog Forums

Block No titlebar?


Status: offline

cyclops

Forum User
Newbie
Registered: 01/19/05
Posts: 2
curious
First off, awsome stuff people, keep it up.

My questions: is it possible to create a left or right side block w/out a block titlebar? I don't want to get rid of all block titlebars but just have the option to display a titlebar or not, like the staticpages options have...
 Quote

tokyoahead

Anonymous
There is no standard function for this. For non standard:

You have to think about the fact that all blocks are created form a list. They also use the same template (right and left one s have different).

So now if you want to have one different, the program making the blocks would need to know why it should treat one differrently from the others and what template to use in this case.

So first of all you wouldh have to make a distinction, such as a special carachter/word in the block title. Then you could write a new template for this which does not include the Bar on top of the block, and edit the PHP of the block-making function to differ depending on the trigger which template to use.

And dont forget to do all that again when you upgrade geeklog to a later version ;-)
 Quote

Status: Banned

machinari

Forum User
Full Member
Registered: 03/22/04
Posts: 1512
acatually, I believe you can specify particular template files for particular blocks according to the block's ID. This does actually work amazingly well. You can change the look totally from the rest of the blocks even to the inclusion or not of the title and bar or whatever.

This is accomplished in the relevant theme's functions.php in which you should find these instructions:
Text Formatted Code
// +---------------------------------------------------------------------------+
// | CHANGE THE LOOK OF A PARTICULAR BLOCK ON THE LEFT OR RIGHT                |
// +---------------------------------------------------------------------------+
// The following are working samples.  If you find that you need 1 particular block to
// stand out from the rest of your blocks, either on the left or right side, then simply
// alter either of the following files, "blockheader-left.thtml or blockheader-right.thtml"
// to suit your needs.  Then, come back here, uncomment the block you want to change (this is
// by no means the entire listing of block names), and then reload your site.  Your altered
// look is now applied to that singular block (or blocks).

//$_BLOCK_TEMPLATE['whosonline_block'] = 'blockheader-right.thtml,blockfooter-right.thtml';
//$_BLOCK_TEMPLATE['first_block'] = 'blockheader-right.thtml,blockfooter-right.thtml';
//$_BLOCK_TEMPLATE['whats_new_block'] = 'blockheader-right.thtml,blockfooter-right.thtml';
//$_BLOCK_TEMPLATE['poll_block'] = 'blockheader-right.thtml,blockfooter-right.thtml';

 
 Quote

Status: offline

cyclops

Forum User
Newbie
Registered: 01/19/05
Posts: 2
Thanks machinari, worked like a charm....
 Quote

Status: offline

zap

Forum User
Newbie
Registered: 01/29/05
Posts: 3
I also had this problem and initially I've hacked admin/block.php so that it will accept empty block title, but I didn't like this solution because after an eventual upgrade I'll have to redo all such hacks. So I'll redo it with templates, it looks cleaner.

But I think if there is any reason to prevent blocks with an empty title? Why not change the mainstream geeklog to accept empty titles?
 Quote

Status: offline

beewee

Forum User
Full Member
Registered: 08/05/03
Posts: 969
Location:The Netherlands, where else?
It might be difficult having several nameless blocks...
Dutch Geeklog sites about camping/hiking:
www.kampeerzaken.nl | www.campersite.nl | www.caravans.nl | www.caravans.net
 Quote

tokyoahead

Anonymous
maybe its easier after all to have a switch so it simply does not display the title
 Quote

Status: Banned

machinari

Forum User
Full Member
Registered: 03/22/04
Posts: 1512
I have to disagree. IMHO, to disable/enable the title bar your script would have to contain about 4 or 6 lines of HTML (not just the variable but the bars and hr's and/or image borders, depending upon your theme--an entire table row, etc.) and how then do you accomodate different types of themes where the blocks are designed differently (without tables for example)? This is actually what your template files are intended to accomplish.

It shouldn't be difficult to comment out or delete the title bar from your block template files. ..Or, if you only want it out of some, create a new template file for that style of block and call it (as my post above) for every block you don't want titles for.

On the other hand...
one solution would be to break apart the regular template file for blockheader and use a, e.g., blocktitle.thtml and blockheader.thtml. then, making the title an option would include/or not this template file.

Just my two cents
 Quote

Status: offline

beewee

Forum User
Full Member
Registered: 08/05/03
Posts: 969
Location:The Netherlands, where else?
Hey, this is a nice option, for a new project I'm making some block templates in red, blue etc, so I can choose the color of the block if I change the name, and also a titlebar-less template..
Dutch Geeklog sites about camping/hiking:
www.kampeerzaken.nl | www.campersite.nl | www.caravans.nl | www.caravans.net
 Quote

Status: offline

beewee

Forum User
Full Member
Registered: 08/05/03
Posts: 969
Location:The Netherlands, where else?
Well, I've uploaded the testsite, would anyone be so kind to see if it also looks OK on a Mac with Safari, or supply me with a screenshot from Mac/Safari?

iCapture is down I'm afraid. Here's the URL: http://www.boekburo.nl/. The URL of a screrenshot of the original layout concept is here: http://www.beeweb.nl/projects/bb/voorstel2.gif

Many thanks in advance!
Dutch Geeklog sites about camping/hiking:
www.kampeerzaken.nl | www.campersite.nl | www.caravans.nl | www.caravans.net
 Quote

Status: offline

drshakagee

Forum User
Full Member
Registered: 10/01/03
Posts: 231
here ya go
Yes I am mental.
 Quote

Status: offline

beewee

Forum User
Full Member
Registered: 08/05/03
Posts: 969
Location:The Netherlands, where else?
Hey, great, thanx, glad to see that the shadows didn't break. Its a deal - shaking hands

As you see it's very easy to make several templates for the sideblocks. In this case my client can (re)name theblock-id red/yellow/blue/empty. I'm also making some special ones for Xmas, Eastern etc.
Dutch Geeklog sites about camping/hiking:
www.kampeerzaken.nl | www.campersite.nl | www.caravans.nl | www.caravans.net
 Quote

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