Posted by ThaForce on December 9, 2008 at 8:44am
Hi everyone, I'm still a newbie to drupal but I'm having trouble adding a Read More Link to my featured items that I have set up in drupal. What I currently have is a title (node: title) and the teaser (node:teaser). And I have views displaying 10 of the latest featured items on the front-page. How do I add the Read More Link in views? Where once you click on the read more link it takes you to the node with the full story?
Thanks for any help.
Comments
Do this
Hi,
When you editing a view. Add field 'Node:link' then give it to label none and 'Read more' in text to display.
Thanks,
Thanks for the help. I did
Thanks for the help. I did what you said but I'm still having trouble displaying the view.
A little bit more background:
- I'm using the latest drupal 6 version
- I have created a views-view-fields--Features--block.tpl with arguments to display the certain view.
- The code in the .tpl file is
<?php print $fields['title']->content; ?><div class="teaser">
<?php print $fields['teaser']->content; ?>
- That displays what I want to display, but if I want to add the read more link do I have to do something similar like what I did with the title and the teaser?
- With node:link do I have type in
<?php print $fields['link']->content; ?>or something similar to that nature?Sorry for the trouble I'm still in the learning phase of drupal.
bump for any potential help
bump for any potential help
That works, but..
This solution has two issues for me:
1) the "read more" link is always there (I want it only if the content is truncated to make the teaser)
2) The styling is a bit off (but I think I can make that work).
I've spent several hours trying to correctly print out a "read more" link on each view item, and I can't seem to find a good solution. It almost seems like this *was* present in Drupal 5 and Views, but it doesn't seem to work correctly with Drupal 6 and Views 2.
suggested solution
I had the same problem and here is what I wanted and what I did:
WANT:
To have a page (not the front page) where certain type of content will be displayed with title, teaser of the body and Read More text with link to the full page.
DID:
1. Created "Grant Story" content type (of course, you can have yours named something else, but I'm going to use my settings for this info purpose).
2. Created a view
- Add Page display (on the left).
- Change Basic Settings -> Row Style = Node
- Clicked on the settings for that display (link for the settings is within the text "You may also adjust the settings for the currently selected row style by clicking on the icon." below the Row Style node) and set Build mode: Teaser. Also checked "Display links".
- Change the view Page settings -> path and enter something here that you will use later in the menu to setup link to this page.
- Change the Filter as you need. For example, I have there Node: Type = Grant Story.
- Save the view
3. Add menu item with the path = the same path that was set in the view.
Kasia Wakarecy
http://www.freeformsolutions.ca
IT support for NFPs
Subscribing!!
Subscribing!!
---~~~***~~~---
aac
i have the same issue. 1) the
i have the same issue.
1) the "read more" link is always there (I want it only if the content is truncated to make the teaser)
subscribing
subscribing
try this
try this http://drupal.org/node/287812. specifically #19, and you also need #21.
when Trimmed word in views
then add below code in your Customfield: PHP code.
install this :- http://drupal.org/project/views_customfield
> add code in views field.
<?php
global $node;
$node=node_load($data->nid);
if(strlen($node->body) > 400 ) /* 400 is character length of node body */
{
?>
nid; ?>">Read More
<?php
}
?>