New Haven Monthly Meetup

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
nflowers1228's picture
Start: 
2011-08-10 18:00 - 20:00 UTC
Organizers: 
Event type: 
User group meeting

Time: 6:00 - 8:00 PM
2 Whitney Ave, New Haven, CT 3rd Floor Conference room
You must have a photo ID to gain access to the building after 5:00 pm

Please posts topics that you would like to discuss; possibly we could each come with a module/topic to speak for 10 minutes; anyone who can speak to any topic is welcome to present.

I'll add the chipin snippet for pizza when we get closer :-)

Comments

Discussion topics

nickap's picture

Hi Nancy - I've posted this as a possible area of discussion for Drupal Camp also, but ... Perhaps at the meeting someone would like to give an overview of how to use Views Arguments and Relationships? It seems like I am constantly finding that one or both of these appears to be the answer to something tricky I am trying to do with Views, and many of the tutorials and explanations online are only partially helpful. If we could talk this through perhaps with a specific example or two (I have one ready-made!) that would be really helpful.

Sounds like a great topic,

nflowers1228's picture

Sounds like a great topic, perhaps you could post your examples so people could think about it or we could just brainstorm at the meeting. I'm a bit fuzzy when it comes to arguments as well.

Nancy Flowers-Mangs

Here's an example - this one

nickap's picture

Here's an example - this one proved to be quite simple once I found the answer, but it took me hours to find it - and I have to admit, even now that I have it - and know that it works - I am still not 100% sure HOW it works. It would be great if someone more savvy could talk about this topic ...

I wanted to create a content type of "Featured Links" which would allow a user to enter a few links, and specify page(s) on the site on which the links would appear - the links would then appear in a box in the right column of all the pages specified. At first I thought that I would have them enter a string of node ids for pages on which the links should appear - then I realized that the node reference CCK field would be perfect - users could enter as many pages as they wanted using autocomplete fields.

The tricky part - tricky for me, anyway - was setting up a block view which would check the node of the current page, and display the block IF that node was one of the ones specified in the node reference field. Seemed like it should be simple but it took me a long time to figure out how to do it. The solution I eventually found was to set up an argument on the node reference field, choose the "Provide default argument" option under "Action to take if argument is not present" list, select PHP code as the default argument type, and then enter the following PHP snippet:

if (arg(0) == 'node' && is_numeric(arg(1))) {
$node = node_load(arg(1));
return $node->nid;
} else {
return false;
}

Works like a charm - but I'm still not quite sure exactly what the code is doing, and how it is triggered by setting the argument - and I would love to get a little more of a handle on this type of thing ....

Just wanted to report back on

nickap's picture

Just wanted to report back on the suggestion that came up in yesterday's meeting that setting the default argument options to "Node ID from URL" would work just as well as using the code above - yes, I tried it out and that is correct, it works just fine. So I'm not sure why this code was ever suggested as a solution to this problem - except perhaps if the Node ID from URL was not available in some earlier version of Drupal .... Anyway, thanks for the tip - and Nancy, thanks for organizing again - it was a very informative meeting!

Schedule

RoloDMonkey's picture

I just wanted to confirm the schedule for the monthly meetups. I want to set up a recurring reminder in my calendar. Did we agree on the second Wednesday of every month?

Learn more at iRolo.net.

yes second Wednesday of every

nflowers1228's picture

yes second Wednesday of every month...

Nancy Flowers-Mangs

chip-in?

RoloDMonkey's picture

Is there a chip-in set up for this meeting? Do you need people to bring anything?

Learn more at iRolo.net.

Chipin for Pizza

nflowers1228's picture

Please, everyone who is coming click on Signup. So far there is only one other person besides me. The topic is Arguments and relationships with views. Should prove to be interesting.

http://augustnewhavendrupalgroup.chipin.com/august-new-haven-drupalgroup...

Nancy Flowers-Mangs

too late to signup?

sclapp's picture

just checking - think I can make it down there tonight... finally...

Arguments Follow-Up

nickap's picture

I just came across (by chance) the answer to one of the questions that had puzzled me about arguments - why under "Action to take if argument not present", I can then have PHP code that appears to use arguments: "if (arg(0) == 'node' && is_numeric(arg(1))) {" ...

This page explains it very clearly: http://drupal.org/node/611152

Specifically, that there are two different types of arguments:

<<<<

Lets understand the two different types of arguments that are available:
$args and arg() - yes there's a difference.

$args – are arguments that are being passed to the view, so if you have a page view and it has this url
www.mysite.com/pageview

then the arguments are what comes after the page view
www.mysite.com/pageview/first/2/third

$args[0] = "first"
$args[1] = 2
$args[2] = "third"

The second type of argument is the stuff that comes after the website url.
So if I'm looking at a node:
www.mysite.com/node/12

then

arg(0) ="node"
arg(1) =12

Connecticut

Group categories

County or Region

Event Type

Featured Item (Admin Only)

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: