Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
There currently is *no* way to theme a term link. Thats not good [tm].
Because I think this is not just a simple featurem, but required for good themeing (note that even "silly-er" functions have extremely complex theme functions) I categorise it as a Bug and not a task or a feature!
This patch allows themes to override the term-links by themeing a very simple function.
Comment | File | Size | Author |
---|---|---|---|
drupal_84 | 1.28 KB | Bèr Kessels |
Comments
Comment #1
moshe weitzman CreditAttribution: moshe weitzman commentedwhy would someone want to theme a term link? how is this different from links to users or links to nodes.
Comment #2
Bèr Kessels CreditAttribution: Bèr Kessels commentedI want it for one:
and other might want fancy opportunities here:
so Yes!, i believe its areal useable issue here!
Comment #3
drummSetting status to patch.
+1 for what is here and another request:
The image and forum modules should be able to make the links go to the image and forum modules. Although this could easily fit into http://drupal.org/node/10425.
Comment #4
Eric Scouten CreditAttribution: Eric Scouten commentedI strongly agree here.
Related suggestion: I'd like it if taxonomy_menu could "hijack" the term listings so that clicking on a term caused the menus to update properly. (IOW, the term link should be to taxonomy_menu/(vid)/(tid), not to taxonomy/(tid). This may or may not fit with the patch provided here. (I didn't read the patch.)
Comment #5
moshe weitzman CreditAttribution: moshe weitzman commentedi guess folks want image and forum links to be rewritten because thos modules output their nodes using a display that differs from node/x. that is image/x looks different from node/x.
the right way to fix that is to do what we did for book.module. unify the look of image/x and node/x such that we no longer have an imagex. see how book.module accomplishes this.
i am still -1 for this patch since i see many other types of links that could be themed in this way (users, forum nodes, recipe nodes, polls, etc.). on the other hand, it is a pretty small change.
Comment #6
moshe weitzman CreditAttribution: moshe weitzman commentedi guess folks want image and forum links to be rewritten because thos modules output their nodes using a display that differs from node/x. that is image/x looks different from node/x.
the right way to fix that is to do what we did for book.module. unify the look of image/x and node/x such that we no longer have an imagex. see how book.module accomplishes this.
i am still -1 for this patch since i see many other types of links that could be themed in this way (users, forum nodes, recipe nodes, polls, etc.). on the other hand, it is a pretty small change.
Comment #7
Eric Scouten CreditAttribution: Eric Scouten commentedNo, false assumption. There is no image/x URL for displaying a single image. The issue is not how to display a single node (we all agree that node/x is correct), but how to display a list of nodes. For certain kinds of nodes, there are far better ways to do it than offered by taxonomy_render_nodes, so it makes sense to allow an override of that list display. (Note: This is straying from the original discussion. If I didn't have to leave ASAP, I'd start a new thread.)
Comment #8
Bèr Kessels CreditAttribution: Bèr Kessels commentedbringing this back to the original discussion: pass the taxonomy links trough a theme function, so that people can, for example, add icons to the links. The patch sill applies (hint,hint!)
Comment #9
moshe weitzman CreditAttribution: moshe weitzman commentedPerhaps we do this themeing not for every taxo link but rather for lists of links. In other words, do like theme_node_list() and theme_user_list(). more consistent with existing practice.
Comment #10
killes@www.drop.org CreditAttribution: killes@www.drop.org commentedWhat did the usability meeting say about this?
Comment #11
(not verified) CreditAttribution: commentedWhat did the usability meeting say about this?
Nothing. Has not been discussed there.
I personally still think that *all* HTML should pass through a theme function, and so should this listing. And no, passing it trough one of the two listing theme functions is not a good idea. Because this is not suc a list.
This is the list of terms that show up with a node. Not a list that shows up in blocks or boxes! Its useage is completely different from these listings.
Bèr
Comment #12
Bèr Kessels CreditAttribution: Bèr Kessels commentedNearly two months since the patch. If there is no need for this I will mark it won't fix.
Comment #13
Kobus CreditAttribution: Kobus commentedHi,
If you look at my site Humour Authority (www.humourauthority.com) you'll see that I have images instead of the term names as a link. This cost me to hardcode taxonomy module so that it works. It is very neat if I can theme it by means of an extra function in my theme, so I am for the principle of allowing the theming hereof. I didn't look at the patch, and can't comment on it, or even if the patch will allow what I did on HA, but still, the idea (as I see it) is not much different. I give this patch a +1.
Kobus
Comment #14
Dries CreditAttribution: Dries commentedI'm opposed to this patch. We can fix this changing the way we deal with links. (Think 'read more' link problem.)