Posted by fax8 on March 14, 2006 at 8:27am
11 followers
| Project: | Drupal core |
| Version: | 6.x-dev |
| Component: | forum.module |
| Category: | feature request |
| Priority: | normal |
| Assigned: | dvessel |
| Status: | closed (fixed) |
Issue Summary
I propose to change line 891 in function theme_forum_list
<?php
$rows[] = array(array('data' => $description, 'class' => 'container', 'colspan' => '4'));
?>to
<?php
$rows[] = array(array('data' => $description, 'class' => 'container container-' . $forum->tid, 'colspan' => '4'));
?>This will let themers to theme each different forum container differently.
Note that this is possible overriding default theme function and writing a phpthemplate theme.
But a solution of this type is similar to what is already available for blocks. And it is smart.
Fabio
Comments
#1
Reassigning this to cvs, since 4.6.x doesn't get new features.
That said, it sounds like a good addition once the feature-freeze for 4.7 ends. (Meaning "someone will be with you shortly" :-) )
#2
Or maybe not so shortly. Is this still an issue?
#3
Yes.. the code is not changed.. and I think this feature is still useful.
The attached patch add the code I described in my first post.
This will make possible to associate different css rules to each forum container
on the forum listing page.
Please note that this patch only make it possible to style forum containers,
not forums on the forum listing page. It could be also useful adding a similar feature
for also forums.
A similar approach could be useful also on the topic listing page.
#4
The attached patch make containers, forum and forum listing tables css themable.
#5
You should not use classes for things which are known to be unique.
#6
#7
This patch makes them IDs.
#8
This one for new forum template files. Doesn't add id to table, as term id for it is unknown. Don't want to dig much into template variables.
#9
+1. I think this should go in. Adding a unique ID to the containers increases the power of the themer for very little cost.
#10
Actually, topic id "$tid" is available in both forum-topic-list.tpl.php and forum-list.tpl.php. Why not apply it to both?
#11
Looking at this again, the $tid was clashing with the existing $tid variable. $tid is already supplied and it can be applied to the whole table.
Here it is again with an id added to the table and each *row*. Working off cells is less flexible.
forum-topic-list.tpl.php contains an id of "forum-topic-*" for the table.
forum-topic.tpl.php caintains "forum-*" for the whole table and "forum-list-*" for each table row.
Latest HEAD had some changes since yesterday.
#12
Is this good or not? Looks RTBC in my opinion. :)
#13
re-reolled..
#14
Great feature
#15
+1
This greatly simplifies the theming of a specific forum.
#16
I'm OK with this patch, but I was wondering what $cid stands for. Do we use $cid because $tid is taken?
Also, I'm not sure the PHPdoc is accessible for non-developers:
<?php- $tid: Taxonomy term ID for the current forum. Parent to all items within
+ * the $forums array.
?>
To understand this, you need to understand how the forum module is implemented, and how it leverages the taxonomy system. It think we can make this more accessible for designers by explaining this differently. Let's explain this in "forum terms" rather than "taxonomy terms", so to speak.
Otherwise this patch looks like something that we'll want to commit.
#17
Okay Dries, your right. I always miss these things. :-)
#18
Patch works as advertised.
Small detail: is it by purpose that "id" is capitalized in .tpl.php files and is lowercase elsewhere? If yes, then this is RTBC.
#19
Yeah, not sure why I did that. here it is removed.
#20
RTBC
#21
Did you mean forum_id instead if tid? In the template.
#22
Darnit! I needs glasses.
#23
Oops. I missed that.
I'm also unsetting $variables['tid'], to prevent confusion about what that could be.
#24
That works too. :)
#25
Great, I see Dries only asked for this clarification in the variable name and docs, and otherwise he was fine with the patch, so committed.
#26