Help customizing theme_menu_item for a single menu

I've been trying to figure out how to customize a menu that is generated by the system. I currently have the menu set up as a block for the sake of simplicity, but I'd like to be able to incorporate it into the Drupal menu system.

I have set up a duplicate menu as the one I have in the block at the moment, and have been trying to configure the output of the HTML generated for the menu itself.

Rather than have the output be the default:

<li class="leaf"><a href="/page" title="Page Desc">Page title</a></li>

I'd like to have the href wrapped in a header tag, in this particular case, H2's would wrap the "a" tag. However, I DO NOT need or want this to apply to every generated menu, but only a single specific menu.

I can understand how to do this easily if I wanted to modify the theme_menu_item in my own template.php file, and apply the H2 wrapper to EVERY menu item in every menu, but I'd like to be able to reference this particular menu by ID or something similar to only theme this specific menu, and allow the normal functionality for other menus.

<?php
/**
* Generate the HTML output for a menu item and submenu.
*
* @ingroup themeable
*/
function theme_menu_item($link, $has_children, $menu = '', $in_active_trail = FALSE, $extra_class = NULL) {
$class = ($menu ? 'expanded' : ($has_children ? 'collapsed' : 'leaf'));

Drupal is up and running but how do I ...Get answers on this forum?

Hi there

I've now posted 2 questions to this forum (http://drupal.org/node/229017 and http://drupal.org/node/212383).

I've checked the tone of my writing and gone over and over the questions themselves to try and determine whether they're just too stupid for anyone to bother responding to - and at least I don't think they are???

Marking posts as Read

Hello,

On release of Drupal 6.1, I became a Drupal user and joined this forum.

Each day, when I select recent posts I get 9,000 pages of 20 posts each: 180,000 posts, some 6 years old.

I can't see a way to mark all those older posts as read, or ?

How do others use this forum?

Thanks,

Steve

Missing Weight select on Block Admin

Drupal 5.x has the weight selection. But it disappears from Drupal 6.x

Slashdot-style comments

All too often popular sites get flooded with useless comments which would be nice to hide by default from common visitors.
There are several comment moderation methods out there, but after careful examination it becomes apparent that Slashdot comment moderation system is superior to all: http://slashdot.org/moderation.shtml

I propose a module that implements Slashdot comment display/moderation system for Drupal.

Below is preliminary code for the module.
It does the following:
1. Transforms comment control toolbar (adds threshold field, removes date sorting, simplifies display modes)
2. Overrides default comment_render function from core because comment_render is neither a hook or a themeable function.
3. Adds moderation form to every comment. Moderation form is an exact copy of Slashdot moderation form.

What is lacking:
1. AJAX moderation of comments.
2. Displaying collapsed/expanded individual comments depending on the comment's rating and the user's threshold.

Todo:
1. Hook up with Karma.

Delf.

File slashcomments.info

; $Id: $
name = Slashcomments
description = Upgrades default comment system to Slashdot comment system
dependencies[] = comment
dependencies[] = votingapi
core = 6.x

File slashcomments.module

Drupal 6 and jQuery

Am I missing something obvious about using jQuery with Drupal 6?

Under Drupal 5.x, I can easily create nodes and/or blocks with jQuery calls using the method described in this post. By adding a simple drupal_add_js call to load a plugin, I can also access plugin functionallity using this method without loading up a special module (assuming you have the jQuery update module installed). For example, I can call the jCarusoelLite plugin without a supporting module by creating a PHP input-type node like:

<?php drupal_add_js('sites/all/modules/jcarousellite/jquery.jcarousellite.pack.js') ?>

<a href="#" class="prev"><</a>&nbsp;<a href="#" class="next">></a>
<div class="anyclass">
  <ul>
    <li><img src="/files/images/IMG_3585.jpg" alt="" /></li>
    <li><img src="/files/images/IMG_3586.jpg" alt="" /></li>
    <li><img src="/files/images/IMG_3587.jpg" alt="" /></li>
  </ul>
</div>

<script type="text/javascript">
$(function() {
$(".anyclass").jCarouselLite({
items: "li",
btnPrev: ".prev",
btnNext: ".next",
speed: 200,
visible: 1
});
});
</script>

Alas, none of this works for me under Drupal 6. I've looked at the code for the small number of jQuery-related modules that are compatible with Drupal 6, but I can't find an obvious clue about why this worked under Drupal 5, but not under Drupal 6.

Pages

Subscribe with RSS Subscribe to RSS - Drupal 6.x