Inline placement of read more link in teaser with CCK fields

rimu - August 19, 2008 - 02:38
Project:Read More link (Drupal 6 and earlier)
Version:6.x-5.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Todd Nienkerk
Status:postponed (maintainer needs more info)
Description

When a node has some CCK fields and they get shown in the teaser for that node, the CCK fields always appear below the 'read more' link. Have a look at an event on http://tt.org.nz for an example

<div class="content"><div class="event-nodeapi">
    <div title="2008-10-05T06:30:00Z" class="event-start dtstart"><label>Start: </label>5 Oct 2008 - 7:30pm</div></div>
<p><b>Money as Debt</b> Paul Grignon's 47-minute animated presentation of "Money as Debt" tells in very simple graphic terms what money is and how it is created.  Money has become the drug of our societies. Confronted with this phenomenon, citizens all over the world are inventing complementary currencies for social ends and are opening the debate: What is money for?</p>
<span class="read-more"><a href="/node/686"><strong>»  Read more</strong></a></span><div class="field field-type-text field-field-venue">
      <div class="field-label">Location / Venue: </div>
    <div class="field-items">
                  <div class="field-item">
                                Earthsong Eco-Neighbourhood Common House, 457 Swanson Rd Ranui              </div>
        </div>
</div>
</div>

#1

rimu - August 19, 2008 - 02:47

Oh I should add that changing the $marker_to_insert_at = "</p>"; line to $marker_to_insert_at = "</div>"; didn't help. I get the impression that CCK might be adding it's fields in AFTER this module is.

#2

grateful_drupal_user - August 19, 2008 - 03:16
Category:bug report» feature request

I realize that this may seem strange, but I consider CCK compatibility (or indeed, compatibility with any non-core module) to be a feature request, not a bug. (Last time I checked, CCK was not part of core... or have I missed something?)

If someone can submit a patch that will allow reliable CCK compatibilty, by all means, please submit the patch. I doubt I'll have time to work on this anytime soon.

#3

grateful_drupal_user - August 19, 2008 - 03:18

You could try adjusting the modules' relative weights in the system table - make ed_readmore 'heaviery' than CCK and the CCK field modules... (this all seems so familiar -- I think that there have been issues filed against ed_readmore in the past, and the system table weights may be a way to fix this.)

#5

mimhakkuh - January 24, 2009 - 16:42

I'd also think that CCK Compatibility would be a most important feature. Using cck text fields for all my drupal site's teasers ...

Is this feature actually beeing considered for future versions of Read More Tweak?

#6

Todd Nienkerk - February 13, 2009 - 13:13
Title:incompatible with CCK fields» Incompatible with CCK fields

For reference, the following issues are duplicates of this one:

#7

Todd Nienkerk - April 12, 2009 - 19:11

The solutions outlined in the following bugs have fixed this problem:

I will commit the code shortly.

#8

Todd Nienkerk - April 12, 2009 - 19:12
Status:active» fixed

#9

System Message - April 26, 2009 - 19:20
Status:fixed» closed

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

#10

kdebaas - May 29, 2009 - 16:13
Status:closed» active

I am re-opening this issue as I believe that the expected behaviour could be open to discussion. I also have a teaser listing of events, where the event content type consists of a tilte, a body text and cck fields for venue and dates. However, I do expect to have the Read more link displayed inline with the teaser field, before the actual cck fields, when I select the inline option, even if I have chosen to display those cck fields in my teaser displays.

#11

Todd Nienkerk - May 30, 2009 - 10:23

kdebaas: Can you verify that the behavior you describe in #10 does not occur as desired in the 6.x-5.0-RC1 release? The 5.0-RC1 release is a bit newer than 3.x-dev, which is itself completely different than 3.0.

#12

kdebaas - May 30, 2009 - 14:48
Title:Incompatible with CCK fields» Inline placement of read more link in teaser with CCK fields
Version:6.x-3.x-dev» 6.x-5.x-dev

Yes, the described behaviour occurs in the 6.x-5.0-RC1 release, which I started using since I liked very much the move from hook_nodeapi to template_preprocess_node.

I saw in your code that

<?php
  ed_readmore_link_place
()
?>
works on the teaser as provided by
<?php
$variables
['content']
?>
as in
<?php
$variables
['content'] = ed_readmore_link_place($variables['content'], $variables['node'], $display);
?>
which obviously already contains the CCK fields that were set to display in the teaser.

I had thought that the CCK fields could be circumvented by working instead on

<?php
$variables
['node']->teaser
?>
but I didn't manage to get that to work yet. What do you think?

#13

kdebaas - May 31, 2009 - 12:18
Status:active» needs review

Attached patch inserts the read more link inline with the teaser field, above cck fields that are set to display below the teaser.

Choosing the option 'after' for placement of the read more link places it at the end of the teaser, below the cck fields.

AttachmentSize
ed_readmore_297010_13.patch 1.32 KB

#14

Todd Nienkerk - November 10, 2009 - 05:38
Assigned to:Anonymous» Todd Nienkerk
Status:needs review» postponed (maintainer needs more info)

kdebaas: I've been trying to replicate this behavior, but so far, the Read More link reliably appears before any CCK fields added to the teaser. (I'm using CCK 6.x-2.5.) It seems the behavior you want is already built into the module. Just for kicks, I compared your $insert_point value with $match[0][1] and found they were the same each time.

Would you mind checking the latest 6.x-5.x-dev snapshot and let me know exactly how I can replicate an instance in which the Read More link appears after any CCK fields?

 
 

Drupal is a registered trademark of Dries Buytaert.