Hi,
I just upgrade the site I am working on to Drupal 7. Love the new Modules features.

Can anyone tell me how to remove 'Read more' on the front page (home page) and display the whole page??
I have already install frontpage modules and variablesAPI. I look at every items in configuration and couldn't find a way.

Tansy

Comments

PSIPHON’s picture

To make something else the the home page in Drupal 7 go to Configuration > SYSTEM > Site Information. There you will find the "Default front page" setting.

This will remove the read more from your page but you will be limited to only having one node/page as your homepage.

- Eric

tansylam’s picture

I open Configuration -> Site Information in Drupal 7 a million times, there is no option allow me to change the default front page. All I see is the following: http://www.webpagescreenshot.info/img/684863-128201173432AM

Please help..

Tansy

nagarajanl’s picture

Hi,

In your template.php create or modify the following function to force to 'teaser' view to 'full page'

<?php
function themename_preprocess_node(&$variables) {
$variables['view_mode'] = 'full';
$variables['page'] = TRUE;
$variables['content']['links'] = FALSE; // This is to remove the 'Read more' link
}

Hope this helps....

tansylam’s picture

I couldn't find function themename_preprocess_node in the template.php file. So I added the function to the template.php file. However, nothing change...
I am working on Drupal 7

Tansy

MrPhilbert’s picture

Really?
Anyway, there is a workaround:

Enable views, clone the frontpage view (dont't want to hack it up) and change the node display to not show links. It does still link the title but the read more goes away. Then change the default front page path to the name of the new view path ("newfront" etc). Perhaps "not show links" should be the default behavior of the front page.
Philbert

tansylam’s picture

Where is the NodeDisplay, can you be more specific, please.
View Module is my weakness list..

Please and thank you very much..

Tansy

nagarajanl’s picture

Hello the themename mentioned here is not the exact word. Its the name of your actual theme. Say if your theme name is bartik then this will be bartik_preprocess_node. After creating the function with above code, just clear the cache

nsteen’s picture

That fixed it for me; so it does work.
I think the Topic Starter forgot to replace the "themename" with the actual theme name.

Note: I just used the last line of code:
$variables['content']['links'] = FALSE;

and added the if(drupal_is_front_page()) function, because I only need it on the FP. May be useful to someone else

Thanks

bjuliano’s picture

I just added the following and it removed the "Read More" like I wanted.

$variables['view_mode'] = 'full';
$variables['content']['links'] = FALSE;

But, it didn't fill in the rest of the content from the source. It just cut it off and left it that way. Any ideas?

bjuliano’s picture

It was pulling in the summary, not the entire body. Never mind.

Lildrmerboy’s picture

I am having the same problem, what did you have to change to fix this?

ursula’s picture

The option of setting a specific home page comes out of the box in Drupal 7.
Are you by any chance using a release candidate, or a development version, instead of the actual released version of Drupal 7?

tansylam’s picture

I definitely installed Drupal 7.0, not development or RC version..

The website need to go live next week and I need to fix the front page..Help!!

elitemaks’s picture

Copy file modules\node\node.tpl.php in your theme folder and remove line
<?php print render($content['links']); ?>
but this method will remove "read more" link from all nodes on the site...
Or you can wrap this line with "if" statement and check if the node is promoted for front page, like this
<?php if (!$promote){ print render($content['links']); } ?>
Hope this will help

MrPhilbert’s picture

I posted a video tutorial on using views to customize the front page. It's on a new website that I am building out with Drupal 7 with videos on the process. The first one is about the front page links. It is also on a Windows vps so I have (so far) one video about 301 redirects in IIS 7 as well.
Check it out at www.siteperspectives.com
You'll notice that this goes to siteperspectives.com without the www for SEO optimization.

Hope this helps,
Philbert

tansylam’s picture

For some really strange reason, I tried to override node.tpl and override front page and doesn't seems working for it.. I have been on this for days and just don't understand what is the problem.
The D7 I installed, clearly in Configuration->SiteInformation->Site->Frontpage, I am missing the second line of set default front page. Is there anyway I can not completely reinstall, but reinstall some files that could fix the bug?

Tansy

Technonow’s picture

Philbert.

Great video. I'm just getting into Views but couldn't make it work until I watched your video.

Like you said. Just two simple changes.

Simple.

SolasArd’s picture

That will remove all links, but what if I want to get rid of the "Read more" link, but keep the "Comment" link, any ideas?

moritzz’s picture

Just use...

function yourthemename_preprocess_node(&$variables) {
  unset($variables['content']['links']['node']);
}
alextataurov’s picture

I also use the same fix.

dereck1989’s picture

Perfect !
Do not remove the title and remove the read more.
Nice.

mwaqasaziz’s picture

please name of file where this code be placed

Shaggy’s picture

works well.

stevensunsunsun’s picture

Prefect - thanks!

anandax’s picture

Select the node for the front page in
Configuration -> Site Information --> standard website : node/xy
and Read more goes away.

Quaizerman’s picture

Nice tip.

Thanks a lot,

Quaizerman

noumanabbas’s picture

Best Nice & Simple. Thanks

sher1’s picture

Sometimes the simplest solution is best. If you are setting a class on your front page or if you have added a specific css to the front page, you can just do a display:none on the elements you don't want showing.

foolevil’s picture

Administration>Configuration>System

I changed my default front page and number of post on front page, thats it.

aniebel’s picture

I did as foolevil did and specified the urlalias (in my case it was "about") of the page I had set for front in the "Default Front Page" field and changed number of items to 1.

susanoc262’s picture

Just installed Drupal and started playing with it for the first time today and this was starting to drive me a little nuts. I was happy to find this last suggestion - it was perfect and very simple. Forgive me for adding more details that may be obvious to many, but it may help anyone else as new as with this as I am. It took me a minute to realize what to enter in the "Default Front Page" field. Basically, set up your content for the page and when you preview it, the address in the browser will show 'node/x' where 'x' is a number. There may be additional text after the number, but just grab that 'node/x' information and put it into that Default Front Page field. And set the number of items to display to 1. Worked great.

Anonymous’s picture

Thanks! Just simple change default font-page at Administration>Configuration>System>Site information.

vikassaxena’s picture

Configuration--> site information --> Here you will find text box for "default front page"

Under the default front page add the full path of the front page and save configuration. It worked for my drupal 7 website

http://foodnetworks.info

mohitsinghal’s picture

Great simple is superb.

http://all-interviewquestions.info

Bosire’s picture

I got into lots of problem when I attempted to remove the read more link from the front page (Drupal 7). I managed eventually by hacking the core files but when it clicked in my mind that do not hack "core", I immediately changed my mind.

I thought, can't I use view to do that. That is the time I discovered that I had wasted almost a whole day trying to achieve a simple thing through the hard way.

This how it is done. Install views module (drupal 7) and then the ctools. Enable both. Go to structure and choose view. Create view say, home. Set title to none, unformatted. Set the filter creteria to content promoted to front page and published. After this set the path. Save. Go to configurations and change the URL of the index. Done. Go to your front page and there you are. I have posted a detailed article on my website - www.webmakers.co.ke/blog.

rwilson0429’s picture

By default, the "Default front page" is set to "node," which simply displays articles that have been "Promoted to front page." So, out of the box, yourdomain.com displays content from yourdomain.com/node. Note that when changing the "Default front page" to something other than "node", nodes that are "Promoted to front page" will no longer appear on the front page unless you take specific actions to make them appear. They can however, still be viewed by visiting the relative URL path "node".

The simplest way to change the default front page is to go to 'admin/config/system/site-information', under the 'Front Page' settings section, you can change the default front page there. So, if you want your front page to display the contents of node 24, for example, you would enter 'node/24' as the front page path. If you are using aliases, then you can use the alias as the path. Depending on your display settings at (admin/structure/types/manage/[content_type]/display) for the node type, your node 24 (or its alias) will display on your front page without the read more link. In other words, if your default display settings for the node type is not set to teaser, than, the read more link will not display.

A better way is to use Views. If you are using Views (of course you are using Views), Views comes out-of-the-box with a front page View that you can customize to fit your needs. The Views front page view has a relative path of '/frontpage', therefore, for this View to have effect, you must change your sites Default front page path to 'frontpage' at 'admin/config/system/site-information'. Using Views to display your site's front page gives you much more flexibility in what and how your front page is displayed.

For more information on overriding the default front page behaviors see:

ReggieW

nh2011’s picture

Followed everything you guys said. Except that views just won't work. I keep getting an error every time I try to use views... It simply says: An error occurred at http://MYORGHERE.org/admin/build/views/ajax/display/frontpage/page/items....

Obvs replacing "Myorghere" with my organization's name :) Should I ... move along to a different post? Have I broken views? :(

- Nas

diwakars’s picture

No need to dig into the core modules or node templates.

Firstly download a module called " Read More Links" from "http://drupal.org/project/read_more" then on dash board click on "Configuration" -> "Content authoring" -> "Read More Link" -> "Disable links"

I guess this should solve the issue. With out any additional code needed.

Cheers

Daviator’s picture

None of these options are actually viable.

By disabling the link in "Read More Link" module you remove the link but the rest of the content still does not display on the front page.

Creating a new View with the View module didn't work either...

Drupal's own Site Building Guide says "Do not hack the core." and "Avoid hardcoding." and yet this is no simple way show the entire page I want to show on my home page.

Drupal seems more like a Developers toy set than a viable CMS. I mean if it takes 2-3 times the effort to get the same look and feel as I can with WP or Joomla, whats the point?

Technonow’s picture

Drupal 7 comes with forty four Core Modules as well as hundreds of others which can be installed with only two clicks.

If you think you can obtain the same 'look and feel using WP or Joomla then you are obviously only using a fraction of the tools that Drupal 7 supplies as standard. WP and Joomla just don't have anywhere near the same features.

MrPhilbert’s picture

Then WP is an excellent choice.

If you need fine grained control over views, pages and context, then you cannot come close to Drupal.
Take a look at the videos for page manager/panels, views, and rules on nodeone.se. They aren't that hard and you can do just about anything you need to tailor a site way beyond what Wordpress was meant to be.

Yes, there is some feature overlap but you must look at your needs.

"Custom always takes more effort."

jhalicea’s picture

I'm a Drupal 7 noob (like a month playing with it) and this is one of the most easy things to do.

  1. Go to /Structure/
  2. /Content types/
  3. On the list of content types select Article and click on /manage display/ link
  4. In the bottom of the page click /Show Custom display settings/
  5. deselect /Teaser/ check box and select /Full Content/ then click save

Full path:
admin/structure/types/manage/article/display

This allow all the articles to have a view of full content. You can leave the article default configuration and make something most meaningful to you like Post or News (content type) and give all the configuration that you want. All of this without code or plugins.

aniebel’s picture

jhalicea, this will work however your solution will change all Article pages, not just the front page.

forestplay’s picture

It applies to all articles. So create a new content type, call it "FrontPageContent" or something and do as suggested.

jelly46’s picture

This didnt work for me at all, but thanks for putting it up.

knowledges33ker’s picture

Hello,

I've removed the read more by placing the following in my theme css:

.front .node-readmore {
display: none;
}

Hope this helps!

Rob de Koter’s picture

Thanks, this was the easiest idea , I altered it a bit because in your solution not only the first "read more" is gone, all the "read more's" from the teasers below the intro text are gone to and I like to keep them.

So I came up with this solution:
1) create a custom content with the name "front-page" and give it a title but also put the title in the content area and style it with the usual "h1" tag
2) add this to your theme css:

.node-front-page .node-readmore,
.node-front-page .node-title {
display: none;
}

This removes the title (link) and the "read more" from the content type "front-page" and leaves all other content as it is.

diwakars’s picture

Easiest way to remove read more link from the front-page is to Go to Configuration >> Site Information >> Default Front Page [Enter the node/nodeID]. It will show only the content in front page removing the read more link.

whoey’s picture

this worked fine for me in a bartik subtheme...

JennySmith’s picture

This also works. Demonstrating how to hide read more, add a new comment link, and links:

     hide($content['node-readmore']);
     hide($content['comments']);
     hide($content['links']);
     print render($content);
miteshshah01’s picture

For Drupal 7

Add following code in template.php file of your active theme.

function themename_preprocess_node(&$variables) {
  unset($variables['content']['links']['node']);
}

this will remove only 'read more' link but will not show full content,

To show full content,
1 - Go to: structure > content types
2 - under Basic page (assuming that the promoted page is a basic page) choose manage display.
3 - on the bottom click on "Custom display settings"
4 - uncheck all the other and enable full content.

It worked for me.

sushilkr’s picture

Go to Configuration -> Site Information --> standard website

If you assign any node it will remove the "read more" option when you simply create node and assign display in front page by using visibilty it will show front but there will be read more .. treasure is working in that case

Thanks
www.sushilworld.com

kojow7’s picture

Here is what I did to solve the problem in Drupal 7:

  1. Install the Read More Control module: https://drupal.org/project/readmorecontrol
  2. Go to the Global settings under Configuration > Content Authoring > Read More Settings
  3. Set the default behaviour to "Show link when required by any supported fields"
  4. Go to the configuration page for my content type.
  5. Remove "Teaser" in the Custom Display Settings section.
Julsiana’s picture

Worked like a charm for me, even without implement step 4 and 5. Thanks!

thomasmurphy’s picture

This is a great reason to use display suite in D7, and a lot of this functionality has gone into core in 8.

yog_kulkarni’s picture

Enable Read More Link module.
Go to Configuration>> Content authoring >> Read More Link
Check Remove Read More link from links section.
It worked for me.