Hi, I've returned to Drupal after a bit of a dry period whereby I was working with WordPress (it's like playing Lego)...so please excuse my rusty nature in solving this issue...

I'm creating a page using the views module, which will otherwise replace my home page. It is essentially a feed of all content types. As it shows all content types, I would like only some of them to link back to their respective content pages.

To elaborate, if I had a list of nodes on my home page...some of which are articles and some are blogs (as an example), how would I make it such that only the blogs link to their content pages, whereas the articles simply display all their text on the home feed?



lphotios’s picture

Any idea how to do this?

milodesc’s picture

Maybe you could create a new view mode to be used in this blog/article view?

Then you could create a custom template for each content type which will then be used to display the nodes in the view. For the blog, you'd link to the full content, but for the article, you'd just show the whole thing.

Here are some instructions: http://www.wunderkraut.com/blog/drupal-7-custom-node-view-modes/2010-12-20.

hoavnd’s picture

I'm assuming you're having 2 content type "Article" and "Blog". You just need to create 2 blog views, one is filtered by content type "Article" and shows full content; and the other is filtered by content type "Blog" but shows only "Content: title". To show those blogs in homepage, you can use Context module.

milodesc’s picture

But with 2 views you would have 2 separate streams of content. One for blogs and one for articles, right?

It was my understanding that OP was looking for a single feed which includes both blogs and articles.

lphotios’s picture

Exactly...I essentially need one feed, sorted by date. Maybe I could target the views page with a custom module, determine the content type, and delete if need be? I just have trouble with this, as I'm much more inexperienced in PHP than HTML/CSS/JavaScript (and JS may be the quick, but not so permanent, fix).

WorldFallz’s picture

You could do it with a preprocess function or a template file for the field that should display or not display the link. That would probably be best practice. There's also the views_php module but that's more of a 'hacky' solution.