CCK Blocks does not leverage CCK's templates

himtuna - September 8, 2008 - 16:08
Project:CCK Blocks
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:David Lesieur
Status:closed
Description

Please visit this http://www.stxaviers.edu.in/teachers/lilly_abrahim
and there is one block subject, I want the teacher's subject to be displayed in different lines.
But the block shows everything in one line, without any separator.
Is there any way to add a separator b/w the cck fields?

#1

himtuna - September 9, 2008 - 11:48

close it
sol: add
after evert allowed values

#2

no2e - September 18, 2008 - 03:31

I got the same problem. Output is

<div class="content"><a href="foobar1">foobar1</a><a href="foobar2">foobar2</a><a href="foobar3">foobar3</a></div>

No spaces between the links, without any markup (list would be useful)

#3

himtuna - September 20, 2008 - 14:43

in th allowed values I added a br tag.

tyr this

<div class="content"><a href="foobar1">foobar1</a><br /><a href="foobar2">foobar2</a><a href="foobar3">foobar3</a></div>

Gamers' Den

#4

no2e - September 20, 2008 - 14:59

What do you mean? Allowed values? Where did you add it?

#5

himtuna - September 21, 2008 - 10:16

In the cck fields.

Go to
>content types
>manage fields (select your desired field)
>then at the bottom you see, allowed values.
after every allowed value I added a
tag.

____________________________________________
Gamers' Den

#6

no2e - September 21, 2008 - 21:32

@himtuna:
Hmmm, I use CCK fields with Content Taxonomy. I can't find any option "Allowed values" in the configuration of the fields.

Does it work for you for "free tagging" fields, too?

#7

himtuna - October 3, 2008 - 13:15

Sorry budy never tried with taxonomy terms. I'll see more into the matter afterwards. I got my exams, will over by friday (IST:GMT+5.30)
Till than Take Care.
Gamers' Den

#8

no2e - October 9, 2008 - 13:57

Got still this problem.

All terms are displayed in one line (without space between each one).
They should use HTML list (ul) markup.
Any idea?

#9

no2e - October 9, 2008 - 13:58
Category:support request» bug report

#10

himtuna - October 11, 2008 - 13:11

you have taxonomy terms attached to a cck fields...........................
why not you try using

http://drupal.org/project/tagadelic
http://drupal.org/project/nodecloud

because i dont think without hacking the core you'll be able to add the separator token between values.

#11

no2e - October 11, 2008 - 16:09

why not you try using [...]

Maybe I'm wrong, but: nodecloud or tagadelic don't offer the feature of CCK Blocks (do they?)

I want to display the terms wich are assigned to a single node (1.) in blocks, (2.) sorted by vocabulary.
Default Drupal behaviour is displaying all terms together mixed up in the body.

So, if a node has the terms "football" (Vocabulary: Sports) and "cats" (Vocabulary: Animals),

Drupal (default) outputs the following:

(Body:)
football, cats

With CCK Blocks I get the output:

(Block 1:)
Animals
cats

(Block 2:)
Sports
football

If I'm right, tagadelic outputs all terms (of all selected vocabularies), wheter they are tagged to a specific node or not. Or am I wrong?

because i dont think without hacking the core you'll be able to add the separator token between values.

In my opinion it should be the default behaviour of this module. I mean ... it's kind of a list (and you can style a list via CSS in whatever way you want). Semantically: outputting tagged terms is listing tagged terms. And listing in HTML is using ul.

#12

no2e - October 12, 2008 - 10:25

I was partly wrong: tagadelic offers "Tags for the current post", which lists(!) all tags assigned to the node. But it offers no deeper configuration. So all vocabularies get listed (but only those, which use "Tags" - but I got several vocabularies without tags) and each vocabulary is linked to it's tagadelic page (which is not what I always want).

So, I think CCK Blocks should be the right choice for more specific needs.

#13

himtuna - October 19, 2008 - 16:11

#14

KathyIce - November 24, 2008 - 14:03

I am using CCK Blocks with node reference... so I don't get a lot of HTML to work with. However, for this case, I managed to work around this problem by overriding the tag in my style sheet:

.block-cck_blocks .content a {
display: list-item;
}

#15

no2e - December 3, 2008 - 05:33

@#13 himtuna:
"block_class" would only let me change the CSS, and not the HTML, or am I wrong?
"blocktheme": will it allow me to change the HTML output? Didn't get it completly at the moment, will look into it.

@#14 KathyIce:
Unfortuneately, this is no solution for me, because it's the CSS only (and not the HTML markup).

#16

no2e - December 23, 2008 - 20:56
Component:Documentation» Code

bump

#17

Fanaile - April 24, 2009 - 03:39

Hi;

I'm having the same problem with links appearing all on one line (you can see here: http://the-fiction-addiction.com/book-review/21-humanizing-anne-boleyn). I cannot find anything that reads "Allowed Values" for me to edit to place the edits mentioned about.

The field is called "field_book_links" (Buy or Reserve Your Copy).

Has anyone had any luck with this yet? Thanks

#18

Earl Grey - May 4, 2009 - 18:20

I can't see links in one line, on none of the websites linked here. Please describe the problem more detailed. Styling your output is not this modules business. Maybe you can post a link, where we can see the actual problem.

#19

no2e - May 4, 2009 - 18:35

Have no online version of it (because I stopped using this module), but I got the markup described in #2, when I used Content Taxonomy.

#20

Earl Grey - May 4, 2009 - 18:52

What is the output of this field, if you display it with the main content and not with CCK blocks?

#21

Fanaile - May 9, 2009 - 23:04

@forschi;

Sorry, I had disabled the block a few days after I wrote that up; I've re-enabled the block so you can see it now.

#22

Earl Grey - May 10, 2009 - 10:23

What field type are you using for the links? Did you install an aditional module for the links?
I'm setting up a test page to reproduce this bug. At the moment, I have cck and cck_blocks installed. Do I need anything else to reproduce it?

#23

Earl Grey - May 10, 2009 - 12:47
Status:active» needs review

okay, I identified the problem in the way, items are displayed at the moment. They are only put into the nodes content, each with:

$block['content'] .= module_invoke('content', 'format', $fields[$delta], $item, $settings['formatter'], $node);

I created a patch that solves the problem (quick, but dirty). I created the task #458700: Implement hook_theme() to enalbe users to provide a template for each of the cck_blocks, so we can use theming for this purpose in the future.

Please have a look at the patch, if it solves the problem for you.

AttachmentSize
cck_blocks.module.patch 772 bytes

#24

Fanaile - May 13, 2009 - 07:55

Thanks, I'll take a look at this as soon as I can.

I'm in the middle of transferring another of my sites over to a new server, so it may take me a couple days if someone has a chance to get to it before I do.

#25

Earl Grey - May 17, 2009 - 17:54
Assigned to:Anonymous» Earl Grey

#26

David Lesieur - July 16, 2009 - 23:18
Title:CCK Block shows everything in one line» CCK Blocks does not leverage CCK's templates
Version:6.x-1.1» 6.x-1.x-dev
Assigned to:Earl Grey» David Lesieur

I was expecting CCK Blocks to use the usual field templates (for example, content-field.tpl.php and content-field-field_myfield.tpl.php), but it did not. To get a consistent output in node views and CCK Blocks, the most logical approach seems to go through drupal_render(), which will take care of the theming layer. To do so, we have to first build the $node->content array, so the next logical step is to add a new build mode for CCK.

So that is what this new patch does.

The benefits of this patch:

  • If you have themed your fields, then CCK Blocks will now output your themed result!
  • If a field is shared between multiple content types, you may now choose a different formatter for that field for each of those content types. Before this patch, CCK Blocks was limited to a single formatter per field, across all content types using that field.

To achieve this, CCK Blocks now works slightly differently:

  • The formatter is no longer selected in the block settings.
  • You choose a formatter for each field in admin/content/node-type/NODETYPE/display/cck_blocks. You may want to check "Exclude" next to each field that you don't plan to use in a block.

I'm just beginning to experiment with this patch, but so far it seems to work nicely.

AttachmentSize
cck-blocks-drupal-render-305564.patch 4.4 KB

#27

David Lesieur - July 16, 2009 - 23:32

Oops, please ignore the above patch. This is the right one.

AttachmentSize
cck-blocks-drupal-render-305564.patch 4.19 KB

#28

Earl Grey - September 15, 2009 - 22:44

Thanks David for that patch. Unfortunately, it is such an effort, to apply patches on windows, that I'm not able, to test it.

It seems, that you considered #465326: content_format() does not handle multiple values correctly, but I want to link to that here to keep all information together.

Best wishes,
forschi

#29

David Lesieur - September 16, 2009 - 20:14

@forschi: Yes, with the proposed patch above, multiple values are handled properly.

For applying patches under Windows, you might want to install Cygwin. With Cygwin, you can get a Unix shell and patch utilities; this makes patching files a breeze. There is some info here.

#30

Earl Grey - September 16, 2009 - 21:52
Status:needs review» reviewed & tested by the community

Okay, it seems to work for me, too. Thanks for that. The patch is committed to -dev.

By the way: cygwin is the worst crap I've ever seen. Didn't get it to work. Lost time. I'm now using eclipse and everything seems to be fine.

#31

Earl Grey - October 27, 2009 - 11:49
Status:reviewed & tested by the community» fixed

Fixed in -dev.

#32

System Message - November 10, 2009 - 11:50
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.