drupalfun.com
passing a word as an argument to a views 'filter' condition
can we send word to view's filter condition as a parameter?
i have a view, created along with a block and page view at www.mysite.com/myview
the view uses a condition 'filter' that filters and displays all those article that have the word "someword" in the title
it works fine and when i open www.mysite.com/myview the view lists all nodes with "myword" in their title.
NOW THe THING IS
i use the filter agagin and again. instead of creating a separate view for "myword2" and "myword3"
so i want to pass "myword" as an "argument" to the view and then use that "myword" in the condition
how can i do that?
will it work if i just edit my view and replace the "myword" in the filter condition with "%1" and call www.mysite.com/myview/myword ?
thanks in advance to any one who helps
i posted the same at drupal: http://drupal.org/node/570420
no luck since long,.
let me try here..
Related Questions
Responses
2. If I understand you properly
If I understand you properly I have just done this for the first time...
I wanted to created a view of one node at a time so I filtered the nodes to node type and restricted the view to one node at a time, then added all the fields I wanted to display
In my case "myword" corresponds to the node title, so www.mysite.com/myview/myword simply displays the myview view of node myword
3. Did you ever get this resolved?
I have the issue, I want an argument that I can use in filters, in my case it is to display a list of documents by taxonomy term.
www.example.com/documents/% which would look like
www.example.com/documents/manuals
If you found a solution I'd appreciate any help you can give as I haven't been able to figure it out.
Thanks,
Martin
5. Just tested this and it worked
In filter...
>select "Node Type" and associate it with the node type you want
>select "Taxonomy: Vocabulary" and associate it with the vocabulary you want to filter by with your argument term (whichever vocabulary the term "manuals" exists within and which is associated with your node type above)
In fields
> select the fields you will want to display as a consequence of your argument filtering
In argument
>select "Taxonomy: Term"
so when you enter your argument in the live preview (in your example "manuals") you should get a list of nodes for your term
6. Thanks so much!
That's awesome. I had the right idea but I failed by not choosing taxonomy vocabulary in filters, instead I had taxonomy term chosen with all the terms listed in the select field provided. I really couldn't tell you why I did that, never used Vocabulary before so I was blind to it being there... maybe... I do the same thing when I look in the fridge haha.
I've now added another arg on top of that so I've got
www.example.com/community/name-arg/document-type-arg
Took a second to see that I just had to check another box in Taxonomy Vocabulary filter and not add another one to the filters but all is well.
YAAA!
Thanks for the response. Take care
8. out of topic solution
getting teh nodes by taxonomy is a simple thing...
the initial query posted was displaying all nodes containing a word in the title.
we can do that infact very easily with views.
but i want to have that 'word' to be dynamically taken from the url..
and NO, the nodes are not tagged with any taxonomy terms so the posted solution wouldnt work,,,.


1. You should probably use
You should probably use /myview/% as url. where the % is 'word1', 'word2',...