This forum is for assistance with theme development.

template.php

If I have to theme just this from page.tpl.php print theme('links', $secondary_links) , what is the right approach? I don't want to hack menu.inc/common.inc as some solutions.

Of course I could break up the creation of secondary_links in page.tpl.php itself, but I want to override the appropriate function. I just don't know what function.

I suppose the file would be template.php. What would the function name be? Or do I have to create a file bluemarine_? Why do we use one over the other? This always confuses me!

Detect user logged in

I have a block of links, one of which is "Log In". I wish to change this to "Log Out" once the user, any user, is logged in. The easiest way I know to do this is to just have a little php code:


if (userLoggedIn) echo "Log_Out_link";
else echo "Log_In_Link";

Does such snippet of code exist? I tried searching the site but came up empty handed.

If there is a better way to do this, I would also like to know, but this way suits me just fine.

How to make a DropDownlist, the Drupal way?

I've made a module that displays every month with content, clicking on each month gives all the content of that month (works OK). Now I want a dropdownlist above that filled with every year with content. picture (via ImageShack) (I added the red border later for clarity).

The code I've made is ():

  $select_elements = array('#size' => "", '#title' => "years", '#name' => "", '#value' => $selected_values,
		   '#id' => "mydropdown", '#attributes' => "", '#options' => $select_options,  /* i.e. an array of [$year] = $year */
		   '#description' => "description", '#multiple' => FALSE, '#required' => FALSE);
 /* --- */ 
  $themed_dropdown_html = theme_select($select_elements);  /* theme_select is described in form.inc */
  $output .= $themed_dropdown_html;  /* $output is added to the rest of the HTML to build the block */

It generates the HTML all right but I get warnings on the page:

* warning: implode() [function.implode]: Bad arguments. in C:\Program Files\xampp\htdocs\drupal-4.7.2\includes\form.inc on line 292.
* warning: implode() [function.implode]: Bad arguments. in C:\Program Files\xampp\htdocs\drupal-4.7.2\includes\form.inc on line 292.

Apart from those warnings it somehow feels like this is not 'the proper way' to do it.

  • Am I using the right approach? How should it be done?

acidfree custom block

I would like to display some images/videos managed using acidfree in a block on the left side.

So far I have

hr under some elements

When I use:

print $sidebar_right

Or similar statements (left sidebar, header, etc), I get what seems to be an hr underlining it. While this may be nice in some situtaions, it destroys the flow of my site in other places. Is there a way I can stop this from appearing?

If it isn't a setting, but instead hard coded into drupal, I'm willing to change it to fix the problem. I have a few years of php/mysql experience, as well as css. I just can't seem to find out where it's coming from.

Template to theme

Ok i'm new to drupal, new to php, fairly new to css. I have tons of programming expierence, mostly in VB.NET/ASP... So i made a page layout in Photoshop, then sliced it up all nice in Image Ready and have the HTML to display the pictures where I want them. My question/problem is that I dont know what I need to change to have drupal display my header images instead of a single logo and my nav images instead of the primary links. I've been scouring the php/css and i found where the background images are set.

Pages

Subscribe with RSS Subscribe to RSS - Theme development