Closed (fixed)
Project:
Relation
Version:
7.x-1.x-dev
Component:
Documentation
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
22 May 2011 at 15:51 UTC
Updated:
20 Jul 2011 at 04:11 UTC
Jump to comment: Most recent
Comments
Comment #1
heather commentedCase: We have parent
pages, which manually link to specific child articles.
I chose parent/child because it has the notion of a relationship
built in, should I pick a different kind of example? For example,
a "City Guide" with highlighted travel articles (could also be
reviews, or hotels, etc). Should I call the relation "related articles"?
Tutorial
Step 1. Enable the Relation modules (Relation, Relation block,
and Relation Dummy field).
Step 2. Next, place the "Relation block/Relation Dropzone block"
in a sidebar, or somewhere accessible from all pages on your site.
Step 3. Define a relation. Example, "parent".
Go to Structure > Relation > Click + Add.
unique. In this case, transitive. (Not sure what to pick in this
case!)
children). In this case, Articles.
the parents). In this case, Pages.
A relation can have fields attached to it, however our case doesn't
require fields.
Step 4. Next, collect entities to create a relationship.
entities to "pick an entity". Use the dropdown menu to select
which entity, an Article in this case, and click Pick.
You will now see two entities listed, the article you picked,
and the page you picked.
https://skitch.com/heatherjames/fya4e/create-relation
alt="Create relation" />
type-ahead feature will show the possible relations.
You will get a message that a relation has been created, and you
can visit the relation page. From there you can delete the
individual relation. You cannot edit relations, to change it, you
must delete and re-create it.
Next steps:
What can a site builder do with relations?
This... I haven't figured out yet :)
Comment #2
naught101 commentedStep 3: that's a relation type you're creating there, not a relation.
transitivity isn't working yet. directionality is only partly working, but your parent relation is definitely directional (although you need to specify "has Parent" or "Parent of", as they are opposite directions). If you use directional, I think you need to pick the "from" part of the relation first.
You may as well make it unique, there's no instance that I can think of where you'd want a duplicated parent relation.
Your parent relation type could have fields, if you wanted to make the tutorial more detailed, eg: type: select with "biological", "step", "foster", etc.
You can edit fields on a relation, just not the endpoints of the relation.
Nice start, though I think you'll probably have to go into more detail in some parts (especially the hard to grok parts). Feel free to ask as many questions as you need, and I'll answer with as much detail as I can.
Comment #3
RonP commentedNaught it would be interesting to see what comments you could add to the document itself.
Can I suggest copy/pasting it and adding thoughts in brackets for the fine person to edit clearly.
As it stands I think I may need to use the other project as I don't understand the lingo in the module nor the description.
Comment #4
naught101 commentedIsn't that what I just did? I can't edit Heather's comments...
If you have specific questions, feel free to ask, but please make sure you've read all of the documentation in the module, especially the CONCEPTS.txt and the README: http://drupalcode.org/project/relation.git/tree/refs/heads/7.x-1.x
Comment #5
heather commentedheya!
sorry I have been plowing away on a big project I am testing next week. i plan to dig into my d.o threads after june 15th.
i will read all relevant documentation before making any new contributions to make sure i'm not duplicating effort.
thanks for the tip!
Comment #6
hlynn1 commented[I started this in the #1165292: Clarify the UI text for relationship types thread before I realized it should probably go here instead...]
Not to reopen the can of worms, but for the entity relationship newbies among us, it might help to compare what it means when "directional" and "transitive" are true, and what it means when they're false. Here's one crack at it:
Consider the Smiths, a family of five: Mom and Dad, kids John, Jenny and Jeff, and Bill the frog.
is_parent, Mom can be John's parent, but John can't be Mom's parent.is_sibling, Jenny can be Jeff's sibling, and Jeff can be Jenny's sibling.Let's say John is Bill the frog's owner, by the relation
has_pet: John > has_pet > BillNow let's consider the transitive property using the relation
has_member: Smith Family > has_member > Johnhas_memberrelation is conveyed by John to Bill the frog through thehas_petrelation.has_petrelation, but membership in the family stops with Bill at thehas_memberrelation because it is not transitive — In this case, Bill the frog is not a member of the Smith Family.Thoughts? Do I even have it right?
Comment #7
kirkilj commentedFrom my understanding of a transitive relation, your example would not hold. I always thought that in a transitive relation, the relation_type had to be the same. How would Drupal know that has-pet is functionally equivalent to has-member? I don't recall hearing anything about the Relation project going to this length this early in its evolution. It could be done, but it might complicate the queries a bit. It would be cool if it did. I'm a Drupal newbie, so I'm just speculating on any implementation details.
If the relation_types are the same, then the implied transitivity is easy for a query to determine.
If you used grandparent, parent, child, then you could say that the has-ancestor or has-descendant were transitive.
My thoughts anyway.
Comment #8
naught101 commentedkirkilj is correct. Transitivity only Applies to relations that are of the same type.
I also agree that it's possible that there's a good reason to allow transitivity between relations of certain types, but that will be fairly complicated, and will need a separate feature request. I think many would argue that the example given, that Bill is a member of the Smith Family, is not true. A potentially better use-case is the simple inequality: A<B; B<=C implies A<C, but I don't know whether something like that would actually be useful on a CMS.
Comment #9
naught101 commentedHeather, is that enough feedback? if no, feel free to re-open.