Drupal CMS Flashcards
All that is require for Drupal to see your theme is a…
.info file
What are template files used for?
.tpl.php
These templates are used for the (x)HTML markup and PHP variables. In some situations they may output other types of data –xml rss for example. Each .tpl.php file handles the output of a specific themable chunk of data, and in some situations it can handle multiple .tpl.php files through suggestions.
What is drush?
Drush is a drupal shell
What does vagrant halt command do?
stops vagrant
Drupal has tons of what kind of array?
Associative arrays
What is a Drupal theme?
Themes make Drupal websites beautiful.
Themers are the bridge between the science of code and the art of design.
Drupal markup isn’t the prettiest out of the box, but it’s very flexible in how you alter it.
What are the 6 steps for installing a theme?
- Download the theme
- Extract the files
- Upload the folder
- Read the directions
- Enable the theme
- Click the ‘save configuration button at the bottom
What are the 6 steps for installing a theme?
- Download the theme
- Extract the files
- Upload the folder
- Read the directions
- Enable the theme
- Click the ‘save configuration button at the bottom
A colletion of files that define the presentation layer is called the :
theme
Which files are typically found in a theme?
style.css
page.tpl.php
block.tpl.php
node.tpl.php
template.php
logo.png
screenshot.png
images
What is a sub-theme?
builds off files of a parent theme, but has it’s own style or differences defined within it’s sub folder.
Why do you think Drupal is a powerful and popular CMS compared to others?
Drupal allows you to create multiple content types using content construction kits, without any programming skills. It also allows customized theme templates for each content type.
What is a module in drupal?
A module is a software that extends drupal features and/or functionality.
What are hooks in drupal?
Hooks are drupal api code which allows modules to interact with the drupal core.
Drupal’s module system is based on the concept of hooks.
A hook is a php function that is named foo_bar(), where “foo” is the name of the module and bar is the name of the hook.
When you are creating a drupal module, what 3 files do you need to get started?
.info
.module
.install
What information needs to go in a .info file?
- name
- description
- core
- dependencies
what is hook_schema()? What does it do and what file should it be included in?
hook_schema() is a definition structure array. For each element of the array, the key is a table name and the value is a table structure definition, so you create your database tables for your module by using hook_schema().
hook_schema() must be used in the .install file
what is hook_schema()? What does it do and what file should it be included in?
hook_schema() is a definition structure array. For each element of the array, the key is a table name and the value is a table structure definition, so you create your database tables for your module by using hook_schema().
hook_schema() must be used in the .install file
what are some of the main hooks we use to create a module (in the .module file)
hook_menu: define menu items and page callbacks
hook_permission: defines user permissions
hook_form: creates a form
hook_validate: validates input
hook_submit: processes input
How do we create a form using the Form API and hook_form function?
-create a variable called $form which is an associative array where each item in the associative array is a form field which is also an associative array
How do we create a form using the Form API and hook_form function?
- create a variable called $form which is an associative array where each item in the associative array is a form field which is also an associative array
- Drupal form api provides us with field types and valid attributes of those types for us to use
how can we create a database table using the hook_schema function and Database API?
-create a variable called $schema which is an associative array where each item in the array is a new database table (also represented by an associative array), and each item in that associative array is a column in the table with appropriate attributes (type, length, etc)
-Drupal Database API provides us with:
—to support multiple database servers easily;
to allow developers to leverage more complex functionality, such as transactions;
—to provide a structured interface for the dynamic construction of queries;
—to enforce security checks and other good practices;
—to provide modules with a clean interface for intercepting and modifying a site’s queries.
how can we create a database table using the hook_schema function and Database API?
-create a variable called $schema which is an associative array where each item in the array is a new database table (also represented by an associative array), and each item in that associative array is a column in the table with appropriate attributes (type, length, etc)
-Drupal Database API provides us with:
—to support multiple database servers easily;
to allow developers to leverage more complex functionality, such as transactions;
—to provide a structured interface for the dynamic construction of queries;
—to enforce security checks and other good practices;
—to provide modules with a clean interface for intercepting and modifying a site’s queries.
What is the t() function?
the t() function makes strings translatable with Drupals UI so that people using it in different places can read it in their own language.