This forum is for assistance with theme development.

Selective collapse

Here is something you can use if you want to have you Drupal fieldsets collapsed in some context, but not in others.

In this example, we want normal users to have uncollapsed fieldsets (because they have only one, categories, and you may as well not force them to click on it), and administrators (who have many fieldsets) to have them collapsed.

1. In your page.tpl.php (or equivalent if you are not using phpTemplate) :

/* Assume you have a variable $is_logged which is true when a user is logged, and a variable
   $is_admin which is true when a user is the administrator */
<head>
  <title><?php print $head_title ?></title>
  <?php print $head ?>
  <?php print $styles ?>
  <? if ($is_logged && !$is_admin) { ?>
    <script type="text/javascript" src="/themes/mytheme/js/uncollapse.js"></script>
  <? } ?>
</head>
[...]

2. This is uncollapse.js :

if (isJsEnabled()) {
  addLoadEvent(uncollapse);
}
function uncollapse() {
  var fieldsets = document.getElementsByTagName('fieldset');
  for (var i = 0; fieldset = fieldsets[i]; i++) {
    if (!hasClass(fieldset, 'collapsible')) continue;
    if (hasClass(fieldset, 'collapsed')) {
      removeClass(fieldset, 'collapsed');
    }
  }
}

Their may be a better way (rather than let drupal collapse the elements, and uncollapse them afterwards), but I could not see it.

creating theme for those who don't know PHP

Hello! I want to make the design of my site (bruceinfo.nm.ru) the theme in Drupal. The design is very simple: black colour for background, Verdana 12 for texts. Arial 10 for links, Arial 25 for section names. I don’t know PHP and know only basic things in CSS, how to do what I want?

Event formatting using SpreadFirefox's module.css

I am trying to implement the very nice looking event/calendar theme used by SpreadFirefox's theme. Unfortunately, I'm having some trouble. I have tried enforcing the theme in both a modules.css file and by replacing the event.css file in the event module directory. Both efforts have resulted in similar anomolies.

In order to get the styling to work at all, I replaced ".sidebar .event-calendar" with #block-event-0 .event-calendar" in order to get the output to my theme. This seems to do a fair job on the little mini-calendar.

How to have a logo diplay on simplex theme?

Hi

i want to know how can i have a custome logo displayed on top in simplex theme
coz i dont like the one that comes with the theme which is just simple words and nothing else

can some one help me with this

Thanks

How do I override a module's stylesheet in my theme?

Hi, first let me introduce myself and say hello, as this is my first time using Drupal. I am a freelance web designer/developer who has been using Xaraya almost exclusively for my CMS needs. I have tried Drupal on a couple of occasions and found it didn't quite suit my purposes, but with the release of Drupal 4.7 I feel it is time to get to know this CMS and so far I've found it to be excellent. In a short space of time I have created a working site with features I would normally have had to implement in a more laborious fashion.

Hacking Bluemarine; help needed with calendar block.

Hi. I'm experimenting with hacking the BlueMarine CSS stylesheet, to give it a more personal and fresh look. I'm a CSS noob, but I understand basic html and can handle a colorpicker.

The problem:

Black borders next to "day blank" TD's in calendar block.

Sample:

http://kf.oldrup.eu/

The code (the calendar part of the stylesheet):

Pages

Subscribe with RSS Subscribe to RSS - Theme development