I don't want the location block showing up in the teaser. This implements that. A better solution would be to make this configurable by content-type.

CommentFileSizeAuthor
no_teaser.patch348 bytesbinford2k

Comments

2houseplague’s picture

That works very nicely. Thanks. The location block is represented in CCK "Manage Fields" (with a weight of 9), but is not configurable in "Display Fields". I think the answer is that it should be.

smitty’s picture

This works indeed! But wouldn’t it be preferable to do this in the theme function instead of the module? Then you can remove the teaser as well as make it look in another way, without having to change the core module. You even can include it in theme 1 and exclude it in theme 2.

In my opinion the right place for this change would be the function phptemplate_locations. To get this function copy the function theme_locations() from the location.theme into your template.php in the folder of your theme and add there the line 'if ($teaser) return $output;' before the if (count($locations)) statement.

The only problem is, that in this function the variable "$teaser" is not available. So my recommendation would be to enhance the functions theme_locations() and theme_location with the additional parameter "$teaser" to enable the separate theming of the teaser.

Or has someone a better suggestion, how to get access to the variable $teaser in the theme function?

crocodyl’s picture

Noob question: Where do I insert the code contained in this patch? I know it is in the location module directory, but from there I don't know where to put it. Also, is cutting and pasting the code into a file OK, or do I need to use the patch program from the command line. The command line is still a little bit of a hurdle for me.

smitty’s picture

You'll find an overview about patches at: http://drupal.org/patch

bdragon’s picture

Version: 5.x-1.x-dev » 6.x-3.x-dev
Status: Needs review » Fixed

Fixed at drupalcon.

bdragon’s picture

crocodyl’s picture

subscribing

crocodyl’s picture

Also, I haven't found a way to adjust the weight of the "Location(s)" in the display of the node. I am using CCK, and I can change the number of the weight, but it does not seem to actually move the "Location(s)" display in the published page.

Has this been changed in a more previous version of the module?

Anonymous’s picture

Status: Fixed » Closed (fixed)

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