updated some more modules
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
[intro]
|
||||
title = Introduction
|
||||
file = intro
|
||||
weight = 1
|
||||
|
||||
[presets]
|
||||
title = Presets
|
||||
file = presets
|
||||
weight = 2
|
||||
@@ -0,0 +1,17 @@
|
||||
<p>CER's purpose is to keep reference fields synchronized with each other.
|
||||
For example, if you have a node ("Alice") with a user reference field,
|
||||
and a user ("Bob") with a node reference field, and you make Alice
|
||||
reference Bob, CER will automatically give Bob a back-reference to Alice. If
|
||||
Alice subsequently dereferences Bob, Bob will automatically deference Alice.
|
||||
Or, if Alice is deleted, Bob will lose his reference to Alice. CER does all
|
||||
this transparently.</p>
|
||||
|
||||
<p>CER is a powerful module. It lets you create relationships between different
|
||||
"reference-type" fields. A <dfn>reference-type</dfn> field is, simply,
|
||||
any kind of field that references another entity. Out of the box, CER supports
|
||||
Entity Reference, Node Reference, User Reference, and core Taxonomy Term
|
||||
Reference fields. It also includes a pair of add-on modules supporting Profile2
|
||||
and Commerce Product Reference fields. CER also has an object-oriented plugin
|
||||
API that you can leverage if you need to support other types of reference
|
||||
fields or alter CER's behavior. (More information about CER's API
|
||||
can be found in cer.api.php.)</p>
|
||||
@@ -0,0 +1,49 @@
|
||||
<p>When you install CER, it won’t do anything at all until you create at least
|
||||
one <dfn>preset</dfn>. A preset is a relationship between two reference field
|
||||
instances, which are referred to as the left and right fields, respectively.
|
||||
When a change occurs in the left field, the right field will react — and
|
||||
vice-versa.</p>
|
||||
|
||||
<p>An example: suppose you have a user reference field called Author, and it
|
||||
lives on Page nodes. You also have a node reference field called My Pages, and
|
||||
it lives on users. You can set up a preset that looks like this:</p>
|
||||
|
||||
<p>Node: Page: Author <--> User: My Pages</p>
|
||||
|
||||
<p>In this case, Author is the left field and My Pages is the right field. When
|
||||
the Author field is changed on a Page node, the referenced user(s) will be
|
||||
given a back-reference to that node.</p>
|
||||
|
||||
<p>By default, presets are <dfn>bidirectional</dfn>. This means that a change
|
||||
on either side of the preset will affect the other side. The previous example
|
||||
is bidirectional: you can change Author or My Pages, and the other side
|
||||
will react accordingly.</p>
|
||||
|
||||
<p>It's possible to make a preset <dfn>one-directional</dfn>, which means that
|
||||
the right side will react when the left side changes, but NOT the other way
|
||||
around. In a one-directional preset, changes to the right field will have no
|
||||
effect on the left field.</p>
|
||||
|
||||
<p>A one-directional version of the above example would look like this:</p>
|
||||
|
||||
<p>Node: Page: Author —> User: My Pages</p>
|
||||
|
||||
<p>So what this means is that, in a bidirectional preset, it really doesn't
|
||||
matter which field is the left one and which is the right one. They’ll affect
|
||||
each other equally. But in a one-directional preset, it <em>does</em> matter
|
||||
which side you're on. CER allows you to "invert" (flip) a
|
||||
one-directional preset.</p>
|
||||
|
||||
<p>Internally, CER treats all reference-type fields the same way, which allows
|
||||
you to put a different kind of field on either side of a preset. You don't
|
||||
have to necessarily relate a node reference field to another node reference
|
||||
field. You could relate a node reference field to a user reference field. The
|
||||
only restriction is that each side of the preset must be able to reference the
|
||||
other side. So, to again use our example, Author needs to be able to reference
|
||||
users, and My Pages needs to be able to reference nodes (of the Page type).
|
||||
CER won't let you create relationships between fields that can’t actually
|
||||
relate.</p>
|
||||
|
||||
<p>CER presets are entities built on top of Entity API, and they can be
|
||||
imported and exported just like any other exportable entity type, including
|
||||
support for Features.</p>
|
||||
Reference in New Issue
Block a user