[themes] themes Digest, Vol 50, Issue 13
Darren Douglas Lee
darrendouglas.lee at gmail.com
Fri Feb 18 22:27:32 UTC 2011
Micheal,
I've found that often those new to theming in Drupal struggle with volumn of
classes and IDs present in many of the Drupal themes. Please note that like
all things Drupal this can be modified to your liking. If you're willing to
dig deep enough and do the necessary overrides (hooks/preprocess) then the
theme output can be tailored, including the removal of many of the element
classes and IDs.
For your reference,
<li class="menu-114"> is generated by the core menu module. The "114" is the
ID number of the menu entry specific to this tag. You can get this info by
looking at the number in the URL of the edit form for the specific menu
entry. You will not find CSS entries to this item by default but is included
in the markup so that you can add css entries specific to the menu item if
desired.
Consider calling theme('links__mylinks', ...); in your tpl file.
Then in your template php you can have your override function called
theme_links__mylinks($vars)
if there is no mytheme_links__mylinks function in your theme, it will
fallback to mytheme_links, or default theme_links
Do a THEME_preprocess_HOOK($vars) function
function mytheme_preprocess_links__mylinks(&$vars) {
print_r($vars);exit;
}
This should get you started in gaining control over the markup output for
the menu entries.
As for links.css?lgkgm7, is your question about the "?lgkgm7"? If so I
suspect that it's simply a random value added to the end of the path to the
links.css file to prevent caching of the file.
Of course this is all just one persons perspective on your questions. Other
might provide better or different input.
D.
> Message: 1
> Date: Fri, 18 Feb 2011 14:54:10 +0800
> From: Michael Donahue <vbplusme at gmail.com>
> Subject: [themes] CSS questions I don't seem to be able to find on
> Drupal.org...
> To: themes at drupal.org
> Message-ID:
> <AANLkTikqsCmXe077sEcj9Wdq1d6pOoJz0SuD+Nb3NC08 at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hello and greetings,
>
> I am trying to understand the internals of themes and have run into a few
> questions that seem to be related. I was hoping to find some enlightenment
> from the list. TIA for any replies.
>
> I found references to several classes that I can not find in any .css files
> on the order of: <li class="menu-114">. While I was trying to find the
> .css
> file that contained these class definitions, I notice that in the page
> source, in the marinelli theme for example, many calls to css file that
> have
> references attached to them, i.e. links.css?lgkgm7. Can someone explain
> what
> this means? I think the menu-xxx classes are being generated dynamically
> but
> I do not understand where that is happening and it appears to be
> inconsistent whether it is defined as a class or as an id in the page code
> dumps that I have examined.
>
> Appreciate your attention,
>
> Kindest regards, Michael
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/themes/attachments/20110218/ae80746f/attachment.html
More information about the themes
mailing list