Jump to content

Putting a span into the LI for Drupal


elementalgrace

Recommended Posts

Hello,I recently installed Drupal as a CMS and am in the process of skinning the gallery module. The individual photos are displayed as an unordered list and I have managed to style them more or less the way I want with one exception. I want the content of each list item to be vertically aligned to the bottom of each list item but the vertical-align property does not apply to block level elements such as list items apparently. So to achieve this, I need to insert an inline element such as a span inside the li. I have managed to play about with some of the PHP in regard to other design issues to achieve what I want but my grasp of the subject is rudimentary at best and no matter what I try I can't get the span to display inside the li. I can get it outside the li without many problems though (!) ... Anyway I was rather hoping that if I posted the code, someone might be able to give me a bit of guidance as to how to achieve it.PHP

  if (!empty($images)) {    $content .= '<ul class="images">';    foreach ($images as $image) {      $content .= theme('image_gallery_img', $image, $size);    }$content .= "</ul>\n";  }

The Code The PHP Generates

<ul class="images"><li><a href="/drupal-5.3/?q=node/45"><img src="http://192.168.1.20/drupal-5.3/files/images/IMG_1274.thumbnail.JPG" alt="in heaven there is no beer" title="in heaven there is no beer"  class="image image-thumbnail " width="90" height="68" /></a><b class="imgbox"><a href="/drupal-5.3/?q=node/45">in heaven there is no beer</a></b><div class="author">Posted by: <a href="/drupal-5.3/?q=user/1" title="View user profile.">admin</a></div></li></ul>

The Code I want to achieve

<ul class="images"><li><span class="imglist"><a href="/drupal-5.3/?q=node/45"><img src="http://192.168.1.20/drupal-5.3/files/images/IMG_1274.thumbnail.JPG" alt="in heaven there is no beer" title="in heaven there is no beer"  class="image image-thumbnail " width="90" height="68" /></a><b class="imgbox"><a href="/drupal-5.3/?q=node/45">in heaven there is no beer</a></b><div class="author">Posted by: <a href="/drupal-5.3/?q=user/1" title="View user profile.">admin</a></div></span></li></ul>

Thanks

Link to comment
Share on other sites

You'll have to find the definition for the theme() function and modify it. Don't forget to look in included files too.

Link to comment
Share on other sites

You'll have to find the definition for the theme() function and modify it. Don't forget to look in included files too.
I can find that but I don't know how to modify it - that's what I was asking for help with! When I try adding in the span class it appears outside the LI rather than inside it and I don't know enough PHP to force it to do what I want it to.
Link to comment
Share on other sites

Thanks for the offer - didn't see it 'til now :) After much head scratching and burning out my internal swear filter I worked out that I was actually looking at the wrong bit of code and there was a separate bit that controlled the li and the content within the li. What a dummy, eh?Thanks again...

Link to comment
Share on other sites

Lol correct! The inline bit you posted controls the content outside the LI, but the theme() function defines the list-item markup displayed.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...