0

I'm interested in implementing something similar to the way Drupal gardens let you enable and disable features in the create-site interface. (I mean the term features figuratively, not necessarily the features module.) Is this just some sort of custom form that hooks into enabling and disabling modules?

screenshot

1
  • 1
    It's a nicely themed and stripped-of-options version off the modules page, yes. – Letharion Nov 17 '12 at 18:21
0

What you see on that page is a Drupal form where the form fields have been heavily themed to appear differently from how you would normally see that type of form field on a Drupal site.

Looking at the HTML source of that page, it is clear those selectors are simply checkboxes rendered with a custom theme function.

<div class="form-item" id="edit-features-28711-wrapper">
 <label class="option" for="edit-features-28711"><span class="feature-icon" style="background: url(/sites/default/files/connect.png) no-repeat center center;">&nbsp;</span><input type="checkbox" name="features[28711]" id="edit-features-28711" value="1"   class="gardens-feature-checkbox" /><span class="label-text">Follow us</span></label><div class="feature-preview"><img class="preview-image" src="/sites/default/files/stay-connected_0.png" />Gain a following. Provide links to your (or your users') profile on Twitter, Facebook or other social networks.</div>
</div>

There is also custom JavaScript code that changes the appearance of the form field.

When I turn off a feature, I see a CSS class being added to a tag, and another tag value being changed. The value associated with the checkbox is not changed; it is 1 when the feature is enabled, and it is still 1 when the feature is disabled.

screenshot

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.