Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Drupal 7 Views filter via menu link

Posted on 2013-05-16
10
Medium Priority
?
463 Views
Last Modified: 2013-05-17
I think I am on the last leg of this drupal site, but I can't figure something out. I have a book feed that is pulling in from amazon. I have a created a categories. When the user clicks on sci-fi for example, i want the url to call my view [i am using Drupal 7]and pass the category value to that view, thus returning other titles in that category.

How can I accomplish this?
0
Comment
Question by:lfwebz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
  • 2
10 Comments
 
LVL 17

Expert Comment

by:nanharbison
ID: 39172099
Can we see this?
0
 

Author Comment

by:lfwebz
ID: 39172281
Sure, url is: http://feedsview2.lfwebz.com/

I am tickering so ignore the mess - but look at the Listing menu in the left sidebar, I want to use History for example, and have it point to to the view, which currently a block, but I can make a page is needed, and query/filter the view to find all the history related books.  There is a category field in the view that contacts the category/categories the book would fall into
0
 
LVL 17

Expert Comment

by:nanharbison
ID: 39172332
You either need to create a page for each category as a view, or create a page for each and stick the block on that page.
Do you know how to find the URL for a view? You have the ability to set it yourself, but it is usually what you named the view with dashes replacing spaces.
0
Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

 

Author Comment

by:lfwebz
ID: 39172351
that is possible what I am looking for, some guidance/steps to linking to the block and passing the variable "history" or "Romance" in the link that will then filter the view.
0
 
LVL 17

Expert Comment

by:nanharbison
ID: 39172371
As far as I know, you can't link to a block, it has to be in a node, or page.
0
 

Author Comment

by:lfwebz
ID: 39172514
Hi NanHarbison, yes I am fairly certain it can be done.

Does anyone have any concrete recommendations regard modules needed, process/steps of link a menu item to a view/passing variable to a view via link and filtering that view.
0
 
LVL 13

Accepted Solution

by:
Aaron Feledy earned 1200 total points
ID: 39173084
Create a page in views that displays all of your books. Add a percent sign to your path to represent the name of the category. Something like "categories/%". Add a contextual filter under the advanced settings of your view. Set the contextual filter to use the value of your category field. Now when you visit something like yoursite.com/categories/history, the view will generate a page that only displays books that have "history" as the value of that field.
0
 

Author Comment

by:lfwebz
ID: 39173125
but the big issue is how do i link up my menu?

so i have a menu link as follows:
Fiction
Romance
History

What do I put on the fiction link or wait, so the link would just point to mysite.com/cat/fiction ---sorry I think I sort of see this, need to test - back later
0
 
LVL 13

Expert Comment

by:Aaron Feledy
ID: 39173131
Yes, I think you're getting it.
0
 

Author Comment

by:lfwebz
ID: 39175374
Wow that worked Arrow_1.  Thanks so much, I have another question.  The contextual filter does not search in the category field if there is more than one value.  The category field is like this: "Fiction > Historical | Fiction > Literary".  If I put only Literary for example, it works.  I am going to post this as another question, because you answered my original one.  Thanks so much!!!
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is for those that are having major problems with users upload files such as pictures to their profile. The solution is simple and has to do with correcting the directory paths. With some experimenting and testing i got it fixed. Note…
RTL (right to left) web applications aiming for audiences speaking languages like Hebrew or Arabic, are generally more complicated than the same applications aiming for audiences speaking Latin based languages. The main difference lies of course …
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question