SlideShare a Scribd company logo
@chillin411
Drupal Install Profiles
The coolest thing you're not customizing on Drupal... yet.
@chillin411
What is an install profile?
• Set of instructions that Drupal runs during the install
process
• Easy way to ENABLE (compare to DOWNLOAD using
Drush Make) modules at install.
• Can do practically anything using PHP
@chillin411
Why should I use them?
• Extremely easy to write
• Can start small and add to it as time goes by
• There's no reason to do the same setup tasks over and
over.
• Does the 2nd half of the work that you do with Drush
Make.
@chillin411
Cool things you can do:
• Enable modules at install
• Set an administration theme
• Add a new input format and configure it to use CKEditor
• Add users, nodes, or roles
• Create default content
• Anything you can do with PHP
@chillin411
Drupal 6 Install Profiles
• Composed of one file.profile
• Several PHP hooks
o hook_profile_modules()
o hook_profile_details()
o hook_profile_task_list()
o hook_profile_tasks()
o hook_form_alter()
@chillin411
Drupal 7 Install Profiles
• Consists of 3 files
o profile.info
 Similar to a module .info file (install modules here)
o profile.install
 Similar to a module's .install file (most of your
editing will go here)
o profile.profile
 Similar to a module's .module file (form_alters, etc)
@chillin411
Cool thing #1 - Enabling Modules
• D6 - hook_profile_modules()
o return array('views', 'views_ui', 'token');
• D7 - profile.info
o dependencies[] = views
dependencies[] = views_ui
dependencies[] = token
@chillin411
Cool thing #2 - Default Themes
• variable_set('admin_theme', 'Rubik');
o D6 - Put in hook_profile_tasks
o D7 - Put in hook_install
• variable_set('theme_default', 'Bartik');
@chillin411
Cool thing #3 - Create Admin Role
• D6 - hook_profile_tasks()
o $form_state = array();
$form_state['values']['name'] = 'Administrator';
$form_state['values']['op'] = t('Create admin role');
drupal_execute('user_admin_new_role', $form_state);
• Alternatively, you can use a db_query, but be careful about this -
notice lack of INTO, and lack of rid key.
o db_query("INSERT {role} (name) VALUES ( 'Administrator')");
@chillin411
How to get started?
• In Drupal 6, copy the /profiles/default folder, rename the
folder, .profile and function hook names to match your
profile.
• In Drupal 7, use the /profiles/standard instead of
profiles/minimal (more stuff there to work with)
• If you're enabling modules, make sure to have them
already downloaded. Drush make is awesome for this.
• Start editing, and looking at variables table.
@chillin411
One trick on the variables table
• Variables in the variable table are serialized.
o a:3:{i:0;s:4:"node";i:1;s:8:"taxonomy";i:2;s:4:"user";}
o array(0 => "node", 1 => "taxonomy", 2 => "user")
• So, if you want to add this to the variables table
(pathauto does this automatically, just an example)
o $array_pathauto_modulelist = array(0 => "node", 1 =>
"taxonomy", 2 => "user");
o variable_set('pathauto_modulelist',
$array_pathauto_modulelist);
Thanks!
@chillin411

More Related Content

What's hot

Using RequireJS with CakePHP
Using RequireJS with CakePHPUsing RequireJS with CakePHP
Using RequireJS with CakePHP
Stephen Young
 
Getting to The Loop - London Wordpress Meetup July 28th
Getting to The Loop - London Wordpress Meetup  July 28thGetting to The Loop - London Wordpress Meetup  July 28th
Getting to The Loop - London Wordpress Meetup July 28th
Chris Adams
 
Theming Search Results - How to Make Your Search Results Rock
Theming Search Results - How to Make Your Search Results RockTheming Search Results - How to Make Your Search Results Rock
Theming Search Results - How to Make Your Search Results Rock
Aubrey Sambor
 
How to migrate Cakephp 1.x to 2.x
How to migrate Cakephp 1.x to 2.xHow to migrate Cakephp 1.x to 2.x
How to migrate Cakephp 1.x to 2.x
Andolasoft Inc
 
Introduction to ElasticSearch
Introduction to ElasticSearchIntroduction to ElasticSearch
Introduction to ElasticSearch
Simobo
 
Awash in a sea of connections
Awash in a sea of connectionsAwash in a sea of connections
Awash in a sea of connections
Galen Charlton
 
Making your Drupal fly with Apache SOLR
Making your Drupal fly with Apache SOLRMaking your Drupal fly with Apache SOLR
Making your Drupal fly with Apache SOLR
Exove
 
Putting the Cat in the Catalogue: A Feline-Inspired OPAC Theme For Koha
Putting the Cat in the Catalogue: A Feline-Inspired OPAC Theme For KohaPutting the Cat in the Catalogue: A Feline-Inspired OPAC Theme For Koha
Putting the Cat in the Catalogue: A Feline-Inspired OPAC Theme For Koha
Galen Charlton
 
Hardcore URL Routing for WordPress - WordCamp Atlanta 2014
Hardcore URL Routing for WordPress - WordCamp Atlanta 2014Hardcore URL Routing for WordPress - WordCamp Atlanta 2014
Hardcore URL Routing for WordPress - WordCamp Atlanta 2014
Mike Schinkel
 
Dealing with Continuous Data Processing, ConFoo 2012
Dealing with Continuous Data Processing, ConFoo 2012Dealing with Continuous Data Processing, ConFoo 2012
Dealing with Continuous Data Processing, ConFoo 2012
Michael Peacock
 
Hardcore URL Routing for WordPress - WordCamp Atlanta 2014 (PPT)
Hardcore URL Routing for WordPress - WordCamp Atlanta 2014 (PPT)Hardcore URL Routing for WordPress - WordCamp Atlanta 2014 (PPT)
Hardcore URL Routing for WordPress - WordCamp Atlanta 2014 (PPT)
Mike Schinkel
 
Simple Web Apps With Sinatra
Simple Web Apps With SinatraSimple Web Apps With Sinatra
Simple Web Apps With Sinatra
a_l
 

What's hot (12)

Using RequireJS with CakePHP
Using RequireJS with CakePHPUsing RequireJS with CakePHP
Using RequireJS with CakePHP
 
Getting to The Loop - London Wordpress Meetup July 28th
Getting to The Loop - London Wordpress Meetup  July 28thGetting to The Loop - London Wordpress Meetup  July 28th
Getting to The Loop - London Wordpress Meetup July 28th
 
Theming Search Results - How to Make Your Search Results Rock
Theming Search Results - How to Make Your Search Results RockTheming Search Results - How to Make Your Search Results Rock
Theming Search Results - How to Make Your Search Results Rock
 
How to migrate Cakephp 1.x to 2.x
How to migrate Cakephp 1.x to 2.xHow to migrate Cakephp 1.x to 2.x
How to migrate Cakephp 1.x to 2.x
 
Introduction to ElasticSearch
Introduction to ElasticSearchIntroduction to ElasticSearch
Introduction to ElasticSearch
 
Awash in a sea of connections
Awash in a sea of connectionsAwash in a sea of connections
Awash in a sea of connections
 
Making your Drupal fly with Apache SOLR
Making your Drupal fly with Apache SOLRMaking your Drupal fly with Apache SOLR
Making your Drupal fly with Apache SOLR
 
Putting the Cat in the Catalogue: A Feline-Inspired OPAC Theme For Koha
Putting the Cat in the Catalogue: A Feline-Inspired OPAC Theme For KohaPutting the Cat in the Catalogue: A Feline-Inspired OPAC Theme For Koha
Putting the Cat in the Catalogue: A Feline-Inspired OPAC Theme For Koha
 
Hardcore URL Routing for WordPress - WordCamp Atlanta 2014
Hardcore URL Routing for WordPress - WordCamp Atlanta 2014Hardcore URL Routing for WordPress - WordCamp Atlanta 2014
Hardcore URL Routing for WordPress - WordCamp Atlanta 2014
 
Dealing with Continuous Data Processing, ConFoo 2012
Dealing with Continuous Data Processing, ConFoo 2012Dealing with Continuous Data Processing, ConFoo 2012
Dealing with Continuous Data Processing, ConFoo 2012
 
Hardcore URL Routing for WordPress - WordCamp Atlanta 2014 (PPT)
Hardcore URL Routing for WordPress - WordCamp Atlanta 2014 (PPT)Hardcore URL Routing for WordPress - WordCamp Atlanta 2014 (PPT)
Hardcore URL Routing for WordPress - WordCamp Atlanta 2014 (PPT)
 
Simple Web Apps With Sinatra
Simple Web Apps With SinatraSimple Web Apps With Sinatra
Simple Web Apps With Sinatra
 

Similar to Drupal Install Profiles

Kickass
KickassKickass
Config management
Config managementConfig management
Config management
Alexei Goja
 
Fapi
FapiFapi
Drupal 8 Configuration Management
Drupal 8 Configuration ManagementDrupal 8 Configuration Management
Drupal 8 Configuration Management
Philip Norton
 
Learning the basics of the Drupal API
Learning the basics of the Drupal APILearning the basics of the Drupal API
Learning the basics of the Drupal API
Alexandru Badiu
 
What's new in the Drupal 7 API?
What's new in the Drupal 7 API?What's new in the Drupal 7 API?
What's new in the Drupal 7 API?
Alexandru Badiu
 
Drupal Module Development
Drupal Module DevelopmentDrupal Module Development
Drupal Module Development
ipsitamishra
 
Drupal Module Development - OSI Days 2010
Drupal Module Development - OSI Days 2010Drupal Module Development - OSI Days 2010
Drupal Module Development - OSI Days 2010
Siva Epari
 
Staying Sane with Drupal NEPHP
Staying Sane with Drupal NEPHPStaying Sane with Drupal NEPHP
Staying Sane with Drupal NEPHP
Oscar Merida
 
Configuration Management in Drupal 8: A preview (DrupalDays Milano 2014)
Configuration Management in Drupal 8: A preview (DrupalDays Milano 2014)Configuration Management in Drupal 8: A preview (DrupalDays Milano 2014)
Configuration Management in Drupal 8: A preview (DrupalDays Milano 2014)
Nuvole
 
Gestione della configurazione in Drupal 8
Gestione della configurazione in Drupal 8Gestione della configurazione in Drupal 8
Gestione della configurazione in Drupal 8
Eugenio Minardi
 
Drupal 8 - Core and API Changes
Drupal 8 - Core and API ChangesDrupal 8 - Core and API Changes
Drupal 8 - Core and API Changes
Shabir Ahmad
 
Drupal Camp Porto - Developing with Drupal: First Steps
Drupal Camp Porto - Developing with Drupal: First StepsDrupal Camp Porto - Developing with Drupal: First Steps
Drupal Camp Porto - Developing with Drupal: First Steps
Luís Carneiro
 
An Introduction to Drupal
An Introduction to DrupalAn Introduction to Drupal
An Introduction to Drupal
Compare Infobase Limited
 
Top 8 Improvements in Drupal 8
Top 8 Improvements in Drupal 8Top 8 Improvements in Drupal 8
Top 8 Improvements in Drupal 8
Angela Byron
 
Drupal security
Drupal securityDrupal security
Drupal security
Jozef Toth
 
Howdoesgettemplatepartworksintwentytentheme 110123234953-phpapp02
Howdoesgettemplatepartworksintwentytentheme 110123234953-phpapp02Howdoesgettemplatepartworksintwentytentheme 110123234953-phpapp02
Howdoesgettemplatepartworksintwentytentheme 110123234953-phpapp02
sos informatique
 
Drupal Development
Drupal DevelopmentDrupal Development
Drupal Development
Jeff Eaton
 
D7 theming what's new - London
D7 theming what's new - LondonD7 theming what's new - London
D7 theming what's new - London
Marek Sotak
 
10 Steps Not To Forget After Installing Drupal
10 Steps Not To Forget After Installing Drupal 10 Steps Not To Forget After Installing Drupal
10 Steps Not To Forget After Installing Drupal
Cory Gilliam
 

Similar to Drupal Install Profiles (20)

Kickass
KickassKickass
Kickass
 
Config management
Config managementConfig management
Config management
 
Fapi
FapiFapi
Fapi
 
Drupal 8 Configuration Management
Drupal 8 Configuration ManagementDrupal 8 Configuration Management
Drupal 8 Configuration Management
 
Learning the basics of the Drupal API
Learning the basics of the Drupal APILearning the basics of the Drupal API
Learning the basics of the Drupal API
 
What's new in the Drupal 7 API?
What's new in the Drupal 7 API?What's new in the Drupal 7 API?
What's new in the Drupal 7 API?
 
Drupal Module Development
Drupal Module DevelopmentDrupal Module Development
Drupal Module Development
 
Drupal Module Development - OSI Days 2010
Drupal Module Development - OSI Days 2010Drupal Module Development - OSI Days 2010
Drupal Module Development - OSI Days 2010
 
Staying Sane with Drupal NEPHP
Staying Sane with Drupal NEPHPStaying Sane with Drupal NEPHP
Staying Sane with Drupal NEPHP
 
Configuration Management in Drupal 8: A preview (DrupalDays Milano 2014)
Configuration Management in Drupal 8: A preview (DrupalDays Milano 2014)Configuration Management in Drupal 8: A preview (DrupalDays Milano 2014)
Configuration Management in Drupal 8: A preview (DrupalDays Milano 2014)
 
Gestione della configurazione in Drupal 8
Gestione della configurazione in Drupal 8Gestione della configurazione in Drupal 8
Gestione della configurazione in Drupal 8
 
Drupal 8 - Core and API Changes
Drupal 8 - Core and API ChangesDrupal 8 - Core and API Changes
Drupal 8 - Core and API Changes
 
Drupal Camp Porto - Developing with Drupal: First Steps
Drupal Camp Porto - Developing with Drupal: First StepsDrupal Camp Porto - Developing with Drupal: First Steps
Drupal Camp Porto - Developing with Drupal: First Steps
 
An Introduction to Drupal
An Introduction to DrupalAn Introduction to Drupal
An Introduction to Drupal
 
Top 8 Improvements in Drupal 8
Top 8 Improvements in Drupal 8Top 8 Improvements in Drupal 8
Top 8 Improvements in Drupal 8
 
Drupal security
Drupal securityDrupal security
Drupal security
 
Howdoesgettemplatepartworksintwentytentheme 110123234953-phpapp02
Howdoesgettemplatepartworksintwentytentheme 110123234953-phpapp02Howdoesgettemplatepartworksintwentytentheme 110123234953-phpapp02
Howdoesgettemplatepartworksintwentytentheme 110123234953-phpapp02
 
Drupal Development
Drupal DevelopmentDrupal Development
Drupal Development
 
D7 theming what's new - London
D7 theming what's new - LondonD7 theming what's new - London
D7 theming what's new - London
 
10 Steps Not To Forget After Installing Drupal
10 Steps Not To Forget After Installing Drupal 10 Steps Not To Forget After Installing Drupal
10 Steps Not To Forget After Installing Drupal
 

Recently uploaded

Y-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PPY-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PP
c5vrf27qcz
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
saastr
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
Edge AI and Vision Alliance
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
MichaelKnudsen27
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
Miro Wengner
 
What is an RPA CoE? Session 1 – CoE Vision
What is an RPA CoE?  Session 1 – CoE VisionWhat is an RPA CoE?  Session 1 – CoE Vision
What is an RPA CoE? Session 1 – CoE Vision
DianaGray10
 
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
ScyllaDB
 
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge GraphGraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
Neo4j
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
Essentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation ParametersEssentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation Parameters
Safe Software
 
The Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptxThe Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptx
operationspcvita
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
Antonios Katsarakis
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |
AstuteBusiness
 

Recently uploaded (20)

Y-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PPY-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PP
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
 
What is an RPA CoE? Session 1 – CoE Vision
What is an RPA CoE?  Session 1 – CoE VisionWhat is an RPA CoE?  Session 1 – CoE Vision
What is an RPA CoE? Session 1 – CoE Vision
 
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
 
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge GraphGraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
Essentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation ParametersEssentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation Parameters
 
Artificial Intelligence and Electronic Warfare
Artificial Intelligence and Electronic WarfareArtificial Intelligence and Electronic Warfare
Artificial Intelligence and Electronic Warfare
 
The Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptxThe Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptx
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |
 

Drupal Install Profiles

  • 1. @chillin411 Drupal Install Profiles The coolest thing you're not customizing on Drupal... yet.
  • 2. @chillin411 What is an install profile? • Set of instructions that Drupal runs during the install process • Easy way to ENABLE (compare to DOWNLOAD using Drush Make) modules at install. • Can do practically anything using PHP
  • 3. @chillin411 Why should I use them? • Extremely easy to write • Can start small and add to it as time goes by • There's no reason to do the same setup tasks over and over. • Does the 2nd half of the work that you do with Drush Make.
  • 4. @chillin411 Cool things you can do: • Enable modules at install • Set an administration theme • Add a new input format and configure it to use CKEditor • Add users, nodes, or roles • Create default content • Anything you can do with PHP
  • 5. @chillin411 Drupal 6 Install Profiles • Composed of one file.profile • Several PHP hooks o hook_profile_modules() o hook_profile_details() o hook_profile_task_list() o hook_profile_tasks() o hook_form_alter()
  • 6. @chillin411 Drupal 7 Install Profiles • Consists of 3 files o profile.info  Similar to a module .info file (install modules here) o profile.install  Similar to a module's .install file (most of your editing will go here) o profile.profile  Similar to a module's .module file (form_alters, etc)
  • 7. @chillin411 Cool thing #1 - Enabling Modules • D6 - hook_profile_modules() o return array('views', 'views_ui', 'token'); • D7 - profile.info o dependencies[] = views dependencies[] = views_ui dependencies[] = token
  • 8. @chillin411 Cool thing #2 - Default Themes • variable_set('admin_theme', 'Rubik'); o D6 - Put in hook_profile_tasks o D7 - Put in hook_install • variable_set('theme_default', 'Bartik');
  • 9. @chillin411 Cool thing #3 - Create Admin Role • D6 - hook_profile_tasks() o $form_state = array(); $form_state['values']['name'] = 'Administrator'; $form_state['values']['op'] = t('Create admin role'); drupal_execute('user_admin_new_role', $form_state); • Alternatively, you can use a db_query, but be careful about this - notice lack of INTO, and lack of rid key. o db_query("INSERT {role} (name) VALUES ( 'Administrator')");
  • 10. @chillin411 How to get started? • In Drupal 6, copy the /profiles/default folder, rename the folder, .profile and function hook names to match your profile. • In Drupal 7, use the /profiles/standard instead of profiles/minimal (more stuff there to work with) • If you're enabling modules, make sure to have them already downloaded. Drush make is awesome for this. • Start editing, and looking at variables table.
  • 11. @chillin411 One trick on the variables table • Variables in the variable table are serialized. o a:3:{i:0;s:4:"node";i:1;s:8:"taxonomy";i:2;s:4:"user";} o array(0 => "node", 1 => "taxonomy", 2 => "user") • So, if you want to add this to the variables table (pathauto does this automatically, just an example) o $array_pathauto_modulelist = array(0 => "node", 1 => "taxonomy", 2 => "user"); o variable_set('pathauto_modulelist', $array_pathauto_modulelist);