SlideShare une entreprise Scribd logo
1  sur  75
Télécharger pour lire hors ligne
Part 3: Backing up
your views!
acquia.com
1Wednesday, May 15, 2013
Heather James
Manager of Training at Acquia
HELLO!
@learningdrupal
@hjames
2Wednesday, May 15, 2013
Acquia Training
http://training.acquia.com
3Wednesday, May 15, 2013
In todayʼs webinar!
• Views mini course
- May 2nd: Introduction to Views
- May 8th: How to build flexible views
- May 15th: Build your first module to back up your views! <- Here!
• Drupal essentials!
- May 22nd: Drupal Essentials: How to Configure Accounts in Drupal
• Drupal for Project Managers mini-course
- May 29th-June 19th: 4 weeks - Drupal for Project Managers!
Adam Boysen, Jakub Suchy, Amye Scavarda, Jenn Sramek
4Wednesday, May 15, 2013
Notes online!
5Wednesday, May 15, 2013
What weʼre doing today
• Best practices to finish your view
• Caching
• Backing up views
• If we have time: Theming Views - quick look!
6Wednesday, May 15, 2013
What you need to know already!
• How to add content
• How to customize content types (add fields)
• What modules are
• How to install and configure modules
• From last week: How Views works, how to add a new
View
7Wednesday, May 15, 2013
FINISHING YOUR
VIEWS
Final checks
8Wednesday, May 15, 2013
Final checks
9Wednesday, May 15, 2013
Don’t forget! 1
2
3
4
6
5
7
10Wednesday, May 15, 2013
Views QA
http://www.zivtech.com/blog/views-quality-checklist
11Wednesday, May 15, 2013
Disable the Views UI
• Finished? Disable the Views UI module.
•
12Wednesday, May 15, 2013
Tip!
• Enabled modules eat your memory. If it’s not
in use- Disable it!
• If you’re never going to use it again, uninstall
it, and remove from file system too!
13Wednesday, May 15, 2013
Caching
14Wednesday, May 15, 2013
All done?
• Enable caching to store query and output.
15Wednesday, May 15, 2013
Site caching basics
• Set lifetime to minimum 5 minutes.
• Will your content editors freak out?
https://www.acquia.com/blog/when-and-how-caching-can-save-
your-site-part-2-authenticated-users
16Wednesday, May 15, 2013
Save your site
• Read Hernani’s blog posts!
https://www.acquia.com/blog/when-and-how-caching-can-save-
your-site-part-2-authenticated-users
17Wednesday, May 15, 2013
What to cache
• Blocks
• Pages
• Don’t cache admin views.
• User bookmarks - places where people
expect immediate response.
http://www.millwoodonline.co.uk/blog/drupal-7-performance-
gains-with-views-cache
18Wednesday, May 15, 2013
Block cache type
19Wednesday, May 15, 2013
Block cache
20Wednesday, May 15, 2013
Debugging?
• Disable caching when debugging
21Wednesday, May 15, 2013
Demo
• Block and page cache settings under
performance
• Views cache options!
22Wednesday, May 15, 2013
Smart cache option
• Views content cache
• http://drupal.org/project/
views_content_cache
23Wednesday, May 15, 2013
EXPORT TO A
MODULE
A better way
24Wednesday, May 15, 2013
Dangerous
• Views configuration is saved in the database.
• Editing a view on a live site
• Letting someone else edit the view on a live
site.
• What if your precious View was ruined :(
25Wednesday, May 15, 2013
Quick and dirty: Export
26Wednesday, May 15, 2013
Import manually
27Wednesday, May 15, 2013
Demo
• Export code to a text file.
• Easy!
28Wednesday, May 15, 2013
Better: Export to module
• In code instead of storing them in the
database.
• Can managed by your version control system
- easier to push change from development to
staging to production.
• Modest performance improvement due to
loading from disk and not database.
http://www.deckfifty.com/blog/2012-02/using-drupal-views-code
Example code available at http://j.mp/ZhgWFn 
29Wednesday, May 15, 2013
hook_views_default_views()
• http://api.drupal.org/api/views/views.api.php/
function/hook_views_default_views/7
• Allows you to set a default view and
configuration in code.
Example code available at http://j.mp/ZhgWFn 
30Wednesday, May 15, 2013
Create a module
• Two text files
• deliciousdrupal.info
• deliciousdrupal.module
Example code available at http://j.mp/ZhgWFn 
31Wednesday, May 15, 2013
Tip: Custom folder
• Custom modules?
• Add them in a “custom” folder.
• /custom
• /contrib
32Wednesday, May 15, 2013
Info file
• deliciousdrupal.info
Example code available at http://j.mp/ZhgWFn 
33Wednesday, May 15, 2013
Module file
• deliciousdrupal.module
• Declare hook_views_api()
• You can paste the exported view directly, but
that is messy.
34Wednesday, May 15, 2013
Easier to maintain: Includes
• Keep the includes in a separate folder
Example code available at http://j.mp/ZhgWFn 
35Wednesday, May 15, 2013
Example code available at http://j.mp/ZhgWFn 
36Wednesday, May 15, 2013
Easier to scale: Each view its own file
• Export each view and allow your module to
scan for new views.
37Wednesday, May 15, 2013
Demo: Backup a new view
• Back up a view, adding to the module.
• 1. New text file - machine name of view.
• 2. Open with
• 3. Paste exported code
• 4. Save!
38Wednesday, May 15, 2013
Enable the module
Example code available at http://j.mp/ZhgWFn 
39Wednesday, May 15, 2013
Backed up!
• Before:
• After - protected from deletion
40Wednesday, May 15, 2013
Clear cache
• Views > Settings > Advanced
41Wednesday, May 15, 2013
Database overriding code
• Indicates that it’s in code and also saved in
database.
• Go to Views list to see your new views
available.
• Click “Revert” to delete database copy.
42Wednesday, May 15, 2013
Changes?
• Working in staging site.
• Your colleague “edits” a view and tests
changes.
• Export and save to your .views include files.
• Add new Views the same way:
• Export
• Add PHP declaration
• Save as .view in your includes folder
43Wednesday, May 15, 2013
Add a new view?
• Back up a view, adding to the module.
• 1. New text file - machine name of view.
• 2. Open with
• 3. Paste exported code
• 4. Save!
• 5. Clear cache! <-- now that module is
already enabled.
44Wednesday, May 15, 2013
Recap
• Various states:
• “In database” - Not exported to code
• “Database overriding code”
• “In code” - No changes saved in database
• Actions:
• “Edit” - Create a copy in database with
changes
• “Revert” - Delete from database
• “Disable” - Views in code can’t be deleted!
45Wednesday, May 15, 2013
Features
• This works the same way as Features.
• Basic module file
• Exported code
• This is what Features does for you
automatically.
http://drupal.org/project/features
46Wednesday, May 15, 2013
THEMING VIEWS
47Wednesday, May 15, 2013
What you may expect
Mock up
Design
Comps
Configure
and build
site
Drape over
theme
Done!
48Wednesday, May 15, 2013
“Markup megalomaniac”
Design in
static HTML
and CSS
Configure
prototype
in core
theme
Modify TPL to
match original
markup
Configure
to modify
markup
Build style
guide and
reusable
classes
Done!
49Wednesday, May 15, 2013
“Skeleton and skin”
Skeleton:
Regions and
CSS for
structure
Skin:
CSS for visual
design
Done!
Content
type design
Configure
prototype
of site
Configure
to modify
markup
50Wednesday, May 15, 2013
Recap Views UI
1
2
5
4
3
6
51Wednesday, May 15, 2013
Example
• Recent comments View
52Wednesday, May 15, 2013
Anatomy of a View
View
That's great news! 50 min 32 sec ago
Oh I see, so even if i don't 4 weeks 52 min ago
Custom subject heading 4 weeks 53 min ago
Row
Title field
Date field
53Wednesday, May 15, 2013
Nested templates
Display
Format (style)
Field
Row
Field
Field
Row
Field
54Wednesday, May 15, 2013
View default output
• Depends on Views settings
55Wednesday, May 15, 2013
Configure to customize
• Modify format
• Specify elements
• Add classes
• Strip markup
• Strip default classes
• Make some fields
inline
56Wednesday, May 15, 2013
Example
57Wednesday, May 15, 2013
Views base templates
58Wednesday, May 15, 2013
Example
59Wednesday, May 15, 2013
How can I find this?
60Wednesday, May 15, 2013
Which is being used?
61Wednesday, May 15, 2013
Display and format
62Wednesday, May 15, 2013
Template suggestions
• All fields (default)
• All fields just in blocks
• Any subject fields just in blocks
• Just subject fields in blocks in recent
comments view
63Wednesday, May 15, 2013
Overriding
Copy into your theme folder and rename
64Wednesday, May 15, 2013
Rescan template files
65Wednesday, May 15, 2013
Next up!
• Check out the blog for notes from this 3 part class
• Drupal essentials
- May 22nd: Drupal Essentials: How to Configure Accounts in Drupal
• Drupal for Project Managers mini-course
- May 29th-June 19th: 4 weeks - Drupal for Project Managers! Adam
Boysen, Jakub Suchy, Amye Scavarda, Jenn Sramek
66Wednesday, May 15, 2013
Events! Learn in person
• http://acquia.com/events
• http://training.acquia.com/events
• http://dublin2013.drupaldays.org/
• http://www.drupical.com/
67Wednesday, May 15, 2013
VIEWS NEXT STEPS!
Your assignment
68Wednesday, May 15, 2013
Your assignment
• Last week you made a view, right?
• This week:
• Add a display with an attachment
• Make a contextual filter or use a
relationship
• Add a link to your menu
• Watch tutorials 4 parts, 5 mins each!
http://www.drupalgardens.com/content/new-
views-tutorials-4-part-intro
69Wednesday, May 15, 2013
Views webinar!
• Tips and Tricks for Getting the Most Out of
Views [April 30, 2013]
• http://j.mp/mostviews
• Suzanne Kennedy, Evolving Web - one of our
training partners.
http://training.acquia.com/events/canada
• DrupalCon: Mastering Views Configuration
• http://portland2013.drupal.org/node/3718
70Wednesday, May 15, 2013
Views tutorials
• Quick version: 4 parts, 5 mins
each!
http://
www.drupalgardens.com/
content/new-views-tutorials-4-
part-intro
• Drupalize.me
http://drupalize.me/videos/
overview-views
• 10 part series with “Toronto
Web Developer”
http://j.mp/Zc8nEO
71Wednesday, May 15, 2013
TRAINING!
72Wednesday, May 15, 2013
Course materials
• Tested in hundreds of
classrooms.
• Continuously updated.
• Clear and easy follow, but
engaging content.
• Blend of guided and
challenge exercises to
test skills.
http://training.acquia.com/courses
The materials /
handouts were very
comprehensive -
personally I would not
change anything.
- O.G. Jan 2012
73Wednesday, May 15, 2013
The trainers are partners
• Our trainers are
experienced developers
who love teaching.
• They provide subject
matter expertise as well
as well as passion for the
topic.
• Partners are placed all
over the globe.
http://training.acquia.com/testimonials
Lovely presenter, very
patient and open to
questions. I feel a lot
more confident to use
drupal myself and
understand the
technical
underpinnings.
- C.L., Sept 2012
74Wednesday, May 15, 2013
• Popular packages are typical examples of the tailored
packages we have delivered.
Tailored courses available
http://training.acquia.com/events
TRAINING@ACQUIA.COM
75Wednesday, May 15, 2013

Contenu connexe

Similaire à Views Mini-Course, Part III: How to Back Up Your Views Safely

Preventing Drupal Headaches: Content Type Checklist
Preventing Drupal Headaches: Content Type ChecklistPreventing Drupal Headaches: Content Type Checklist
Preventing Drupal Headaches: Content Type Checklist
Acquia
 
There's a Module for That, MIMA Summit 2010
There's a Module for That, MIMA Summit 2010There's a Module for That, MIMA Summit 2010
There's a Module for That, MIMA Summit 2010
Emma Jane Hogbin Westby
 
FALLSEM2022-23_SWE2029_TH_VL2022230101289_Reference_Material_I_26-09-2022_Scr...
FALLSEM2022-23_SWE2029_TH_VL2022230101289_Reference_Material_I_26-09-2022_Scr...FALLSEM2022-23_SWE2029_TH_VL2022230101289_Reference_Material_I_26-09-2022_Scr...
FALLSEM2022-23_SWE2029_TH_VL2022230101289_Reference_Material_I_26-09-2022_Scr...
duhitha2
 

Similaire à Views Mini-Course, Part III: How to Back Up Your Views Safely (20)

Content Editing & Admin in Drupal 7
Content Editing & Admin in Drupal 7 Content Editing & Admin in Drupal 7
Content Editing & Admin in Drupal 7
 
Preventing Drupal Headaches: Content Type Checklist
Preventing Drupal Headaches: Content Type ChecklistPreventing Drupal Headaches: Content Type Checklist
Preventing Drupal Headaches: Content Type Checklist
 
Agile framework
Agile frameworkAgile framework
Agile framework
 
Continuous integration
Continuous integrationContinuous integration
Continuous integration
 
24 scrum
24 scrum24 scrum
24 scrum
 
24-scrum.ppt
24-scrum.ppt24-scrum.ppt
24-scrum.ppt
 
Scrum and Agile Software Development
Scrum and Agile Software DevelopmentScrum and Agile Software Development
Scrum and Agile Software Development
 
Introduction to Drupal for Absolute Beginners
Introduction to Drupal for Absolute BeginnersIntroduction to Drupal for Absolute Beginners
Introduction to Drupal for Absolute Beginners
 
Groovy & Grails eXchange 2012 - Building an e-commerce business with gr8 tec...
Groovy & Grails eXchange 2012 - Building an  e-commerce business with gr8 tec...Groovy & Grails eXchange 2012 - Building an  e-commerce business with gr8 tec...
Groovy & Grails eXchange 2012 - Building an e-commerce business with gr8 tec...
 
WordPress updates - Why You Can't Live Without Them
WordPress updates - Why You Can't Live Without ThemWordPress updates - Why You Can't Live Without Them
WordPress updates - Why You Can't Live Without Them
 
Speed up Rails Responses
Speed up Rails ResponsesSpeed up Rails Responses
Speed up Rails Responses
 
Drupal: Internet Lego - What Modules Do I Use?
Drupal: Internet Lego - What Modules Do I Use?Drupal: Internet Lego - What Modules Do I Use?
Drupal: Internet Lego - What Modules Do I Use?
 
There's a Module for That, MIMA Summit 2010
There's a Module for That, MIMA Summit 2010There's a Module for That, MIMA Summit 2010
There's a Module for That, MIMA Summit 2010
 
FALLSEM2022-23_SWE2029_TH_VL2022230101289_Reference_Material_I_26-09-2022_Scr...
FALLSEM2022-23_SWE2029_TH_VL2022230101289_Reference_Material_I_26-09-2022_Scr...FALLSEM2022-23_SWE2029_TH_VL2022230101289_Reference_Material_I_26-09-2022_Scr...
FALLSEM2022-23_SWE2029_TH_VL2022230101289_Reference_Material_I_26-09-2022_Scr...
 
Scrum toufiq
Scrum toufiqScrum toufiq
Scrum toufiq
 
Branding office 365 with front end tooling
Branding office 365 with front end toolingBranding office 365 with front end tooling
Branding office 365 with front end tooling
 
Open drupal DrupalCamp Gent 2018
Open drupal DrupalCamp Gent 2018Open drupal DrupalCamp Gent 2018
Open drupal DrupalCamp Gent 2018
 
WordPress Questions and Answers Session
WordPress Questions and Answers SessionWordPress Questions and Answers Session
WordPress Questions and Answers Session
 
XPages Blast - Ideas, Tips and More
XPages Blast - Ideas, Tips and MoreXPages Blast - Ideas, Tips and More
XPages Blast - Ideas, Tips and More
 
Top 20 Drupal Mistakes newbies make
Top 20 Drupal Mistakes newbies makeTop 20 Drupal Mistakes newbies make
Top 20 Drupal Mistakes newbies make
 

Plus de Acquia

Taking Your Multi-Site Management at Scale to the Next Level
Taking Your Multi-Site Management at Scale to the Next LevelTaking Your Multi-Site Management at Scale to the Next Level
Taking Your Multi-Site Management at Scale to the Next Level
Acquia
 

Plus de Acquia (20)

Acquia_Adcetera Webinar_Marketing Automation.pdf
Acquia_Adcetera Webinar_Marketing Automation.pdfAcquia_Adcetera Webinar_Marketing Automation.pdf
Acquia_Adcetera Webinar_Marketing Automation.pdf
 
Acquia Webinar Deck - 9_13 .pdf
Acquia Webinar Deck - 9_13 .pdfAcquia Webinar Deck - 9_13 .pdf
Acquia Webinar Deck - 9_13 .pdf
 
Taking Your Multi-Site Management at Scale to the Next Level
Taking Your Multi-Site Management at Scale to the Next LevelTaking Your Multi-Site Management at Scale to the Next Level
Taking Your Multi-Site Management at Scale to the Next Level
 
CDP for Retail Webinar with Appnovation - Q2 2022.pdf
CDP for Retail Webinar with Appnovation - Q2 2022.pdfCDP for Retail Webinar with Appnovation - Q2 2022.pdf
CDP for Retail Webinar with Appnovation - Q2 2022.pdf
 
May Partner Bootcamp 2022
May Partner Bootcamp 2022May Partner Bootcamp 2022
May Partner Bootcamp 2022
 
April Partner Bootcamp 2022
April Partner Bootcamp 2022April Partner Bootcamp 2022
April Partner Bootcamp 2022
 
How to Unify Brand Experience: A Hootsuite Story
How to Unify Brand Experience: A Hootsuite Story How to Unify Brand Experience: A Hootsuite Story
How to Unify Brand Experience: A Hootsuite Story
 
Using Personas to Guide DAM Results: How Life Time Pumped Up Their UX and CX
Using Personas to Guide DAM Results: How Life Time Pumped Up Their UX and CXUsing Personas to Guide DAM Results: How Life Time Pumped Up Their UX and CX
Using Personas to Guide DAM Results: How Life Time Pumped Up Their UX and CX
 
Improve Code Quality and Time to Market: 100% Cloud-Based Development Workflow
Improve Code Quality and Time to Market: 100% Cloud-Based Development WorkflowImprove Code Quality and Time to Market: 100% Cloud-Based Development Workflow
Improve Code Quality and Time to Market: 100% Cloud-Based Development Workflow
 
September Partner Bootcamp
September Partner BootcampSeptember Partner Bootcamp
September Partner Bootcamp
 
August partner bootcamp
August partner bootcampAugust partner bootcamp
August partner bootcamp
 
July 2021 Partner Bootcamp
July  2021 Partner BootcampJuly  2021 Partner Bootcamp
July 2021 Partner Bootcamp
 
May Partner Bootcamp
May Partner BootcampMay Partner Bootcamp
May Partner Bootcamp
 
DRUPAL 7 END OF LIFE IS NEAR - MIGRATE TO DRUPAL 9 FAST AND EASY
DRUPAL 7 END OF LIFE IS NEAR - MIGRATE TO DRUPAL 9 FAST AND EASYDRUPAL 7 END OF LIFE IS NEAR - MIGRATE TO DRUPAL 9 FAST AND EASY
DRUPAL 7 END OF LIFE IS NEAR - MIGRATE TO DRUPAL 9 FAST AND EASY
 
Work While You Sleep: The CMO’s Guide to a 24/7/365 Lead Machine
Work While You Sleep: The CMO’s Guide to a 24/7/365 Lead MachineWork While You Sleep: The CMO’s Guide to a 24/7/365 Lead Machine
Work While You Sleep: The CMO’s Guide to a 24/7/365 Lead Machine
 
Acquia webinar: Leveraging Drupal to Bury Your Sales Team In B2B Leads
Acquia webinar: Leveraging Drupal to Bury Your Sales Team In B2B LeadsAcquia webinar: Leveraging Drupal to Bury Your Sales Team In B2B Leads
Acquia webinar: Leveraging Drupal to Bury Your Sales Team In B2B Leads
 
April partner bootcamp deck cookieless future
April partner bootcamp deck  cookieless futureApril partner bootcamp deck  cookieless future
April partner bootcamp deck cookieless future
 
How to enhance cx through personalised, automated solutions
How to enhance cx through personalised, automated solutionsHow to enhance cx through personalised, automated solutions
How to enhance cx through personalised, automated solutions
 
DRUPAL MIGRATIONS AND DRUPAL 9 INNOVATION: HOW PAC-12 DELIVERED DIGITALLY FOR...
DRUPAL MIGRATIONS AND DRUPAL 9 INNOVATION: HOW PAC-12 DELIVERED DIGITALLY FOR...DRUPAL MIGRATIONS AND DRUPAL 9 INNOVATION: HOW PAC-12 DELIVERED DIGITALLY FOR...
DRUPAL MIGRATIONS AND DRUPAL 9 INNOVATION: HOW PAC-12 DELIVERED DIGITALLY FOR...
 
Customer Experience (CX): 3 Key Factors Shaping CX Redesign in 2021
Customer Experience (CX): 3 Key Factors Shaping CX Redesign in 2021Customer Experience (CX): 3 Key Factors Shaping CX Redesign in 2021
Customer Experience (CX): 3 Key Factors Shaping CX Redesign in 2021
 

Dernier

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Dernier (20)

EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 

Views Mini-Course, Part III: How to Back Up Your Views Safely

  • 1. Part 3: Backing up your views! acquia.com 1Wednesday, May 15, 2013
  • 2. Heather James Manager of Training at Acquia HELLO! @learningdrupal @hjames 2Wednesday, May 15, 2013
  • 4. In todayʼs webinar! • Views mini course - May 2nd: Introduction to Views - May 8th: How to build flexible views - May 15th: Build your first module to back up your views! <- Here! • Drupal essentials! - May 22nd: Drupal Essentials: How to Configure Accounts in Drupal • Drupal for Project Managers mini-course - May 29th-June 19th: 4 weeks - Drupal for Project Managers! Adam Boysen, Jakub Suchy, Amye Scavarda, Jenn Sramek 4Wednesday, May 15, 2013
  • 6. What weʼre doing today • Best practices to finish your view • Caching • Backing up views • If we have time: Theming Views - quick look! 6Wednesday, May 15, 2013
  • 7. What you need to know already! • How to add content • How to customize content types (add fields) • What modules are • How to install and configure modules • From last week: How Views works, how to add a new View 7Wednesday, May 15, 2013
  • 12. Disable the Views UI • Finished? Disable the Views UI module. • 12Wednesday, May 15, 2013
  • 13. Tip! • Enabled modules eat your memory. If it’s not in use- Disable it! • If you’re never going to use it again, uninstall it, and remove from file system too! 13Wednesday, May 15, 2013
  • 15. All done? • Enable caching to store query and output. 15Wednesday, May 15, 2013
  • 16. Site caching basics • Set lifetime to minimum 5 minutes. • Will your content editors freak out? https://www.acquia.com/blog/when-and-how-caching-can-save- your-site-part-2-authenticated-users 16Wednesday, May 15, 2013
  • 17. Save your site • Read Hernani’s blog posts! https://www.acquia.com/blog/when-and-how-caching-can-save- your-site-part-2-authenticated-users 17Wednesday, May 15, 2013
  • 18. What to cache • Blocks • Pages • Don’t cache admin views. • User bookmarks - places where people expect immediate response. http://www.millwoodonline.co.uk/blog/drupal-7-performance- gains-with-views-cache 18Wednesday, May 15, 2013
  • 21. Debugging? • Disable caching when debugging 21Wednesday, May 15, 2013
  • 22. Demo • Block and page cache settings under performance • Views cache options! 22Wednesday, May 15, 2013
  • 23. Smart cache option • Views content cache • http://drupal.org/project/ views_content_cache 23Wednesday, May 15, 2013
  • 24. EXPORT TO A MODULE A better way 24Wednesday, May 15, 2013
  • 25. Dangerous • Views configuration is saved in the database. • Editing a view on a live site • Letting someone else edit the view on a live site. • What if your precious View was ruined :( 25Wednesday, May 15, 2013
  • 26. Quick and dirty: Export 26Wednesday, May 15, 2013
  • 28. Demo • Export code to a text file. • Easy! 28Wednesday, May 15, 2013
  • 29. Better: Export to module • In code instead of storing them in the database. • Can managed by your version control system - easier to push change from development to staging to production. • Modest performance improvement due to loading from disk and not database. http://www.deckfifty.com/blog/2012-02/using-drupal-views-code Example code available at http://j.mp/ZhgWFn  29Wednesday, May 15, 2013
  • 30. hook_views_default_views() • http://api.drupal.org/api/views/views.api.php/ function/hook_views_default_views/7 • Allows you to set a default view and configuration in code. Example code available at http://j.mp/ZhgWFn  30Wednesday, May 15, 2013
  • 31. Create a module • Two text files • deliciousdrupal.info • deliciousdrupal.module Example code available at http://j.mp/ZhgWFn  31Wednesday, May 15, 2013
  • 32. Tip: Custom folder • Custom modules? • Add them in a “custom” folder. • /custom • /contrib 32Wednesday, May 15, 2013
  • 33. Info file • deliciousdrupal.info Example code available at http://j.mp/ZhgWFn  33Wednesday, May 15, 2013
  • 34. Module file • deliciousdrupal.module • Declare hook_views_api() • You can paste the exported view directly, but that is messy. 34Wednesday, May 15, 2013
  • 35. Easier to maintain: Includes • Keep the includes in a separate folder Example code available at http://j.mp/ZhgWFn  35Wednesday, May 15, 2013
  • 36. Example code available at http://j.mp/ZhgWFn  36Wednesday, May 15, 2013
  • 37. Easier to scale: Each view its own file • Export each view and allow your module to scan for new views. 37Wednesday, May 15, 2013
  • 38. Demo: Backup a new view • Back up a view, adding to the module. • 1. New text file - machine name of view. • 2. Open with • 3. Paste exported code • 4. Save! 38Wednesday, May 15, 2013
  • 39. Enable the module Example code available at http://j.mp/ZhgWFn  39Wednesday, May 15, 2013
  • 40. Backed up! • Before: • After - protected from deletion 40Wednesday, May 15, 2013
  • 41. Clear cache • Views > Settings > Advanced 41Wednesday, May 15, 2013
  • 42. Database overriding code • Indicates that it’s in code and also saved in database. • Go to Views list to see your new views available. • Click “Revert” to delete database copy. 42Wednesday, May 15, 2013
  • 43. Changes? • Working in staging site. • Your colleague “edits” a view and tests changes. • Export and save to your .views include files. • Add new Views the same way: • Export • Add PHP declaration • Save as .view in your includes folder 43Wednesday, May 15, 2013
  • 44. Add a new view? • Back up a view, adding to the module. • 1. New text file - machine name of view. • 2. Open with • 3. Paste exported code • 4. Save! • 5. Clear cache! <-- now that module is already enabled. 44Wednesday, May 15, 2013
  • 45. Recap • Various states: • “In database” - Not exported to code • “Database overriding code” • “In code” - No changes saved in database • Actions: • “Edit” - Create a copy in database with changes • “Revert” - Delete from database • “Disable” - Views in code can’t be deleted! 45Wednesday, May 15, 2013
  • 46. Features • This works the same way as Features. • Basic module file • Exported code • This is what Features does for you automatically. http://drupal.org/project/features 46Wednesday, May 15, 2013
  • 48. What you may expect Mock up Design Comps Configure and build site Drape over theme Done! 48Wednesday, May 15, 2013
  • 49. “Markup megalomaniac” Design in static HTML and CSS Configure prototype in core theme Modify TPL to match original markup Configure to modify markup Build style guide and reusable classes Done! 49Wednesday, May 15, 2013
  • 50. “Skeleton and skin” Skeleton: Regions and CSS for structure Skin: CSS for visual design Done! Content type design Configure prototype of site Configure to modify markup 50Wednesday, May 15, 2013
  • 52. Example • Recent comments View 52Wednesday, May 15, 2013
  • 53. Anatomy of a View View That's great news! 50 min 32 sec ago Oh I see, so even if i don't 4 weeks 52 min ago Custom subject heading 4 weeks 53 min ago Row Title field Date field 53Wednesday, May 15, 2013
  • 55. View default output • Depends on Views settings 55Wednesday, May 15, 2013
  • 56. Configure to customize • Modify format • Specify elements • Add classes • Strip markup • Strip default classes • Make some fields inline 56Wednesday, May 15, 2013
  • 60. How can I find this? 60Wednesday, May 15, 2013
  • 61. Which is being used? 61Wednesday, May 15, 2013
  • 63. Template suggestions • All fields (default) • All fields just in blocks • Any subject fields just in blocks • Just subject fields in blocks in recent comments view 63Wednesday, May 15, 2013
  • 64. Overriding Copy into your theme folder and rename 64Wednesday, May 15, 2013
  • 66. Next up! • Check out the blog for notes from this 3 part class • Drupal essentials - May 22nd: Drupal Essentials: How to Configure Accounts in Drupal • Drupal for Project Managers mini-course - May 29th-June 19th: 4 weeks - Drupal for Project Managers! Adam Boysen, Jakub Suchy, Amye Scavarda, Jenn Sramek 66Wednesday, May 15, 2013
  • 67. Events! Learn in person • http://acquia.com/events • http://training.acquia.com/events • http://dublin2013.drupaldays.org/ • http://www.drupical.com/ 67Wednesday, May 15, 2013
  • 68. VIEWS NEXT STEPS! Your assignment 68Wednesday, May 15, 2013
  • 69. Your assignment • Last week you made a view, right? • This week: • Add a display with an attachment • Make a contextual filter or use a relationship • Add a link to your menu • Watch tutorials 4 parts, 5 mins each! http://www.drupalgardens.com/content/new- views-tutorials-4-part-intro 69Wednesday, May 15, 2013
  • 70. Views webinar! • Tips and Tricks for Getting the Most Out of Views [April 30, 2013] • http://j.mp/mostviews • Suzanne Kennedy, Evolving Web - one of our training partners. http://training.acquia.com/events/canada • DrupalCon: Mastering Views Configuration • http://portland2013.drupal.org/node/3718 70Wednesday, May 15, 2013
  • 71. Views tutorials • Quick version: 4 parts, 5 mins each! http:// www.drupalgardens.com/ content/new-views-tutorials-4- part-intro • Drupalize.me http://drupalize.me/videos/ overview-views • 10 part series with “Toronto Web Developer” http://j.mp/Zc8nEO 71Wednesday, May 15, 2013
  • 73. Course materials • Tested in hundreds of classrooms. • Continuously updated. • Clear and easy follow, but engaging content. • Blend of guided and challenge exercises to test skills. http://training.acquia.com/courses The materials / handouts were very comprehensive - personally I would not change anything. - O.G. Jan 2012 73Wednesday, May 15, 2013
  • 74. The trainers are partners • Our trainers are experienced developers who love teaching. • They provide subject matter expertise as well as well as passion for the topic. • Partners are placed all over the globe. http://training.acquia.com/testimonials Lovely presenter, very patient and open to questions. I feel a lot more confident to use drupal myself and understand the technical underpinnings. - C.L., Sept 2012 74Wednesday, May 15, 2013
  • 75. • Popular packages are typical examples of the tailored packages we have delivered. Tailored courses available http://training.acquia.com/events TRAINING@ACQUIA.COM 75Wednesday, May 15, 2013