By TimToronto on
I have created node templates using panels and would like to add a button with the title of the "next" node for a user to click through to.
I would like to create a views block that would take the node id from the currently viewed node and use it in a filter to list nodes of that type with a node id greater than the current node. I tried adding the Nid Contextual Filter but then my view is only that single node. Is there a way around this? Is there a way to enter the currently viewed node id in the Filter > Content:Nid > Value field?
Thanks for any input,
+
Comments
Did you solve this?
Hi Tim,
Did you find out how to do this. I am also looking to do something similar and couldn't find any info.
Cheers,
D
This might help:
This might help: http://mediatribe.net/en/node/21
nid into views block
I think you can add the nid as an argument and then set the action if the argument is not there to be get nid from url.
Argument in Drupal 7 Views
UPDATE: Found what I'm looking for!! I think, anyways! http://www.metachunk.com/blog/adding-related-content-view-drupal-7
--
I don't think that "argument" is part of the Drupal 7 views... any thoughts on how to do this with Drupal 7?
I am wanting to create a related content block view in the left column. It should pull in two fields from the current page nodes fields. My thought was that I just create a view where the nid = the current nid. If this isn't the best way to do this, I'd love to know. (Originally I thought I could just use the field names directly in the template, but this doesn't seem to work).
Thanks!
The page is gone, here is the internet archive link to it
http://web.archive.org/web/20140630062743/http://metachunk.com/blog/addi...
yes right thanks.
yes right thanks.
https://www.drupal.org/project/image_captcha_indicator
https://www.drupal.org/project/ext_js
Under "Advance"
I just found this out so hopefully it will help someone else as well.
"Filter criteria" is not the same as "Contextual Filters." Click on the "Advanced" drop down section to find the "Contextual Filters". I'm then trying to figure out the rest from this page http://drupal.org/node/814132.
Advanced?
where is the advanced drop down located? in the view? I see filters but can't seem to find the drop down your talking about. can you point me in the right direction?
Back to original problem
I have the same problem as Tim did.
I have a number of articles, and while I'm reading one of them, I want a view/block of the previously created articles and another view for the newer articles. So the crucial factor is the created time or nid of the current node. How do I configure the filters, it must be the contextual filter, right? PHP-code, anyone?
This can't be that hard, and it is very frustrating to get tackled with an issue that seems very trivial.
Thanks for any info in advance.
views
You don't need anything fancy for the "Most Recent" Views block. That's easy-peasy. Just create a Views list of title fields of the content type "Article" and then sort them by date and display the first n number of items. Done.
But finding articles around the current node's publish date is a little more tricky. I don't think you can get this with JUST arguments and filters. I bet you will need some custom php that will get the current node's publish date, expand that to a range, and then use the results of that to filter the View block.
I wish I had a recipe for that. You may try in IRC. Please post back if you solve this.
A list of some of the Drupal sites I have designed and/or developed can be viewed at motioncity.com
I believe that to only select
I believe that to only select the content from the page the block is currently on will be solved by these steps:
Nathan, this works only for
Nathan, this works only for default view mode where there is id in the url. This does not work for teaser view.
Thank you! This did the trick
Thank you! This did the trick for me. (Not using teasers though, per cmwelding).