[drupal-devel] [feature] introducing theme_term_link()

Anonymous drupal-devel at drupal.org
Mon Mar 14 13:16:33 UTC 2005


Issue status update for http://drupal.org/node/12154

 Project:      Drupal
 Version:      4.5.0
 Component:    taxonomy.module
 Category:     feature requests
 Priority:     normal
 Assigned to:  Anonymous
 Reported by:  Bèr Kessels
 Updated by:   Anonymous
 Status:       patch

What 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


Anonymous



Previous comments:
------------------------------------------------------------------------

October 26, 2004 - 20:40 : Bèr Kessels

Attachment: http://drupal.org/files/issues/drupal_84 (1.28 KB)

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.


------------------------------------------------------------------------

October 26, 2004 - 22:02 : moshe weitzman

why would someone want to theme a term link? how is this different from
links to users or links to nodes.


------------------------------------------------------------------------

October 26, 2004 - 22:25 : Bèr Kessels

I want it for one:

<?php
function remixreading_term_link($term) {
  return taxonomy_image_display($term->tid)." ".l($term->name,
'taxonomy/term/'. $term->tid);
}
?>


and other might want fancy opportunities here:

<?php
function mytheme_term_link($term) {
  if(in_array($term->vid, $array_of_fancy_vocs)) {
    return '<div id=voc-'.$term->vid.'">'.l($term->name,
'taxonomy/term/'. $term->tid).'</div>;
  }
  else {
     return l($term->name, 'taxonomy/term/'. $term->tid);
  }
}
?>


so Yes!, i believe its areal useable issue here!


------------------------------------------------------------------------

October 27, 2004 - 00:12 : drumm

Setting 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.


------------------------------------------------------------------------

October 27, 2004 - 05:50 : Eric Scouten

"The image and forum modules should be able to make the links go to the
image and forum modules.
"
I 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.)


------------------------------------------------------------------------

October 27, 2004 - 12:28 : moshe weitzman

i 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.


------------------------------------------------------------------------

October 27, 2004 - 12:30 : moshe weitzman

i 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.


------------------------------------------------------------------------

October 27, 2004 - 17:39 : Eric Scouten

No, 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.)


------------------------------------------------------------------------

November 15, 2004 - 10:47 : Bèr Kessels

bringing 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!)


------------------------------------------------------------------------

November 15, 2004 - 15:24 : moshe weitzman

Perhaps 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.


------------------------------------------------------------------------

March 13, 2005 - 20:49 : killes at www.drop.org

What did the usability meeting say about this?





More information about the drupal-devel mailing list