This forum is for assistance with theme development.

Hack to prevent display of Title in Block

I've been messing around with applying different CSS styles to blocks and found out quickly that you can't really style the titles of a block much because the titles don't hold much text. When designing a block, I have to split it into two parts, a poorly styled title, and a content area that can be very highly customized. I'm also stuck with a fixed gap between the two.

It seemed to me that if I could have the ability to optionally NOT display the title, then I could have more control over the look of my block using CSS. I tried not entering a title, but that was forbidden. I decided that I should create a code and place it at the front of my title. If the theme engine spotted the code, it would not emit the title. I decided that the code had to be reasonably unique, and settled on !!invisible!!

I managed to achieve my goal by replacing the line (in xtemplate.engine):
$xtemplate->template->assign($key == "subject" ? "title" : $key, $value); // TODO: standardize on 'title' (ie. rename all $block["subject"] to "title")

with:

$xtemplate->template->assign($key == "subject" ? "title" : $key, (substr($value, 0, 13) == "!!invisible!!" ? "" : $value)); // TODO: standardize on 'title' (ie. rename all $block["subject"] to "title")

Once that's done, any titles that start with !!invisible!! will not be displayed. That let me make blocks which were one text line in height, and others which had elaborately styled titling. Maybe someone else might be interested in this hack.

Custom theme that uses javascript menus to display blocks

I wanted to create my own blog but couldn't really get the usual themes (Marvin, xtemplate) to look how I wanted them to. So I wrote a new theme that creates javascript menus out of the blocks. This theme is being used at www.joepilot.net. It includes the .theme file, menu.js (powers the menus), layout.css (sets the layout), and style.css (sets colors, borders, etc). This also includes any images I use on my site, obviously, you can change them however you wish.

XTemplate and a JavaScript menu

Hi,

I am trying to replace the normal links in this theme wit a JavaScript based menu. No luck yet. Anyone who can help me out? Where do I have to put this lines:

script language="Javascript" type="text/javascript" src="javascript/menuitems.js">

script language="Javascript" type="text/javascript" src="javascript/menuprogr.js">

I removed the first < because otherwise this website won't accept it. Even with the it did not work. So both lines has indeed a < in front.

Can I Override Block Styles Based On Block Content?

I would like to try to accomplish something, but I haven't figured out exactly what approach to take using Drupal. I realize that blocks can have CSS which is conditional on their module-delta, and on their module, but what I'd like to be able to do is create the ability to style a block from a pre-arranged style, without having to go into the CSS every time I create a new block.

How to make primary and secondary links translated by locale.module

Probably I'm doing something wrong, bu I can't find a way to make primary and secondary links translated by locale.module.
Is there a way in configurazion settings to specify the text of a link in the fomr t("text") so that it will be translatred by locale.module ??
I would like to do it without any hack to modules...
thanks a lot
Matteo

PHPtemplate and Drupal 4.5

Hi all,
Is PHPTemplate theme compatible with 4.5 ?? Where can I download a 4.5-ready version ??
I'm downloading Drupal CVS to my pc, but I could not find it....
thanks a lot
Matteo

Pages

Subscribe with RSS Subscribe to RSS - Theme development