18. WWhhaatt iiss aa rreellaattiioonnsshhiippss??
User Author’s Name
18
Content
Menu category
•Starters
•Appetizers
Image
Content type
(taxonomy)
19. Why?
You want to maintain a single copy / instance of
your data.
Your web site reference the single copy /
instance of your data.
If you change the data, it is changed through out
the web site.
19
23. RReellaattiioonnsshhiippss
Author / user create a content node
An image is associated with a content node
A taxonomy term associated with a content node
Another entity associated with a content node
23
24. RReellaattiioonnsshhiipp // SSQQLL VViieeww
INNER JOIN:
Returns all rows when there
is at least one match in
BOTH tables.
LEFT JOIN:
Return all rows from the left
table, and the matched rows
from the right table.
24
26. How do you create a
relationship?
Setup a field as an entity reference EExxaammppllee ((33))
26
27. RReellaattiioonnsshhiipp EExxaammpplleess
Display an customer order EExxaammppllee ((33))
Restaurant customer order relationships:
Waiter / staff
Item order reference menu dish
27
28. VViieewwss
AAdddd rreellaattiioonnsshhiippss
Views – Add relationship Example (3)
Referenced – Read entity referenced from
source
View is based upon Customer Order and reading
Staff, and Dish information
Referencing – Read source from entity
reference
View is based upon Staff and reading Customer
Order information.
28
29. WWhhaatt iiss aaggggrreeggaattiioonn??
Groups “things” in a useful way.
Aggregation means to collect, combine, and / or
summarize data in some useful form.
In the context of views tables, aggregation is:
The process of grouping and compressing row
Based on the values of one or more columns
While applied summary (aggregation) functions on
other columns.
Count, sum, minimum, maximum, etc.
29
30. Why?
Organize your content in a meaningful way.
Calculate summary totals
30
35. NNaattiivvee VViieewwss
AAggggrreeggaattiioonn
Aggregation is the process of grouping and
compressing result rows based on the values of
ONE OR MORE columns.
Does NOT generate grand totals
35
38. NNaattiivvee VViieewwss
AAggggrreeggaattiioonn
RReessttaauurraanntt ssuurrvveeyy EExxaammppllee ((55))
38
CT – Menu Item
CT – Customer Survey
CT – Customer Order
CT – Wait staff
CT - Menu section
39. VViieewwss AAggggrreeggaattiioonn
PPlluuss
Aggregation is the process of grouping and
compressing result rows based on the values of
only ONE columns, while applied summary
(aggregation) functions on other columns.
Does generate a grand total.
39
40. VViieewwss AAggggrreeggaattiioonn
PPlluuss
Download & enable the views_aggregator
module (aka Views Aggregation Plus)
This add a new “format” in views
Table with aggregation options
Use table with aggregation Settings
Disables / over rides native Views aggregation
EExxaammpplleess
RReessttaauurraanntt mmeennuu EExxaammppllee ((66))
SSoonnss ooff AAmmeerriiccaann VVeetteerraannss
40
42. Views conditionals
mmoodduullee:: vviieewwss__ccoonnddiittiioonnaall EExxaammppllee ((77))
You want to check some condition before you
decided to the field should be displayed.
In my case, I check a person’s role before decide
if they have the permissions to see a specific
field..
EExxaammppllee
42
43. Download a table
into a CSV file
mmoodduulleess:: vviieewwss__ddaattaa__eexxppoorrtt
The module view data export will allow you to
download your table view into a comma
separated value (CSV) file.
43
44. Make a table view “responsive”
mmoodduullee:: ttaabbllee ttrraasshh
While we cannot make a table view truly
responsive, this does the next best thing.
When the table view is displayed on a tablet or a
phone, table trash hides the required number of
columns so that the report will fit on the device.
To expand the report the user can then click on
the plus next to the line in which they are
interested.
44