This forum is for assistance with theme development.

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.

Primary & Secondary links

I'm trying to customize my drupal site, and in the primary and secondary links it displays as:

Link1 | Link2 | Link3 | ....

I there a way I can remove the | in between each link?

problem with "echo". i know it seems quite incredible but...

...i've a problem with ECHO! O_O

look this snipped:

$categories = taxonomy_get_tree(3);
$curr = $categories[0].name;
echo $curr;

I should see the name of the first category, rit? Well...NO! i get the string "Objectname".
The dot is not interpreted as object attribute access operator, but as string concatenator

$categories[0]->name works but....im just wondering why the dot doesn't...

Pages

Subscribe with RSS Subscribe to RSS - Theme development