Improve function for determining what gets the style applied

Michelle - June 16, 2009 - 04:57
Project:Advanced Forum
Version:6.x-2.x-dev
Component:Documentation
Category:task
Priority:normal
Assigned:Unassigned
Status:active
Description

These are notes to myself on my thoughts...

Functions:
advanced_forum_is_styled($type, $variables)
advanced_forum_is_styled_alter($type, $variables, $decision)

Cases:
node view (topic starting)
node add (topic starting)
node edit (topic starting)
node view (reply)
node add (reply)
node edit (reply)
comment view
comment add
comment reply
comment wrapper

For each type:
theme node?
theme replies? (comment & nodecomment)
Always? Only when in forum table? In views?

#1

scedwar - June 16, 2009 - 13:58

I'd add:

Node view when shown in a view

Node teaser when shown in a view (could be done with the standard AF style, + snip the text so that posts are all a shorter length?)

#2

juan_g - August 23, 2009 - 11:31

Related Advanced Forum issue:

More options for what gets themed as a forum post

Like the other users, I also think having more theming options would be really useful. For example, how to theme non-forum content types that are using the forum vocabulary. It seems Michelle is already considering adding those options. Thank you!

#3

crea - September 9, 2009 - 14:43

Subscribing so I get updates on this.
If you need any help implementing this, let me know

#4

Michelle - October 26, 2009 - 03:16
Component:Styles» Documentation

Ok, I've rewritten this whole section. We now have these functions:

advanced_forum_is_styled($content, $type = 'node') <-- Returns true if a given node, comment, or comment wrapper should have the AF style applied.

advanced_forum_is_styled_alter($content, $type = 'node') <-- Hook that allows other modules to make their own decision.

It seems to work fairly well from my initial testing but needs much more testing as well as documentation so I'm leaving the issue active for now.

Michelle

#5

Michelle - October 26, 2009 - 04:13

Found one thing... With the new option to style teasers, there needs to be something in there to not print the node header stuff on teasers because that looks silly.

Michelle

 
 

Drupal is a registered trademark of Dries Buytaert.