Views & Arguments

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Views & Arguments

ttronslien
I have successfully used Monster Menu and Views, however, without using arguments.

Now I'm trying to pass arguments but I have not been successful at doing so.

I've been using contextual filter and tried both the Taxonomy term ID from url and Raw URL. The Preview test works well, but nothing is displayed in the node calling the view.

Also, with added arguments, the view no longer display the "No Results Behavior."

So, two questions
1) How does the view receive the arguments and
2) What can I do to make sure No Results Behavior appears (maybe linked to question 1?)

In advance,
thank you

Tove Tronslien, MSc, Informatics
Manager, Web Development Services
Lakehead University
Thunder Bay | Orillia, Ontario, Canada
[hidden email]
(807) 343-8499

---

You are currently subscribed to monster_menus as: [hidden email].

To unsubscribe click here: http://lists.middlebury.edu/u?id=685503.6b071f880fe6a965a128164e6d09ea81&n=T&l=monster_menus&o=679796

(It may be necessary to cut and paste the above URL if the line is broken)

or send a blank email to [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Views & Arguments

ttronslien
Update to No Results Behavior.

It is now acting as expected after ensuring that the "Action to take if filter values does not validate" was properly configured for the  Contextual Filter (that will be handling the passed argument).

Tove Tronslien, MSc, Informatics
Manager, Web Development Services
Lakehead University
Thunder Bay | Orillia, Ontario, Canada
[hidden email]
(807) 343-8499


On Wed, Jul 25, 2012 at 11:39 AM, Tove Tronslien <[hidden email]> wrote:
I have successfully used Monster Menu and Views, however, without using arguments.

Now I'm trying to pass arguments but I have not been successful at doing so.

I've been using contextual filter and tried both the Taxonomy term ID from url and Raw URL. The Preview test works well, but nothing is displayed in the node calling the view.

Also, with added arguments, the view no longer display the "No Results Behavior."

So, two questions
1) How does the view receive the arguments and
2) What can I do to make sure No Results Behavior appears (maybe linked to question 1?)

In advance,
thank you

Tove Tronslien, MSc, Informatics
Manager, Web Development Services
Lakehead University
Thunder Bay | Orillia, Ontario, Canada
[hidden email]
<a href="tel:%28807%29%20343-8499" value="+18073438499" target="_blank">(807) 343-8499

---

You are currently subscribed to monster_menus as: [hidden email].

To unsubscribe click here: http://lists.middlebury.edu/u?id=857556.923faf2f511f9d2b6990f78983c62c3e&n=T&l=monster_menus&o=679796

(It may be necessary to cut and paste the above URL if the line is broken)

or send a blank email to [hidden email]


---

You are currently subscribed to monster_menus as: [hidden email].

To unsubscribe click here: http://lists.middlebury.edu/u?id=685503.6b071f880fe6a965a128164e6d09ea81&n=T&l=monster_menus&o=679797

(It may be necessary to cut and paste the above URL if the line is broken)

or send a blank email to [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Views & Arguments

Dan Wilga-2
In reply to this post by ttronslien
I have been meaning to add the ability for MM to attach views to pages,
but other projects have taken priority. In the meantime, you can use any
of the various modules which will turn a view into a node type or field
in a node, such as http://drupal.org/project/viewfield .

On 7/25/12 11:39 AM, Tove Tronslien wrote:

> I have successfully used Monster Menu and Views, however, without
> using arguments.
>
> Now I'm trying to pass arguments but I have not been successful at
> doing so.
>
> I've been using contextual filter and tried both the Taxonomy term ID
> from url and Raw URL. The Preview test works well, but nothing is
> displayed in the node calling the view.
>
> Also, with added arguments, the view no longer display the "No Results
> Behavior."
>
> So, two questions
> 1) How does the view receive the arguments and
> 2) What can I do to make sure No Results Behavior appears (maybe
> linked to question 1?)
>
--
Dan Wilga                                 [hidden email]
Web System Administrator/Programmer             http://www.amherst.edu
Amherst College                                      Tel: 413-542-2175
Amherst, MA  01002


---
You are currently subscribed to monster_menus as: [hidden email].
To unsubscribe click here: http://lists.middlebury.edu/u?id=685503.6b071f880fe6a965a128164e6d09ea81&n=T&l=monster_menus&o=679798
or send a blank email to [hidden email]
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Views & Arguments

Jay Dansand
In reply to this post by ttronslien
http://drupal.org/project/insert_view may also do the trick; I believe Ian recommended it to us back at DrupalCon Denver.



Regards,
Jay Dansand, LU '08

--
 ____ ____    Senior Web Application Developer
||L |||U ||   Lawrence University ITS
||__|||__||   Office: 920-832-6585
|/__\|/__\|   Fax: 920-832-7693
              E-mail: [hidden email]


-----Original Message-----
From: Dan Wilga [mailto:[hidden email]]
Sent: Wednesday, July 25, 2012 10:49 AM
To: Monster Menus Development
Cc: Tove Tronslien
Subject: Re: Views & Arguments

I have been meaning to add the ability for MM to attach views to pages, but other projects have taken priority. In the meantime, you can use any of the various modules which will turn a view into a node type or field in a node, such as http://drupal.org/project/viewfield .

On 7/25/12 11:39 AM, Tove Tronslien wrote:

> I have successfully used Monster Menu and Views, however, without
> using arguments.
>
> Now I'm trying to pass arguments but I have not been successful at
> doing so.
>
> I've been using contextual filter and tried both the Taxonomy term ID
> from url and Raw URL. The Preview test works well, but nothing is
> displayed in the node calling the view.
>
> Also, with added arguments, the view no longer display the "No Results
> Behavior."
>
> So, two questions
> 1) How does the view receive the arguments and
> 2) What can I do to make sure No Results Behavior appears (maybe
> linked to question 1?)
>
--
Dan Wilga                                 [hidden email]
Web System Administrator/Programmer             http://www.amherst.edu
Amherst College                                      Tel: 413-542-2175
Amherst, MA  01002


---
You are currently subscribed to monster_menus as: [hidden email].
To unsubscribe click here: http://lists.middlebury.edu/u?id=849053.214f550f57fa54a976b5f2d087b6d379&n=T&l=monster_menus&o=679798
or send a blank email to [hidden email]

---
You are currently subscribed to monster_menus as: [hidden email].
To unsubscribe click here: http://lists.middlebury.edu/u?id=685503.6b071f880fe6a965a128164e6d09ea81&n=T&l=monster_menus&o=679799
or send a blank email to [hidden email]
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Views & Arguments

McBride, Ian S.
In reply to this post by ttronslien
My first suggestion would be to check that the arguments entered in the contextual filter are the right ones. You can add something like this to your node template to see the current arguments:

<?php
$args = arg();
var_dump($args);
?>

With a node displayed on a Monster Menus page, arg(0) is always going to be 'mm' and arg(1) is going to be the mmtid, so if you're expecting arg(1) to be a taxonomy tid, it might actually be arg(3) or arg(5) depending on the rest of the request.

On Wed, Jul 25, 2012 at 11:46 AM, Tove Tronslien <[hidden email]> wrote:
Update to No Results Behavior.

It is now acting as expected after ensuring that the "Action to take if filter values does not validate" was properly configured for the  Contextual Filter (that will be handling the passed argument).

Tove Tronslien, MSc, Informatics
Manager, Web Development Services
Lakehead University
Thunder Bay | Orillia, Ontario, Canada
[hidden email]
<a href="tel:%28807%29%20343-8499" value="+18073438499" target="_blank">(807) 343-8499


On Wed, Jul 25, 2012 at 11:39 AM, Tove Tronslien <[hidden email]> wrote:
I have successfully used Monster Menu and Views, however, without using arguments.

Now I'm trying to pass arguments but I have not been successful at doing so.

I've been using contextual filter and tried both the Taxonomy term ID from url and Raw URL. The Preview test works well, but nothing is displayed in the node calling the view.

Also, with added arguments, the view no longer display the "No Results Behavior."

So, two questions
1) How does the view receive the arguments and
2) What can I do to make sure No Results Behavior appears (maybe linked to question 1?)

In advance,
thank you

Tove Tronslien, MSc, Informatics
Manager, Web Development Services
Lakehead University
Thunder Bay | Orillia, Ontario, Canada
[hidden email]
<a href="tel:%28807%29%20343-8499" value="+18073438499" target="_blank">(807) 343-8499

---

You are currently subscribed to monster_menus as: [hidden email].

To unsubscribe click here: http://lists.middlebury.edu/u?id=857556.923faf2f511f9d2b6990f78983c62c3e&n=T&l=monster_menus&o=679796

(It may be necessary to cut and paste the above URL if the line is broken)

or send a blank email to [hidden email]


---

You are currently subscribed to monster_menus as: [hidden email].

To unsubscribe click here: http://lists.middlebury.edu/u?id=685439.7e7cbccf9bb225cf8471bffe1cb67503&n=T&l=monster_menus&o=679797

(It may be necessary to cut and paste the above URL if the line is broken)

or send a blank email to [hidden email]


---

You are currently subscribed to monster_menus as: [hidden email].

To unsubscribe click here: http://lists.middlebury.edu/u?id=685503.6b071f880fe6a965a128164e6d09ea81&n=T&l=monster_menus&o=679800

(It may be necessary to cut and paste the above URL if the line is broken)

or send a blank email to [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Views & Arguments

McBride, Ian S.
In reply to this post by ttronslien
Yes, we use insert_view for the middlebury.edu site. It adds shortcode for embedding views as an input filter so you can control which roles have access to use it.

On Wed, Jul 25, 2012 at 11:51 AM, Jay Dansand <[hidden email]> wrote:
http://drupal.org/project/insert_view may also do the trick; I believe Ian recommended it to us back at DrupalCon Denver.



Regards,
Jay Dansand, LU '08

--
 ____ ____    Senior Web Application Developer
||L |||U ||   Lawrence University ITS
||__|||__||   Office:   <a href="tel:920-832-6585" value="+19208326585">920-832-6585
|/__\|/__\|   Fax:      <a href="tel:920-832-7693" value="+19208327693">920-832-7693
              E-mail:   [hidden email]


-----Original Message-----
From: Dan Wilga [mailto:[hidden email]]
Sent: Wednesday, July 25, 2012 10:49 AM
To: Monster Menus Development
Cc: Tove Tronslien
Subject: Re: Views & Arguments

I have been meaning to add the ability for MM to attach views to pages, but other projects have taken priority. In the meantime, you can use any of the various modules which will turn a view into a node type or field in a node, such as http://drupal.org/project/viewfield .

On 7/25/12 11:39 AM, Tove Tronslien wrote:
> I have successfully used Monster Menu and Views, however, without
> using arguments.
>
> Now I'm trying to pass arguments but I have not been successful at
> doing so.
>
> I've been using contextual filter and tried both the Taxonomy term ID
> from url and Raw URL. The Preview test works well, but nothing is
> displayed in the node calling the view.
>
> Also, with added arguments, the view no longer display the "No Results
> Behavior."
>
> So, two questions
> 1) How does the view receive the arguments and
> 2) What can I do to make sure No Results Behavior appears (maybe
> linked to question 1?)
>
--
Dan Wilga                                 [hidden email]
Web System Administrator/Programmer             http://www.amherst.edu
Amherst College                                      Tel: <a href="tel:413-542-2175" value="+14135422175">413-542-2175
Amherst, MA  01002


---
You are currently subscribed to monster_menus as: [hidden email].
To unsubscribe click here: http://lists.middlebury.edu/u?id=849053.214f550f57fa54a976b5f2d087b6d379&n=T&l=monster_menus&o=679798
or send a blank email to [hidden email]

---
You are currently subscribed to monster_menus as: [hidden email].
To unsubscribe click here: http://lists.middlebury.edu/u?id=685439.7e7cbccf9bb225cf8471bffe1cb67503&n=T&l=monster_menus&o=679799
or send a blank email to [hidden email]

---

You are currently subscribed to monster_menus as: [hidden email].

To unsubscribe click here: http://lists.middlebury.edu/u?id=685503.6b071f880fe6a965a128164e6d09ea81&n=T&l=monster_menus&o=679801

(It may be necessary to cut and paste the above URL if the line is broken)

or send a blank email to [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Views & Arguments

ttronslien
In reply to this post by ttronslien
Thank you Ian, Dan, and Jay for super quick responses. 

I completely forgot that Insert View is NOT part of Drupal MM and yes, it was recommended during DrualCon. You have all put me on the right track. 

Dan, totally understand the concept of time, or lack thereof.


Tove Tronslien, MSc, Informatics
Manager, Web Development Services
Lakehead University
Thunder Bay | Orillia, Ontario, Canada
[hidden email]
(807) 343-8499


On Wed, Jul 25, 2012 at 11:52 AM, Ian McBride <[hidden email]> wrote:
My first suggestion would be to check that the arguments entered in the contextual filter are the right ones. You can add something like this to your node template to see the current arguments:

<?php
$args = arg();
var_dump($args);
?>

With a node displayed on a Monster Menus page, arg(0) is always going to be 'mm' and arg(1) is going to be the mmtid, so if you're expecting arg(1) to be a taxonomy tid, it might actually be arg(3) or arg(5) depending on the rest of the request.

On Wed, Jul 25, 2012 at 11:46 AM, Tove Tronslien <[hidden email]> wrote:
Update to No Results Behavior.

It is now acting as expected after ensuring that the "Action to take if filter values does not validate" was properly configured for the  Contextual Filter (that will be handling the passed argument).

Tove Tronslien, MSc, Informatics
Manager, Web Development Services
Lakehead University
Thunder Bay | Orillia, Ontario, Canada
[hidden email]
<a href="tel:%28807%29%20343-8499" value="+18073438499" target="_blank">(807) 343-8499


On Wed, Jul 25, 2012 at 11:39 AM, Tove Tronslien <[hidden email]> wrote:
I have successfully used Monster Menu and Views, however, without using arguments.

Now I'm trying to pass arguments but I have not been successful at doing so.

I've been using contextual filter and tried both the Taxonomy term ID from url and Raw URL. The Preview test works well, but nothing is displayed in the node calling the view.

Also, with added arguments, the view no longer display the "No Results Behavior."

So, two questions
1) How does the view receive the arguments and
2) What can I do to make sure No Results Behavior appears (maybe linked to question 1?)

In advance,
thank you

Tove Tronslien, MSc, Informatics
Manager, Web Development Services
Lakehead University
Thunder Bay | Orillia, Ontario, Canada
[hidden email]
<a href="tel:%28807%29%20343-8499" value="+18073438499" target="_blank">(807) 343-8499

---

You are currently subscribed to monster_menus as: [hidden email].

To unsubscribe click here: http://lists.middlebury.edu/u?id=857556.923faf2f511f9d2b6990f78983c62c3e&n=T&l=monster_menus&o=679796

(It may be necessary to cut and paste the above URL if the line is broken)

or send a blank email to [hidden email]


---

You are currently subscribed to monster_menus as: [hidden email].

To unsubscribe click here: http://lists.middlebury.edu/u?id=685439.7e7cbccf9bb225cf8471bffe1cb67503&n=T&l=monster_menus&o=679797

(It may be necessary to cut and paste the above URL if the line is broken)

or send a blank email to [hidden email]


---

You are currently subscribed to monster_menus as: [hidden email].

To unsubscribe click here: http://lists.middlebury.edu/u?id=857556.923faf2f511f9d2b6990f78983c62c3e&n=T&l=monster_menus&o=679800

(It may be necessary to cut and paste the above URL if the line is broken)

or send a blank email to [hidden email]


---

You are currently subscribed to monster_menus as: [hidden email].

To unsubscribe click here: http://lists.middlebury.edu/u?id=685503.6b071f880fe6a965a128164e6d09ea81&n=T&l=monster_menus&o=679802

(It may be necessary to cut and paste the above URL if the line is broken)

or send a blank email to [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Views & Arguments

ttronslien
In reply to this post by ttronslien
If anybody is interested - this is what I ended up doing:

Used Views 3 to create my view(s)
Created my context filters (argument to be passed via URL)

Created a new module (with view dependency), currently with one function

function lu_views_get($view_name, $args){
$display_id = 'page';
print views_embed_view($view_name, $display_id, $args);
}

In the content filter I call the function - passing over the view name and the arguments to the view
Each argument has to be separated by a comma and is passed over in the same order as they are defined in the view.

And if anybody can see any reason for why I should not do it this way - please feel free to speak up.

Thanks

Tove Tronslien, MSc, Informatics
Manager, Web Development Services
Lakehead University
Thunder Bay | Orillia, Ontario, Canada
[hidden email]
(807) 343-8499


On Wed, Jul 25, 2012 at 11:55 AM, Tove Tronslien <[hidden email]> wrote:
Thank you Ian, Dan, and Jay for super quick responses. 

I completely forgot that Insert View is NOT part of Drupal MM and yes, it was recommended during DrualCon. You have all put me on the right track. 

Dan, totally understand the concept of time, or lack thereof.


Tove Tronslien, MSc, Informatics
Manager, Web Development Services
Lakehead University
Thunder Bay | Orillia, Ontario, Canada
[hidden email]
<a href="tel:%28807%29%20343-8499" value="+18073438499" target="_blank">(807) 343-8499


On Wed, Jul 25, 2012 at 11:52 AM, Ian McBride <[hidden email]> wrote:
My first suggestion would be to check that the arguments entered in the contextual filter are the right ones. You can add something like this to your node template to see the current arguments:

<?php
$args = arg();
var_dump($args);
?>

With a node displayed on a Monster Menus page, arg(0) is always going to be 'mm' and arg(1) is going to be the mmtid, so if you're expecting arg(1) to be a taxonomy tid, it might actually be arg(3) or arg(5) depending on the rest of the request.

On Wed, Jul 25, 2012 at 11:46 AM, Tove Tronslien <[hidden email]> wrote:
Update to No Results Behavior.

It is now acting as expected after ensuring that the "Action to take if filter values does not validate" was properly configured for the  Contextual Filter (that will be handling the passed argument).

Tove Tronslien, MSc, Informatics
Manager, Web Development Services
Lakehead University
Thunder Bay | Orillia, Ontario, Canada
[hidden email]
<a href="tel:%28807%29%20343-8499" value="+18073438499" target="_blank">(807) 343-8499


On Wed, Jul 25, 2012 at 11:39 AM, Tove Tronslien <[hidden email]> wrote:
I have successfully used Monster Menu and Views, however, without using arguments.

Now I'm trying to pass arguments but I have not been successful at doing so.

I've been using contextual filter and tried both the Taxonomy term ID from url and Raw URL. The Preview test works well, but nothing is displayed in the node calling the view.

Also, with added arguments, the view no longer display the "No Results Behavior."

So, two questions
1) How does the view receive the arguments and
2) What can I do to make sure No Results Behavior appears (maybe linked to question 1?)

In advance,
thank you

Tove Tronslien, MSc, Informatics
Manager, Web Development Services
Lakehead University
Thunder Bay | Orillia, Ontario, Canada
[hidden email]
<a href="tel:%28807%29%20343-8499" value="+18073438499" target="_blank">(807) 343-8499

---

You are currently subscribed to monster_menus as: [hidden email].

To unsubscribe click here: http://lists.middlebury.edu/u?id=857556.923faf2f511f9d2b6990f78983c62c3e&n=T&l=monster_menus&o=679796

(It may be necessary to cut and paste the above URL if the line is broken)

or send a blank email to [hidden email]


---

You are currently subscribed to monster_menus as: [hidden email].

To unsubscribe click here: http://lists.middlebury.edu/u?id=685439.7e7cbccf9bb225cf8471bffe1cb67503&n=T&l=monster_menus&o=679797

(It may be necessary to cut and paste the above URL if the line is broken)

or send a blank email to [hidden email]


---

You are currently subscribed to monster_menus as: [hidden email].

To unsubscribe click here: http://lists.middlebury.edu/u?id=857556.923faf2f511f9d2b6990f78983c62c3e&n=T&l=monster_menus&o=679800

(It may be necessary to cut and paste the above URL if the line is broken)

or send a blank email to [hidden email]


---

You are currently subscribed to monster_menus as: [hidden email].

To unsubscribe click here: http://lists.middlebury.edu/u?id=857556.923faf2f511f9d2b6990f78983c62c3e&n=T&l=monster_menus&o=679802

(It may be necessary to cut and paste the above URL if the line is broken)

or send a blank email to [hidden email]


---

You are currently subscribed to monster_menus as: [hidden email].

To unsubscribe click here: http://lists.middlebury.edu/u?id=685503.6b071f880fe6a965a128164e6d09ea81&n=T&l=monster_menus&o=679831

(It may be necessary to cut and paste the above URL if the line is broken)

or send a blank email to [hidden email]

Loading...