I'm looking at creating a pet medical record site mainly for myself but eventually will open it so that others can use the site to keep their pet records organized.

I'm not really sure the best way to go about creating the organization of the site to get the desired effect I want. Wondering if I could get some pointers.

1. The site should only allow users to see the pet records they created and not anyone else's. Best way to achieve this?
2. Best way to allow a user to create multiple pets (which I'm assuming will be a node content type) and then each pet will have information attached to it. One of the things attached to it would be vet visits. I've attached some pics of some examples of what i have in mind.

The Layout i'm thinking would be something like the following:
user logs in and is shown a listing of their pets which a link to add one.
User can click on a pet and it opens the pet detail page that page will have subtabs such as Pet Info, Medical, Training, Photos.

The Pet Info tab will be the default and will list all the info about the pet, age, weight, color, breed, identifying marks, microchip id, etc. The medical tab will list vet visits with the ability to add a new visit. User can click on a visit and it will open and show the details of that visit. User can add, edit, or delete visits.

http://dsuguy.com/petdetails.jpg

http://dsuguy.com/medical.jpg

Comments

WorldFallz’s picture

  1. node_view_permissions or content_access
  2. each type of page should be a content type and you would relate them with entityreference and entityreference_prepopulate

For the layout checkout the views module in combination with panels and/or ds (display suite). For tabs you can use views (see views advanced help), quicktabs, or a theme that uses tabs (like the core bartik theme).

This type of site is definitely in drupal's wheelhouse.

dsuguy’s picture

Thanks WorldFallz,

I found Content Access and I think it will work best for what i'm looking to do.

I've got some other sites with drupal so I'm pretty familiar with it but I've never used the entityreference modules. I'll have to do some research on how to use them.

thanks for the feedback.

WorldFallz’s picture

Definitely worth learning-- it's such an important module it has been added to core for d8. It's basically an entity aware reference module that combines nodereference and userreference from d6 cck. See http://nodeone.se/en/learn-entity-reference for an excellent place to start.

dsuguy’s picture

So I created 3 content types:
*Pet
*Pet Details
*Pet Medical

I created an entity reference field on the Details and Medical content types and set it to reference Pet. I enabled the entity reference prepopulate via url and set that to work but not sure how to make that work.

I created a block using Views to show Title with link to the users Pet nodes. I'm using Content Access to limit access to only the users created Pet, Pet Details, and Pet Medical nodes.

I'm at a loss as to how to create the screen for the Pet Details and Pet Medical tabs when the user clicks on the Pet's name in the block.

dsuguy’s picture

I'm willing to pay someone to help me get this setup.

WorldFallz’s picture

If you want to hire someone, you're probably better off posting to the paid services forum. But if you've built other sites, you should be able to figure it out.

I enabled the entity reference prepopulate via url and set that to work but not sure how to make that work.

Not sure what you mean... what is it you're trying to do?

I'm at a loss as to how to create the screen for the Pet Details and Pet Medical tabs when the user clicks on the Pet's name in the block

There's probably a few ways to so it, but I would probably make tabbed views for pet details and pet medical pages (you'll need to use a contextual filter for the pet nid in each view), and then make the block title link to those pages instead (you can use the rewrite option in the field settings for this).

Another way to do it would be to put the details and medical records right on the pet page with views and the eva module.

dsuguy’s picture

I'm not that good with views as far as using relationships and contextual filters. I just don't understand it.

I'll post over in the paid services forum and see if I can get something there. Thanks!

WorldFallz’s picture

good luck.

And in case you decide to tackle it yourself, checkout the excellent free series on views over at nodeone: http://nodeone.se/en/taming-the-beast-learn-views-with-nodeone (particularly chap 11 and 19-24). imo hands down the best tutorials for learning relationships & contextual filters.

dsuguy’s picture

So that tutorial was very helpful. I attempted to use views but couldn't figure that out to work. Did some more digging and found Reference Tabs module https://drupal.org/project/references_tabs
This works great. I'll just need to do some styling with CSS.

Now the question is, how do I get the node reference to automatically reference the Pet node when a user creates a pet with details and medical?

I wonder if the webform module might be an option.

WorldFallz’s picture

I hadn't seen that module before-- nice find. The only that bothers me is that it doesn't work for entityreference which has superseded references and nodereference and was added to core for d8. But whatever works! In order to auto reference the pet, you would use nodereference_url for the nodereference module as opposed to entityreference_prepopulate for the entityreference module.

And no, webform is not the way to go for site content. For a good explanation of when to use content types vs webform, see https://drupal.org/documentation/modules/webform#webform-vs-cck.

CIA’s picture

Maybe I missed it, but what is the template you used to create it with the tabs and things you described?