Hello,
Is there a nice way to theme the output of the site map. I would like to be able to override the function that is spitting out the HTML.
Maybe a nice feature to have a themeable function.
I could write some nice CSS..
What you think?
chris
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | site_map_theme.patch | 4.24 KB | frjo |
Comments
Comment #1
f_p commentedHi Chris,
In order to ease theming site maps using CSS, I've modified function
_site_map_menusinsite_map.moduleas follows:instead of just
$output .= theme('box', $title, $menu_display);.This surely can be generalized throughout the module.
Cheers,
Franck
Comment #2
cbovard commentedthank you
Comment #3
bartezz commentedThanx for making the output themable!
But how can I use this? Do I make a tpl.php, and what should I call it?
Or do I have to write a function in my template.php?
Sorry for possibly a dumb question, but I can't find any documentation on theming this module.
Cheers
Comment #4
bartezz commentedHi,
I tried the following;
And it has effect, yet it only will allow you to target the title or the pre-formatted list of sitemap items. Not the items itself.
This will do for me now though. But if someone has more info on this matter and cares to share, please do :)
Cheers
Comment #5
frjo commentedcbovard solution gives you css classes like "sitemap-menu" that you can make use of in your themes css files.
I expanded on cbovard idea and added a lot of classes to the site map as well as give site map it own theme_site_map_box() function.
Please try it out and tell me what you think. If you like it I will add it to 6-dev.
Comment #6
frjo commentedI have committed patch #5 to 6-dev.
Comment #7
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #8
eff_shaped commentedbookmarking
Want to hide title (h2's) and the home page link from site map list. This thread is all I've found to help me so far.
Anyone know of further documentation...?
Comment #9
frjo commentedTake a look at theme_site_map_display() and theme_site_map_box(). Make your own versions of them in your theme and you can get the output you like.
Overriding themable output https://drupal.org/node/341628
Comment #10
eff_shaped commentedThat gives me hope, frjo. I have a few questions...
Where would I find theme_site_map_display() and theme_site_map_box()?
Are they functions?
Do I copy them into my theme.php file?
Can you give me some insight into what php would make the h2's and links not display?
thanks
Comment #11
eff_shaped commentedAnswering my own questions, after some trial and error... for the benefit of beginner themers, like myself.
I found the functions theme_site_map_display() and theme_site_map_box() in the site_map.module file (in the sitemap module folder).
Copied them into the template.php for my theme (at the bottom of the code).
Changed 'theme_' to 'mythemename_' in both cases.
REMOVING HEADINGS FROM SITEMAP
The H2 headings I wanted to hide are output by the 'theme_site_map_box()' function:
I deleted the section:
<h2 class="title">'. $title .'</h2>This gives me a sitemap with listings of the links only. Without titles like 'Primary Links' etc.
This will work for you if you don't want ANY titles over your site links on this page.
SITE MAP MESSAGE IN A DIFFERENT PLACE
In my theme (adapted from pixture_reloaded), the default message for Sitemap appears above the breadcrumbs; I want it below the Site Map heading.
Using the 'theme_site_map_display()' function, I inserted a hard coded message that will display where I want it. I leave the message blank in site map settings page.
Here's what the code looks like:
This displays the string 'THE MESSAGE' on my page where I want it. (Below the heading and above the content.)
This paragraph can be changed to anything by editing this line of the template.php file.
I'll post again, if I ever find a way to hide particular links on this page (eg. 'Home' and 'Site Map' are redundant links in my case).
Comment #12
tigron commentedI'm trying to use the information provided by eff_shaped but I'm not finding functions theme_site_map_display() and theme_site_map_box() in the site_map.module file. Is this something that changed since the last version ? I just want to remove the primary links title from the top of the site map page.