45
Building a Dynamic Multisite Presence Offtheshelf Eric Johnson @elstudio Cindy McCourt @cindymcqt 1

Doing Drupal Multi-site without code

Embed Size (px)

DESCRIPTION

Building a Dynamic Multi-site Presence Off-the-shelf Just because you can create customize functionality in your Drupal site, that doesn’t mean you need to. Come see how SGIA.org transformed their web presence by coloring within the lines. Not only did they build three websites on one installation and incorporate commerce functionality, they also created an online experience dedicated to ensuring their audience can find the rich and useful content they offer. We would like to share with you the strategies we used, the issues we faced, and the solutions we devised. This includes: - Tagging strategies and related content - Not your typical search functionality - Transitioning strategies to move between three themes - Commerce functionality and multiple domains Slides from our 2014 CapitalCampDC presentation. http://2014.capitalcampandgovdays.com/capital-camp-and-gov-days/sessions/building-dynamic-multi-site-presence-shelf

Citation preview

Page 1: Doing Drupal Multi-site without code

Building  a  Dynamic  Multi-­‐site  Presence  Off-­‐the-­‐shelf

Eric  Johnson  @elstudio  Cindy  McCourt  @cindymcqt

1

Page 2: Doing Drupal Multi-site without code

0.  INTRODUCTIONSHow  to  succeed  in  multi-­‐site  building  without  really  coding

2

Page 3: Doing Drupal Multi-site without code

Eric  Johnson

• Developer,  Proprietor  of  el-­‐studio.com    

• Integrator  of  AMS/CRM/Drupal  Commerce  

• Loves  writing  code.  But  do  we  really  need  to?  

• “There’s  more  than  one  way  to  do  it”

3

@elstudio  http://el-­‐studio.com  

Page 4: Doing Drupal Multi-site without code

Cindy  McCourt

• Site  builder  • Author  of  Drupal:  The  Guide  to  Planning  &  Building  Websites  

• Translates  between  tech  &  less-­‐tech  folks    

• Taught  the  SGIA  team  what  they  need  to  know  about  fields,  content  types,  taxonomy

4

@cindymcqt  http://idcminnovations.com/contact  

Page 5: Doing Drupal Multi-site without code

SGIA  

• Trade  association  represents  several  specialties  – Garment  decorators  – Color  graphics  – Industrial  

• A  wealth  of  content  • An  AMS  tracks  people  &  memberships  – Memberships  determine  the  level  of  access  onsite

5

@SGIA_graphics  www.sgia.org  

Page 6: Doing Drupal Multi-site without code

What  about  you?

• Need  to  address  multiple  audiences  with  one  editorial  team?  

• Want  help  with  Drupal’s  more-­‐than-­‐one-­‐way-­‐to-­‐do-­‐it?  • Multi-­‐site  • Search  • Content  targeting

6

Who  me?  by  Regina

Page 7: Doing Drupal Multi-site without code

1.  GOALSFor  the  project,  and  for  the  development  team

7

Page 8: Doing Drupal Multi-site without code

Project  goals[...]    

1. Address  SGIA's  separate  Garment  Decorators  and  Graphics  audiences  with  distinct-­‐but-­‐related  website  designs  and  targeted  content  

2. Implement  a  standard  look  and  feel  across  a  decade  worth  of  how-­‐tos  and  technical  resources

8

Page 9: Doing Drupal Multi-site without code

Project  goals[...]    

3. Expose  all  SGIA  content  -­‐-­‐  web  pages,  spreadsheets,  Word  and  PDF  documents  -­‐-­‐  to  full-­‐text  search  

4. Suggest  related  content  dynamically,  based  on  tags  and  full-­‐text  content  analysis  

5. Allow  convenient  access  from  both  mobile  and  desktop  browsers

9

Page 10: Doing Drupal Multi-site without code

Project  goals[...]    

6. Build  staff  capacity  with  Drupal  so  that  future  site  enhancements  can  benefit  from  SGIA's  in-­‐house  graphics  and  programming  expertise

10

Page 11: Doing Drupal Multi-site without code

Dev  team  goals  

• No  code  is  best  • Somebody  else's  code  is  better  • Write  code  as  last  resort

11

Page 12: Doing Drupal Multi-site without code

2.  THEMESDesign:  Fabulous,  separate,  themes

12

Page 13: Doing Drupal Multi-site without code

Shared  base  theme  (sgia_base)  

13

Page 14: Doing Drupal Multi-site without code

SGIA_garment  theme  

14

Page 15: Doing Drupal Multi-site without code

SGIA_expo  theme  

15

Page 16: Doing Drupal Multi-site without code

Consider:  So  how  do  we  switch  between  themes?  

• Standard  Drupal  Multisite  • Great  for  separate  sites  —  with  separate  databases,  users,  content  etc.  

• Domain  Access  modules[...]  

16

Page 17: Doing Drupal Multi-site without code

Domain  Access  allows  Shared  Content…  

17See  Trellon's  Developer  blog  for  details

Page 18: Doing Drupal Multi-site without code

Consider:  So  how  do  we  switch  between  themes?  

• Standard  Drupal  Multisite  • Domain  Access  module[...]    • But  I  don't  want  to  have  separate  users,  database  tables,  DNS  configurations,  etc.  I  just  want  to  switch  themes.    

• Help  me,  big  blue  drop!

18

Page 19: Doing Drupal Multi-site without code

Themekey  module!

• Switches  theme  based  on  path  – Choose  Expo  theme  if  path  is  /expo/*  – Choose  Garment  theme  if  /garment/*  

• Or  a  node's  taxonomy  terms  – Failing  that,  set  theme  based  directly  on  [field-­‐subsite]  

– Reset  to  Base  theme  if  needed

19

Page 20: Doing Drupal Multi-site without code

Themekey  Rulesets[...]    

20

Page 21: Doing Drupal Multi-site without code

Explicit  Theme  Selection  

21

field_subsite,  a  list  field,  rules  the  themes

Page 22: Doing Drupal Multi-site without code

Pathauto  URL  alias  sets  a  page's  path  based  on  the  [field-­‐subsite]  taxonomy  vocabulary  

22

Page 23: Doing Drupal Multi-site without code

Choose  Expo  theme  if  path  is  /expo/*  

23

Page 24: Doing Drupal Multi-site without code

Failing  that,  set  theme  based  directly  on  [field-­‐subsite]  

24

Page 25: Doing Drupal Multi-site without code

Reset  to  Base  theme  if  needed  

25

Page 26: Doing Drupal Multi-site without code

3.  CONTENTFor  each  audience,  and  for  multiple  audiences

26

Page 27: Doing Drupal Multi-site without code

Taxonomy  Has  Many  Jobs

• Assign  content  to  different  community  audiences  • Select  the  appropriate  theme  

• Site  architecture  • Establish  content  relationships

27

Page 28: Doing Drupal Multi-site without code

Communities

28

Community,  a  taxonomy  vocabulary,  indicates  which  audiences  the  content  targets  

Page 29: Doing Drupal Multi-site without code

Site  Architecture

29

Page 30: Doing Drupal Multi-site without code

Related  Content  Relies  on  Tags

30

Page 31: Doing Drupal Multi-site without code

Related  Content  via  Views

31

Page 32: Doing Drupal Multi-site without code

4.  SEARCHAdapting  search  results  to  our  audiences

32

Page 33: Doing Drupal Multi-site without code

Regular  search[...]  

33

Page 34: Doing Drupal Multi-site without code

Garment  search[...]  

34

Page 35: Doing Drupal Multi-site without code

Separate  search  boxes  for  each  theme

• Results  optimized  for  each  audience  – Regular  search[...]    – Garment  searches  only  Garment  content[...]    • Nodes  where  Community  is  Garment  • field_vocab_community_tref  contains  “Garment”  • Configuration:  an  apachesolr  search  page  with  custom  filters[...]  

35

Page 36: Doing Drupal Multi-site without code

Configuration:  an  apachesolr  search  page  with  custom  filters[...]    

36

Page 37: Doing Drupal Multi-site without code

Search  views  augment  featured  content[...]  

37

Page 38: Doing Drupal Multi-site without code

Configuration:  An  apachesolr_search  view  

38

Page 39: Doing Drupal Multi-site without code

Consider:  SearchAPI  vs  apachesolr

• SearchAPI  does  a  better  job  of  supporting  views  &  Drupally  stuff  like  entity  display  modes  —Can  talk  to  Solr,  using  the  search_api_solr  module  —It  loads  nodes  before  you  or  views  sees  them,  so  search_api_views  act  like  you'd  expect  

—Because  it's  loading  nodes,  it  can  also  be  less  efficient  than  apachesolr...

39

Page 40: Doing Drupal Multi-site without code

Consider:  SearchAPI  vs  apachesolr

• apachesolr  is  much  closer  to  Solr  than  Drupal  –Must  know  solr  lingo  to  configure  it:  "im_field_vocab_community_tref:2"  

– apachesolr_views  can  require  4+  patches  to  get  common  use  cases  working  

– But  apachesolr_attachments  is  the  game  in  town  for  indexing  Word,  PDF  or  other  file  attachments

40

Page 41: Doing Drupal Multi-site without code

5.  COMMERCEMulti-­‐site  considerations  for  commerce

41

Page 42: Doing Drupal Multi-site without code

Commerce  Implications

• We  ran  commerce  on  a  single  domain  • SSL  can  be  an  issue  • Yes,  Either  buy  a  wildcard  SSL  certificate  • That’s  a  cert  for  *.sgia.org  

• But  Apache  SSL  requires  a  separate  IP  per  SSL  domain    

• Or  run  them  singly

42

Page 43: Doing Drupal Multi-site without code

6.  RECAPWhat  have  we  learned  today?

43

Page 44: Doing Drupal Multi-site without code

What  have  we  learned?

• You  can  do  lots  of  Drupal  without  writing  code  

• There’s  more  than  one  way  to  do  it  

• Ask:  How  can  I  empower  the  team?  

• Just  because  you  can,  doesn’t  mean  you  should

44

School  by  Elizabeth  Albert

Page 45: Doing Drupal Multi-site without code

Questions?  Drop  us  a  line…

45

Cindy  McCourt  @cindymcqt  http://idcminnovations.com/contact  

Eric  Johnson  @elstudio  http://el-­‐studio.com