Implement hook_theme() to enalbe users to provide a template for each of the cck_blocks

Earl Grey - May 10, 2009 - 12:29
Project:CCK Blocks
Version:6.x-1.x-dev
Component:Code
Category:task
Priority:critical
Assigned:Earl Grey
Status:closed
Description

For fields, displayed at the end of a node, there is a template shipped together with CCK. As described in #305564: CCK Blocks does not leverage CCK's templates, fields with multiple values are not displayed correctly in a block. All the values are displayed in one line, as there is no theme/template applied to the values, but they are only printed to the block, each themed individually.

I have no clue, how to implement theming functions in a module, so this is just a thread for collecting information about this topic.

In the end, we want theme developers to be enabled to provide a theme for each of the cck_blocks.

For example, imagine a node, displaying information about a book and you want to have a block, containing links to some book stores, to directly buy the book there. If the field for the links is called "book_links", the id of the corresponding block is "block-cck_blocks-field_book_links".

Theme developers should be able to provide a file named "cck-blocks-field-book-link.tpl.php", where they have access to all data of this field.

The themed field is then inserted in the block, that can be themed itself, but already containing the correctly themed field content.

This is important, as multiple values of a field are displayed in one line at the moment.

#1

Earl Grey - May 10, 2009 - 12:29
Title:IMplement hook_theme() to enalbe users to provide a template for each of the cck_blocks» Implement hook_theme() to enalbe users to provide a template for each of the cck_blocks

#2

Earl Grey - October 28, 2009 - 09:11
Status:active» fixed

#3

System Message - November 11, 2009 - 09:20
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.