I am using views 3 and drupal 7. I have a view setup where it will return all related articles based on the keywords which works perfectly.
The problem is that I don't want the article that I'm on to show up in the results. Is there a way to hide specific nodes from displaying? For instance, lets say I have nodes: 43908 and 43909 that I don't want to show up in the view.
I've added a filter criteria (not contextual filter) to remove these nodes, but is it possible to combine node ID's into one filter? So if I wanted to show all but 43908 and 43909 how would I do that? I've tried to add them as 43908+43909 but that didn't seem to work.
You can use the regular expression option for the nid filter. So for the nid you mention you would do:
[^43908|^43909]
This filters out nodes with nid 43908 and 43909.
As for the scenario you describe, I think a better approach would be to add a separate field to your content type, e.g. field_in_progress, a tick box only visible when editing. Then you can add a filter on that field for the view.
This article may help. It involves excluding the current node from a list view.
Related
I need to create a list of nodes(with links) that shows nodes of a couple specific content type, but also filters out nodes that are more than 1 level of menu depth lower than a specific node.
I've tried creating a menu block, but I see no options to filter by content type.
I've tried creating a view, but I see no options to filter by menu depth.
Anyone know the best way to do this?
Thanks.
Follow up: I just ended up using Taxonomy and setting a default node that it refers to. Not my ideal solution, but it gets the job done.
I hope someone can point me in the right direction.
I have a calendar view with an exposed filter.
I have a parent node and 2 child nodes. Each of these optional child nodes have a common taxonomy term reference field called region.
I would like a single exposed filter which will filter the region selected in either child1 or child2.
I can get it to work for one child node or the other, but am struggling to get it to work with both in one filter.
I am not sure if it's a solution for your problem, but you can try to use Global: Combine fields filter (available in Views 3.x). There is a multiple select box, where you can select the fields that you want to filter.
I have a taxonomy vocabulary called 'catalogue'. Within this, I have levels of terms. Some have sub-terms, some have nodes.
I have two views to handle these: One to show sub categories, one to show nodes, each with a filter applied based on the URL. If I go to sub-category/category-name, it would show me all the sub-terms in category name. If I go to product-category/category-name, I get a list of related nodes.
With no aliases, the view works properly on sub-category/%. The problem with this is that the generated links for the sub-terms aren't to the view, they're to the term page.
If I create aliases, it overrides the view and shows no results on sub-category/% pages and default node teasers on product-category/%.
Can I use aliases with views in this way?
Sounds like you want to re-write the output of the Field instead of creating aliases. If you're not familiar with that particular feature in Views, see the screenshot below from http://highrockmedia.com/blog/rewriting-drupal-views-output-custom-theming-css
Note that instead of creating a <div> wrapper, you can create your own link as needed. Hopefully this will help you get started in the right direction.
Is there any way to filter content by two or more taxonomy term.
For example: I've got two vocabularies: car brand(Toyota, BMW, Ford) and car type(crossover, sedan, bantam car). How i can create filters like: Toyota&sedan, Ford&crossover etc?
The easiest way to accomplish this would be to use the Views modules. This module allows you to create complex custom displays of any of your content.
Basically you will create a View. Each View can have multiple Displays. Displays can be either pages or blocks. In your case you will want to create a page. Once you've created the page, you can add what are called Filters. Filters allow you to pass in variables to that page, which will limit the returned results.
I apologize for the misleading earlier response. I think it may now be more clear the path I was taking you down. Once you feel comfortable with Views, have a look at my previous response below.
OLD RESPONSE: You should be able to create two filters, one for each vocabulary. Then select one or more terms in each filter. Or have them exposed and select this way. There are many options here, you should play around a bit more in Views.
Take a look at the "Content: Has taxonomy term" filter specifically.
I'm using Views on Drupal. I've added the Search exposed filter to search the nodes.
I would like to avoid to filter 1 special node (which is sticky, on the top of the list). In other words, the search filter should ignore that node, and it should be always displayed.
how can I do that ?
thanks
You should consider creating a different view for it - that just shows this nod and that's all. Create a block from it and put at the top.
You can use a Node : Type filter in the View to exclude specific node types from the results.