0

I have a /press-releases section of my site. The /press-releases url shows a summary of all articles (press-release content types) and there is a block on that page that is generated by a view which displays the latest press releases by release date. That part works great.

When a user clicks on one of the listed articles, I need it to go to the full article, but use a special "View" for press releases (articles). I think I need to use some combination with the page view's "Path" field along with the Contextual Filters, but I can't figure out the correct combination.

In other words, how do I show my Press Release (article) Page View when the url is /press-releases/anyarticle ?

The View I'm struggling with

0

You are close. Remove the "Global: Null" contextual filter and configure your "content: nid" contextual filter this way:

WHEN THE FILTER VALUE IS NOT IN THE URL => Display all results for the specified field WHEN THE FILTER VALUE IS IN THE URL OR A DEFAULT IS PROVIDED => Specify validation criteria, content, type: press releases

To get the press release links changed, you need to: - add field "content: nid", exclude from display, and rearrange on top, above title - edit title and remove "Link this field to the original piece of content". In "Rewrite results" check "Output this field as a link" and enter "press-releases/[nid]".

  • It didn't work :( For the second part, where you're saying to link the article title to the nid... are you saying I should do this for the block view that displays the articles, or for the actual page view? – Ben Nov 1 '11 at 16:51
  • yes, in the block that shows the list or press releases – uwe Nov 1 '11 at 17:02
  • But that shouldn't matter anyway, for the Page View. The requirement I need to fulfill is to have /press-releases/[anyarticle] be displayed with the custom Page View. All of my article titles on the Block display already point to the correct url because I set the content's alias to /press-releases/[anyarticle] – Ben Nov 1 '11 at 18:09
  • I don't think you can't override the default node display with custom view. Try remove the alias and it should work with the above steps. – uwe Nov 1 '11 at 18:53
  • 1
    there are different ways to style or theme the default node.tpl.php. You could use display suite module or do a template override (copy node.tpl.php to node--press-release.tpl.php and modify the HTML). – uwe Nov 1 '11 at 20:19
0

Ben & Mototribe. I am following this question. I thought that Blocks did not read the URL directly and you have to direct the block to read the URL. In that case, in WHEN THE FILTER VALUE IS NOT IN THE URL you should set 'Provide Default Value' checkbox and select 'Content ID from URL' to tell the block where to look. This should take you to whatever press release is in the URL.

  • The Block views are not the issue. It's the Page view that I can't get to work. But I do believe you're correct in what you said. – Ben Nov 1 '11 at 18:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.