[support] HELP! with Views and relational data

Shai Gluskin shai at content2zero.com
Thu Mar 5 04:18:23 UTC 2009


Chris,

I think this is a good place to start:

http://drupal.org/node/289738

at DrupalCon...

shai

On Wed, Mar 4, 2009 at 7:13 PM, Chris McCreery <chris.mccreery at gmail.com>wrote:

> Thanks Shai I have created some views in the new ui before. Would you be
> able to explain or point me to a good reference for creating the
> relationships?
>
> Thank you so much.
>
>
> On Wed, Mar 4, 2009 at 6:33 PM, Shai Gluskin <shai at content2zero.com>wrote:
>
>> Chris... Have you used Views yet to set up any simpler views yet? It would
>> be nice to get the new Ui under your belt a bit before tackling something
>> more complex.
>>
>> But in any case... The key to getting what you want is by setting up
>> relationships between the different content types. You do that in the views
>> ui. Once you set up a relationship you'll be able to create views that pull
>> in content based on the relationship you have established.
>>
>> I hope this us enough to get you started.
>>
>> Shai
>>
>> On Mar 4, 2009, at 6:10 PM, Chris McCreery <chris.mccreery at gmail.com>
>> wrote:
>>
>> Alright Shai I am now up and running in Drupal 6 and have got my site back
>> to where I had it before minus the Views. Based on my initial requirements
>> would you be able to give me a hand with how I should set up these views?
>>
>> Thanks
>>
>> On Wed, Mar 4, 2009 at 10:14 AM, Chris McCreery <<chris.mccreery at gmail.com>
>> chris.mccreery at gmail.com> wrote:
>>
>>> Thanks Shai, I've decided to just start over from scratch rather than
>>> upgrading. I think it will be more beneficial to start again and rethink
>>> some of my decisions.
>>>
>>> So based on that any suggestions as to which modules to use in 6 or the
>>> best ways to properly create the relations between user and program, user
>>> and attendance tracking, program and attendance-tracking?
>>>
>>>
>>> On Wed, Mar 4, 2009 at 9:35 AM, Shai Gluskin < <shai at content2zero.com>
>>> shai at content2zero.com> wrote:
>>>
>>>> Chris,
>>>>
>>>> Check out... Content Profile
>>>>
>>>> <http://drupal.org/project/content_profile>
>>>> http://drupal.org/project/content_profile
>>>>
>>>> Shai
>>>>
>>>>
>>>> On Wed, Mar 4, 2009 at 8:48 AM, Chris McCreery <<chris.mccreery at gmail.com>
>>>> chris.mccreery at gmail.com> wrote:
>>>>
>>>>> I was using Usernode in Drupal 5 is there a new replacement for that?
>>>>> or how will I upgrade that?
>>>>>
>>>>>
>>>>> On Wed, Mar 4, 2009 at 8:47 AM, Chris McCreery <<chris.mccreery at gmail.com>
>>>>> chris.mccreery at gmail.com> wrote:
>>>>>
>>>>>> Quicky.... Alright Shai you've convinced me. I am running 6 on a few
>>>>>> other sites and yes it is great. I'll give it a try and let you know how I
>>>>>> make out. Thanks again for all the help.
>>>>>>
>>>>>>
>>>>>> On Tue, Mar 3, 2009 at 9:50 PM, Shai Gluskin <<shai at content2zero.com>
>>>>>> shai at content2zero.com> wrote:
>>>>>>
>>>>>>> Chris,
>>>>>>>
>>>>>>> A quicky version of upgrading, you might want to check other sources.
>>>>>>>
>>>>>>>
>>>>>>>    1. Back up your files and database.
>>>>>>>    2. Hopefully, you haven't hacked core or contrib modules. If you
>>>>>>>    have, document them well.
>>>>>>>    3. If you don't have update_status installed, install it now now
>>>>>>>    and run it. Then update all your Drupal 5 modules to their most current
>>>>>>>    version in for *Drupal 5*. Along the way, you should probably
>>>>>>>    check the project page for each of your modules to see if there are any
>>>>>>>    relevant notes for upgrading to Drupal 6. Definitely read the instructions
>>>>>>>    for upgrading for CCK.
>>>>>>>    4. Turn off all contrib module and themes. (Some people don't do
>>>>>>>    this on "point upgrades" (e.g. 5.14 to 5.15) -- but I think it is the
>>>>>>>    consensus to do this on major upgrades (e.g. D5 - D6).
>>>>>>>    5. You can now dispose of the files in your installation except
>>>>>>>    be sure to keep handy customizations you have made to. (I keep these all in
>>>>>>>    a separate place though, start with a fresh install and place the
>>>>>>>    customizations back into the fresh installation:
>>>>>>>       1. .htaccess file in the root directory
>>>>>>>       2. a php.ini file if you have one.
>>>>>>>       3. connection settings and any other settings you've turned on
>>>>>>>       in the settings.php file
>>>>>>>       4. files directory
>>>>>>>       5. custom modules you've created
>>>>>>>       6. custom theme
>>>>>>>    6. Download via tar balls or CVS the D6 core and the D6 versions
>>>>>>>    of all your modules.
>>>>>>>    7. Place your contrib modules in: sites/all/modules
>>>>>>>    8. Go to sites/default/default.settings.php and:
>>>>>>>       1. duplicate it
>>>>>>>       2. change the new copy's name to: settings.php
>>>>>>>       3. edit the file to put in the connection settings and any
>>>>>>>       other settings turned on that you previously needed.
>>>>>>>    9. If you had made changes to your site's .htaccess file, you can
>>>>>>>    now make those same changes to the fresh install
>>>>>>>    10. navigate to example.com/update.php (don't freak out if there
>>>>>>>    are errors)
>>>>>>>    11. Turn on CCK and run update.php again (follow the instructions
>>>>>>>    on the project page of cck)
>>>>>>>    12. Turn on the rest of your modules
>>>>>>>    13. Turn on the theme
>>>>>>>
>>>>>>> Some of your views might not work -- just create them again with the
>>>>>>> new Views. It's good practice. You might as well learn the new Views on
>>>>>>> views that your already understand well. Views2 is amazing, but there is a
>>>>>>> learning curve.
>>>>>>>
>>>>>>> You might need to place your blocks again.
>>>>>>>
>>>>>>> Your custom theme might need some work. There is lots of info at
>>>>>>> Drupal.org about this. Shouldn't be too hard though, depending on
>>>>>>> complicated your site is.
>>>>>>>
>>>>>>> Good luck. It is really worth it. Drupal 6 is awesome!
>>>>>>>
>>>>>>> Report back.
>>>>>>>
>>>>>>> Shai
>>>>>>>
>>>>>>>
>>>>>>> On Tue, Mar 3, 2009 at 9:02 PM, Chris McCreery <<chris.mccreery at gmail.com>
>>>>>>> chris.mccreery at gmail.com> wrote:
>>>>>>>
>>>>>>>> Well when I first started this project there were a number of
>>>>>>>> modules that weren't ready for drupal 6 and of course the client has taken
>>>>>>>> their sweet time getting back to me on every possible detail so I bet now
>>>>>>>> everything would work in drupal 6 but I'm not very familiar with the entire
>>>>>>>> upgrade process nor can I afford the time currently to upgrade the site. I
>>>>>>>> might just start over from scratch at this point.
>>>>>>>>
>>>>>>>> Is there any particular detail I should be worried about upgrading?
>>>>>>>> I have a custom theme that I had to create and a bunch of calculations in
>>>>>>>> cck computed fields. Is it fairly straightforward to upgrade all those
>>>>>>>> aspects?
>>>>>>>>
>>>>>>>> After upgrading to 6 what would be my best option for getting the
>>>>>>>> results I wanted from what I detailed before?
>>>>>>>>
>>>>>>>> Thanks again for the help.
>>>>>>>>
>>>>>>>>
>>>>>>>> On Tue, Mar 3, 2009 at 4:35 PM, Shai Gluskin <<shai at content2zero.com>
>>>>>>>> shai at content2zero.com> wrote:
>>>>>>>>
>>>>>>>>> Chris,
>>>>>>>>>
>>>>>>>>> What you are talking about is really complex in D5 requiring custom
>>>>>>>>> coding. It is almost trivial to do in D6 with Views2.
>>>>>>>>>
>>>>>>>>> Also, it isn't really that hard to upgrade sites to D6, depending
>>>>>>>>> of course on complexity. But you wouldn't have to start over.
>>>>>>>>>
>>>>>>>>> What is the functionality that D5 provides that you think D6
>>>>>>>>> doesn't?
>>>>>>>>>
>>>>>>>>> Shai
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Tue, Mar 3, 2009 at 4:09 PM, Chris McCreery <<chris.mccreery at gmail.com>
>>>>>>>>> chris.mccreery at gmail.com> wrote:
>>>>>>>>>
>>>>>>>>>> Ok unfortunately I have already started this project and some
>>>>>>>>>> other areas rely on some 5 modules so I can't convert to 6.
>>>>>>>>>>
>>>>>>>>>> This is what I want to accomplish.
>>>>>>>>>> User logs in creates a profile(usernode) which includes location
>>>>>>>>>> information
>>>>>>>>>> The user can then create a Program(eg. indoor basketball)
>>>>>>>>>> Now the user can create an attendance tracking node for the
>>>>>>>>>> program they created above.
>>>>>>>>>> Users only have access to the content they created.
>>>>>>>>>>
>>>>>>>>>> For reporting purposes as the administrator I would like to be
>>>>>>>>>> able to see all the programs created for example by province, organization,
>>>>>>>>>> or other data stored in the user profile(usernode) as well I would like to
>>>>>>>>>> see all the attendance reports by organization, province, postal code, etc.
>>>>>>>>>> The issue I think here is that the user shouldn't have to select their own
>>>>>>>>>> organization or  province, postal code when creating a new program or
>>>>>>>>>> attendance tracking as this should be created by a relationship to the
>>>>>>>>>> usernode. Sorry if i'm not too clear here I'm a bit confused as to how I can
>>>>>>>>>> do this in drupal.
>>>>>>>>>>
>>>>>>>>>> Thanks
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On Tue, Mar 3, 2009 at 1:39 PM, Shai Gluskin <<shai at content2zero.com>
>>>>>>>>>> shai at content2zero.com> wrote:
>>>>>>>>>>
>>>>>>>>>>> Chris,
>>>>>>>>>>>
>>>>>>>>>>> This is not a comprehensive response...
>>>>>>>>>>>
>>>>>>>>>>> First, what you are talking about is much easier to do in Drupal
>>>>>>>>>>> 6/Views 2 than it is with Drupal 5.
>>>>>>>>>>>
>>>>>>>>>>> The Sign up module is excellent:
>>>>>>>>>>> <http://drupal.org/project/signup>
>>>>>>>>>>> http://drupal.org/project/signup
>>>>>>>>>>>
>>>>>>>>>>> It works with either a Date field or with the Event module. I'm
>>>>>>>>>>> not sure if the signup module has Views integration.
>>>>>>>>>>>
>>>>>>>>>>> So in short, I'd start with D6, Views, Signup, and Date as the
>>>>>>>>>>> core components to build what you want.
>>>>>>>>>>>
>>>>>>>>>>> Shai
>>>>>>>>>>>
>>>>>>>>>>> On Tue, Mar 3, 2009 at 10:33 AM, Chris McCreery <<chris.mccreery at gmail.com>
>>>>>>>>>>> chris.mccreery at gmail.com> wrote:
>>>>>>>>>>>
>>>>>>>>>>>> Hi I am creating a site that has the following content types:
>>>>>>>>>>>>
>>>>>>>>>>>>    - Organization (Usernode)
>>>>>>>>>>>>    - Program (define a program)
>>>>>>>>>>>>    - Attendance Tracking (track attendance for that program)
>>>>>>>>>>>>
>>>>>>>>>>>> I would like to create an admin view that shows me all the
>>>>>>>>>>>> details for either program or the attendance tracking with data from the
>>>>>>>>>>>> usernode. For example:
>>>>>>>>>>>>
>>>>>>>>>>>> Program Name
>>>>>>>>>>>> Organization Name
>>>>>>>>>>>> Province
>>>>>>>>>>>> Country
>>>>>>>>>>>> Postal Code
>>>>>>>>>>>>
>>>>>>>>>>>> I'm just wondering what is the best way to have the Program and
>>>>>>>>>>>> Attendance tracking content types reference this data. Would I need to
>>>>>>>>>>>> create computed fields that query the database separately to get them into
>>>>>>>>>>>> the content type?
>>>>>>>>>>>>
>>>>>>>>>>>> Thanks, any help would be much appreciated.
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> --
>>>>>>>>>>>> Chris McCreery
>>>>>>>>>>>>
>>>>>>>>>>>> --
>>>>>>>>>>>> [ Drupal support list | <http://lists.drupal.org/>
>>>>>>>>>>>> http://lists.drupal.org/ ]
>>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> --
>>>>>>>>>>> [ Drupal support list | <http://lists.drupal.org/>
>>>>>>>>>>> http://lists.drupal.org/ ]
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>> Chris McCreery
>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>> [ Drupal support list | <http://lists.drupal.org/>
>>>>>>>>>> http://lists.drupal.org/ ]
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> [ Drupal support list | <http://lists.drupal.org/>
>>>>>>>>> http://lists.drupal.org/ ]
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> Chris McCreery
>>>>>>>>
>>>>>>>> --
>>>>>>>> [ Drupal support list | <http://lists.drupal.org/>
>>>>>>>> http://lists.drupal.org/ ]
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> [ Drupal support list | <http://lists.drupal.org/>
>>>>>>> http://lists.drupal.org/ ]
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Chris McCreery
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Chris McCreery
>>>>>
>>>>> --
>>>>> [ Drupal support list | <http://lists.drupal.org/>
>>>>> http://lists.drupal.org/ ]
>>>>>
>>>>
>>>>
>>>> --
>>>> [ Drupal support list | <http://lists.drupal.org/>
>>>> http://lists.drupal.org/ ]
>>>>
>>>
>>>
>>>
>>> --
>>> Chris McCreery
>>>
>>
>>
>>
>> --
>> Chris McCreery
>>
>> --
>> [ Drupal support list | http://lists.drupal.org/ ]
>>
>>
>> --
>> [ Drupal support list | http://lists.drupal.org/ ]
>>
>
>
>
> --
> Chris McCreery
>
> --
> [ Drupal support list | http://lists.drupal.org/ ]
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20090304/0903f700/attachment-0001.htm 


More information about the support mailing list