Integrate token module for cck_blocks block titles

VDMi.Frans - September 23, 2009 - 08:28
Project:CCK Blocks
Version:6.x-1.x-dev
Component:User interface
Category:feature request
Priority:normal
Assigned:Earl Grey
Status:active
Description

Hi,
I decided to write my own module because this project lacks imho a critical widget.

The code is attached.
It makes a CCK widget available that holds a title and a (formatted) text area. Those CCK fields are then exposed as block.
Of course a textarea is possible with CCK Blocks, but not the combination of title and textarea.

There is still some work to be done on this module. The formatting is hardcoded and i didn't found the time to disable the number of fields (and fix it to 1 per instance). But i think it is a good first start to add such a widget.

Let me know what you think.

AttachmentSize
cck_custom_block.zip2.63 KB

#1

Earl Grey - October 27, 2009 - 12:34
Title:Add a CCK widget with title and textarea» Integrate token module for cck_blocks block titles
Assigned to:Anonymous» Earl Grey

I'd rather prefer to integrate the token module. With that module, you can use any field value as title for any oder field, displayed as block.

#2

Earl Grey - October 27, 2009 - 14:56
Status:active» needs review

Please review my patch. This patch also includes the sollution for #316166: Translation of block subject missing.

With this patch, the token help is displayed at the bottom of the title form for the block, if the token module is installed. If a token is used for the node title, that token is evaluated, thenever the block is displayed.

AttachmentSize
cck-blocks-integratetokenmodule-DEV-585372-2.patch 4.45 KB

#3

Earl Grey - October 27, 2009 - 22:13

To make testing easier, this patch is contained in tomorrows -dev release.

#4

VDMi.Frans - October 31, 2009 - 10:41

It is a great idea to integrate the token module and it works fine.
While building blocks with tokens is great (and very useful), I feel that it is very similar to building blocks with Views. Views is probably even easier to maintain and understand for site-admins.

So I still think that a CCK field widget with title and body makes it much easier and straightforward. It is more a KISS approach.

#5

Earl Grey - October 31, 2009 - 11:50

Well, as far as I understand views, they are node independent, while cck blocks depends on the field values of the node, that is currently displayed. I took a quick look at views block displey and I found only a way to define one title for a block, that is independent of the node content, too, but I'm very interested in your opinion and I'd like to understand, where you see that similarity.

Regarding your widget, I think, that it provides a small subset of what is possible with cck blocks. You're completely right, that this is much easier to understand and yet more simpel to use. Have you tried to release your module on the drupal website? As I see only a very small overlapping between your module and cck blocks, I think there should be enough users, that are happy with your module, when they don't need the flexibility and complexity of cck blocks.

#6

VDMi.Frans - October 31, 2009 - 18:12

You are right about Views, i now realise that a block view is a lot harder to configure then a token in a cck block. To make a View node related, one must play with the arguments settings first. To change the title, you must also use tokens and override some functions... So this all requires a lot more configuration an knowledge.. Which is great if you have the time but it sure is not KISS.

I wanted to release it as a separate module, but since it is indeed a small subset of cck blocks, i feel it is better to have it integrated into cck blocks. I think it makes your module more complete. I feel that the place for my module is cck blocks. plz let me know if you want to integrated it.

#7

Earl Grey - November 1, 2009 - 21:22

I'm not convinced, yet. Why do you think, we need a special text-with-title-block, but we do not need a image-with-title-block? Or why no link-with-title-block? Would it be possible, to release a cck field 'text with title'? That would be easy to integrate as block, or it doesn't need a special integration at all. You could use this field as block with just activating the block and changing it's title to ''.

Don't get me wrong: I don't want to make your idea bad, but I'd like to get convinced for that idea. It's funny, but I realized, that I recently built a website where I needet the exact functionallity of your module, but I modified cck_blocks instead of building a complete new module. Now, that token is integrated, I can discard the modified version.

Please get back on this. I think, it's an interesting discussion.

#8

Earl Grey - November 1, 2009 - 21:33

Have you compared cck blocks, your module and http://drupal.org/project/sidecontent? I don't know the latter, yet, but it sound's interesting and similar to our approach.

#9

VDMi.Frans - November 5, 2009 - 23:10

I totally agree with you that token based title is a great feature.

I see the widget with textarea and title as the mother of all types that are possible. In a wysiwyg field you can add images and or links by hand. Tokens give you the power for other fieldtypes.

I think that it is nice to have a basic widget and the power of tokens for other configurations. The textarea widget is not a perfect solution, it just makes it easy for basic stuff.

I will investigate sidecontent this weekend, it seems not to be cck based, and thus not very flexibel. Btw i missed it on my search for similar functionality... sidebar sounds so wp-ish

#10

Earl Grey - November 6, 2009 - 17:33
Status:needs review» active

Have you thought about releasing your CCK field type as a seperate module? If you do, we could check how it works together with cck blocks. You don't need to provide block functionality and we don't need to ship our own field type. This keeps the idee of drupal modules up. To me, it's like playing puzzle and that's why I like it. Every module does it's work, not too much, not too little. Should be a piece of cake to shrink your module to only provide the field type and the theming options for that. Then, let cck blocks do the rest for you.

#11

VDMi.Frans - November 8, 2009 - 15:23

Doesnt that take the simplicity out of it?
How will CCK Blocks assign the block title then? via a token probably? Then we are back at square 1....

Dunno, maybe it is better to make it a separate module as the KISS approach and let cck_blocks do the more advanced stuff?

 
 

Drupal is a registered trademark of Dries Buytaert.