Whenever you publish a node in Drupal, the title for the node becomes a link. That link takes you to a page that just displays that full text/contents of that node. The problem I have with this is most of my modes contain very little content, and there's no need for the user to go deeper than the basic teaser-level. For example, I have lots of nodes that just contain a link to some website with a one or two-sentence summary of the site. So, when viewing short entries, I don't want the user to be able to click the title of the entry and view that same little blurb all over again on its own page. I only want the user to view the node by itself if it's longer than my teaser length and there's actually more to read. Is there any way to accomplish this? Or is there a way to just turn off the node title linking entirely?
I hate to make a Joomla comparison here, but what I really want is for the node titles to not be linked and to have a "read more" link at the bottom of the node, but only where there is actually more to read. I hope that makes sense.
PS: I'm a complete PHP novice, so if someone is going to suggest some custom PHP snippet or core file modification, please keep that in mind when you explain what I need to do. Thanks!
Comments
edit node.tpl.php
In your theme. Look for the title, probably between
<h2>tags, and remove the a href part of the code and corresponding php and closing tag. You should be able to figure it out. In the end it should be a simple line like:<h2>print ($title);</h2>Without all the fancy layout you see here, obviously.
Be sure to save your file in utf-8 format. Use a proper text editor. Wordpad will NOT do.
Laura
_____ ____ ___ __ _ _
design, snap, blog
_____ ____ ___ __ _ _
Laura Scott :: design » blog » tweet
hi Laura, I have a similar
hi Laura,
I have a similar problem, maybe you could help me: I would like to disable the link on the category terms that appears at the bottom of some nodes.
The code in the node page says>
But doesn't show the href tag of the link. How can I remove it?
Thanks.
Michaël
Where to look
This is something you can override in your theme's template.php file. I don't have any code to offer at my fingertips, but some searching through the Handbooks on phpTemplate snippets and/or theme developer's guide may give you some leads.
Laura
_____ ____ ___ __ _ _
design, snap, blog
_____ ____ ___ __ _ _
Laura Scott :: design » blog » tweet
Hi Laura, Thanks for the
Hi Laura,
Thanks for the help,
I ´ll look in this section (Handbooks) as I coulnd´t find h2 tags in the template.php file - besides for the comments.
Looks like it is a little bit more complicated than what I thought. :)
Thanks.
Michaël
Let me see if i understood
Let me see if i understood it.
If you want to remove the terms listed under your node, check the next code.
Find this code in your node.tpl.php
Pay attention to the code added:
&& !$teaser, this tells you not to display the terms while in teaser view, but display it in full view.Upload your new note.tpl.php to your active theme. That's it.
Youfolder.com
Share what's in your folder for the Hispanic community in Canada.
sorry about the double post.
-
Thanks
That was easy to find and change...I feel like I understand PHP a little more each day! Eventually, I'd like to create some sort of if statement that checks to see if the length of the node text is longer than the teaser length limit, and to display a link to the complete node if that's the case. For now, I guess I'll just make sure my teaser length is high enough that the nodes are never cut off.
Thanks so much
Thank you so much Laura, you saved me some hair. Was busy scratching my head over this one and 9yrs later you are still my hero.