This forum is for assistance with theme development.

Identifying modules and nodes from the body tag, my proposed solution

I am using smarty but this isn't a smarty only solution.

I've been looking for a couple weeks now for a way to give the body an id based on the module or node I was pulling up. This solution is pretty simple and I may be reinventing the wheel here. Please let me know if there's a better way to do this.

function get_body_id(){
	$q = $_GET['q'];//In my code I actually check post and query string with a function I made, but this will work also

	$body_id = str_replace('/','-', $q);

	return $body_id;
} 

In the body tag I just call the function like so: <body id="{php}echo get_body_id();{/php}" {if $node}class="node"{/if}>. Now for you non smarty users you'd use: <?php= get_body_id(); ?>. Notice that I also put a conditional statement that will identify the page as displaying a node, which helps me identify node pages from everything else.

This solution will just print out the module id for the body id or "node-1" (for example) if the page is a node. It works pretty well for most of the things I am doing but I don't know how well it would work for complicated page calls.

The beauty of id tags is that I can just ignore the tags for arbitrary pages.

Is there something out there better than this? Does drupal have something built-in? I've been looking around for a while but I haven't found anything. If there isn't they need to include that in a future release because body id's, classes are the only way to get ultimate flexibility in theming (I know bc my designer has been yelling at me ab this for days).

how to theme the comment form

Im looking to isolate and theme the contents of the comment/reply form.
Is there a function that allows this in phptemplate?? i searched the drupal site and was not able to find any documentation on how to theme this seemingly simple bit of content. anybody done this?

Looking for a good looking theme with a black background or a way to modify an existing one

I have www.revolutionmusic.net/drupal and I am trying to make it look more visually pleasing for the visitors.

Previously, I was using PHPNUke and you can see the theme (fiblack) that I had modified for it here http://www.revolutionmusic.net

I would like to make my drupal theme look more like my PHPnuke theme with the orange borders around the posts, etc.

Any help would be appreciated, I am a guitar player not a coder ;)

pager [next page] [previous page] and page numbering [1] [2] [3] ... implementation

Anyone has ideas how to implement pager -Drupal's and theme-

[next page] [previous page]

and page numbering [1] [2] [3] ...like the examples on this sites

http://www.dexigner.com/graphic/news-4.html

http://www.iht.com/articles/2006/01/09/business/wireless10.php

Stanch Theme for Drupal

After seeing so many people complain about Drupal's theme engine and it's inflexibility, I decided to try for myself and convert an existing Nucleus theme to Drupal. I used bluemarine (phptemplate version) as a baseline.

http://www.lassiter91.com/

Here's my experience:

1. Getting the basics done is pretty simple. It's easy to setup a container and set the global look and feel.

2. The problem is when I tried to theme items like navigation. I found that even ul and li styles are defined in a way not easy to change.

3. The biggest issues is when I tried to split out things like "date posted," "posted by," and "read more" (which I mentioned elsewhere.

4. I figured I would have to heavily edit the style.css but it turns out I had to edit page.tpl.php, node.tpl.php, block.tpl.php, and comment.tpl.php. That's pretty much each major theme file.

How do I get the user picture in a .theme file?

Hey all,

Just started playing around with Drupal and have a site mostly up and running. I decided to use the Slash theme posted here for the site, which looks fine for the most part, but doesn't display the user picture in nodes and comments. So I wanted to edit the code to do that, but I'm not sure how I can get the user picture for the author of the node/comment. Any help would be greatly appreciated.

miscreant

Pages

Subscribe with RSS Subscribe to RSS - Theme development