Your SlideShare is downloading. ×
0
Advanced StrongarmSome tricks and tips on using the      Strongarm Features    enhancement module
StrongarmThe Strongarm module allows DrupalPersistent Variables to be exported and   imported via Features modules.
Drupal Persistent Variables•   Set by variable_set(name, value)•   Retrieved by variable_get(name, def)•   Values stored i...
A Case StudyNeed:         A Feature for User profiles based on Content Profile nodes types.Requirements:         - Two Con...
Expected OutcomeTwo Content Types with same setting:       - Fields as defined       - Workflow Default options set to pub...
Features onlyCreate a New Feature:  - In Edit Component -> Content types: node, add the two content types  - In Edit Compo...
Features with Strongarm           on AutomaticCreate a New Feature:  - In Edit Component -> Content types: node, add the t...
Where’s Wald..the               Node Type SettingFinding Node Type Related SettingsBasic assumption: Persistent variable n...
Where’s Wald.. the NT SettingGreen: Auto added by StrongarmRed:   Need to be manually added
Where’s Wald..the           Node Type SettingNotes:• Repeat for other content type• Note the “name spaces” for other varia...
Features with Strongarm          and Manual SettingsCreate a New Feature:  - In Edit Component -> Content types: node, add...
Where’s Wald..the                Module SettingFinding Module SettingsBasic assumption: Persistent variable names will sta...
Where’s Wald..the             Module SettingNotes:•   Modules may use their own DB tables to store    settings. Strongarm ...
Conclusion Strongarm allows for many non-Featureenabled module settings to be captured in           a Feature Module
Questions?
Upcoming SlideShare
Loading in...5
×

The Drupal Strongarm Module - Tips and Tricks.

3,471

Published on

A presentation on the strongarm module which allows you to access many modules that have not been made features friendly.

Published in: Technology
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
3,471
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
14
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Transcript of "The Drupal Strongarm Module - Tips and Tricks."

  1. 1. Advanced StrongarmSome tricks and tips on using the Strongarm Features enhancement module
  2. 2. StrongarmThe Strongarm module allows DrupalPersistent Variables to be exported and imported via Features modules.
  3. 3. Drupal Persistent Variables• Set by variable_set(name, value)• Retrieved by variable_get(name, def)• Values stored in the Variables table• Used by most modules for simple settings• Modules use their own Name Space Prefix (e.g ant = Automatic Node Title)
  4. 4. A Case StudyNeed: A Feature for User profiles based on Content Profile nodes types.Requirements: - Two Content Profile node types: Contact Info (profile) and About Me (network_profile) - Pathauto module settings to automatically alias them under the /people URL - All users can create and edit their own profile infoTools: Two Drupal sites (source / test ) SQL Query Tool Devel module (variable editor) (optional) Editor for source code
  5. 5. Expected OutcomeTwo Content Types with same setting: - Fields as defined - Workflow Default options set to publish but not front page - Comment settings the same - Content Profile option checked - Attachment settingsPathauto Settings - Settings in URL Aliases -> Automated Alias Settings -> Node Paths match.Authenticated User Role - Has permissions to “create profile content” and “create networking_profile content.
  6. 6. Features onlyCreate a New Feature: - In Edit Component -> Content types: node, add the two content types - In Edit Components -> Permissions, select the two permissions - In Edit Components -> Roles: user_role, select “authenticated user”Outcome: - Node types and CCK fields get created - Permissions set in role - but the node type settings are not set. E.g. workflow, comments, attachments, content profile use, and the like. Also, there are no path alias setting.
  7. 7. Features with Strongarm on AutomaticCreate a New Feature: - In Edit Component -> Content types: node, add the two content types - In Edit Components -> Permissions, select the two permissions - In Edit Components -> Roles: user_role, select “authenticated user”Outcome: - Node types and CCK fields get created - Permissions set in role - Standard nodes type settings are set (E.g. workflow, comments, attachments) - But content profile use is not set. Also, there are no path alias setting.
  8. 8. Where’s Wald..the Node Type SettingFinding Node Type Related SettingsBasic assumption: Persistent variable names will contain node_type nameFind related persistent variables using either:• (Preferred) An SQL Browser Tool to query your site‟s DB using the query Select * from Variables where name like „%<node_type>%‟ e.g. Select * from Variables where name like „%networking_profile%‟• Alternatively, use the Devel Variable Editor page and search thru the listings
  9. 9. Where’s Wald.. the NT SettingGreen: Auto added by StrongarmRed: Need to be manually added
  10. 10. Where’s Wald..the Node Type SettingNotes:• Repeat for other content type• Note the “name spaces” for other variables found. These are other modules you might want to add as defaults to your feature as well.• Look at the values for indications of where it is set/what it‟s used for.• Search the source code for the variable_set instances to validate use (or just keep a good test site db backup and test it).
  11. 11. Features with Strongarm and Manual SettingsCreate a New Feature: - In Edit Component -> Content types: node, add the two content types - In Edit Components -> Permissions, select the two permissions - In Edit Components -> Roles: user_role, select “authenticated user” - In Edit Components -> Strongarm: variable, add variables found above.Outcome: - Node types and CCK fields get created - Permissions set in role - Standard nodes type settings are set (E.g. workflow, comments, attachments) - Content profile use is set. - Path auto alias is set
  12. 12. Where’s Wald..the Module SettingFinding Module SettingsBasic assumption: Persistent variable names will start with module name or module specific prefix.Find related persistent variables using either:• (Preferred) An SQL Browser Tool to query your site‟s DB using the query Select * from Variables where name like „<module_name>%‟ e.g. Select * from Variables where name like „realname%‟• Alternatively, use the Devel Variable Editor page and search thru the listings
  13. 13. Where’s Wald..the Module SettingNotes:• Modules may use their own DB tables to store settings. Strongarm will not work with these.• Setting may be a DB record id reference or other complicated structure and will not work.• The variable name is often the same name as the admin form field that sets it.• Look at the “postfix” and values for indications of where it is set/what it‟s used for.• Search the source code for the variable_set instances to validate use (or just keep a good test site db backup and test it).
  14. 14. Conclusion Strongarm allows for many non-Featureenabled module settings to be captured in a Feature Module
  15. 15. Questions?
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×