Postponed (maintainer needs more info)
Project:
Content Templates (Contemplate)
Version:
5.x-1.8
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
18 Apr 2007 at 20:14 UTC
Updated:
5 Oct 2010 at 02:06 UTC
Jump to comment: Most recent file
Comments
Comment #1
bdornbush commentedIf there is a long enough body to generate a trimmed version, the "read more" link will appear.
But what if there is not enough? I inserted the following into the Teaser Template. It will always generate a "read more..." link to the full node.
<a href="<?php print $base_path ?>/?q=node/<?php print $nid ?>">Read more...</a>Of course, now I have two read more links in some cases. I changed it to
<?php if (!$node->readmore) {?><a href="<?php print $base_path ?>/?q=node/<?php print $nid ?>">Read more...</a><?php } ?>and now my read more link appears only if the other read more link doesn't appear.
Comment #2
gareth_w commentedThanks for the snippet, it's similar to what I have but more elegant.
My issue is that if I use this it redirects to /mysite/node/99 which is fine, but if my node has a URL set (e.g. /mysite/node/my_page) this is not displayed, and I would rather this (name) was bookmarked rather than the node/nid reference.
Do you know if a work-around for this is possible?
Thanks,
Gareth
Comment #3
joel_guesclin commentedVery late response - but personally I would use the Excerpt module which allows you to customise what you put in the Teaser
Comment #4
mikemccaffreyTry this:
It will translate the node/id into whatever pathalias is set. All the extra arguments passed to the link function is to enable the last flag which lets you use html. You can't use $node->path due to a permissions bug for anonymous users.
Comment #5
selmanj commentedI didn't like having my Read More link be separate from the other links relating to a node.
Here's my (not so great) solution. If a content type has the teaser output overridden within contemplate, display the read more link. This isn't the best solution since someone might be generating a teaser identical to the body, but I think it covers most users. I couldn't think of a better way of doing it, since the readmore flag has to be decided early-on in the node loading process. Hopefully someone better with CCK/contemplate can figure out a more appropriate solution.
See the attached patch for contemplate-5.x-1.8.
Comment #6
selmanj commentedComment #7
jrglasgow commentedI don't see the point in the patch, There isn't a problem that I see with the way contemplate handles the 'Read More' display. You shouldn't need to patch the module to achieve this. I would use bdornbush's solution to solve this problem. If you see a problem where contemplate is stopping the 'Read more' from appearing when there is enough content to justify it I will look into applying this patch, or orchestrating my own solution to fix it.
Comment #8
gagarine commentedA read more link for contemplate, work with alias and clean url enabled or not:
Comment #9
karimb commentedTry this one with the variable $node_url