Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This patch enables customization of script defaults for plug-ins that depend on region fx. This includes fxAccorion and fxTabs.
To change them, add the following to the .info file of your theme.
Example:
// REGION_FX_PLUGIN[BLOCK_REGION_KEY][OPTION] = VALUE
fxTabs[sidebar_accordion][vjustify] = false
The scripts always had the following options but there was no way to change them.
For reference, here are all the defaults for fxTabs:
activate: null, // The tab set to show on page load. Use
// a numeric position starting at 0 or a
// html ID pointing to the
// header or content without the hash.
// Setting this to null will restore the
// previous state.
applyClass: 'fx-tabs', // Classname to apply to the passed object.
// Use as a contextual CSS selector for
// styling.
currentClass: 'fx-active', // Classname to apply to the LI of the
// selected tab.
tabheadClass: 'fx-titles', // Classname to apply to the UL of the
// tab group.
contentClass: 'fx-contents', // Classname to apply to the content wrapper.
headerSelect: '.block-title', // Query Selector of the Elements to
// Transform the Tabs-Navigation from
// (originals are removed).
contentSelect: '.block', // Query Selector of the Elements to be
// treated as the Tab Body.
fx: 'fadeIn', // can be "fadeIn", "slideDown", "show".
fxspeed: 'normal', // speed (String|Number): "slow", "normal",
// or "fast") or the number of milliseconds
// to run the animation.
currentTabTag: 'h2', // A heading tag for the currently active
// tab. This is used for screenreaders and
// will be hidden.
currentInfoText: 'current tab: ', // text to indicate for screenreaders which
// tab is the current one
currentInfoPosition: 'prepend', // Definition where to insert the Info Text.
// Can be either "prepend" or "append"
currentInfoClass: 'fx-current-info', // Class to apply to the span wrapping
// the CurrentInfoText.
highlightTrigger: '.active, .active-trail, .active-menu',
// Query Selector to trigger the next option
// when there's a matche in the tab content.
highlightClass: 'page-active', // Classname to apply to the LI tab head
// and tab body.
vjustify: true // Justifies the height of each tab body.
And the options for fxAccordion:
activate: null, // The accordion item to show on page load.
// Use a numeric position starting at 0 or
// a html ID pointing to the header, content
// or the immediat parent without the hash.
// Setting this to null will restore the
// previous state.
applyClass: 'fx-accordion', // Classname to apply to the passed object.
// Use as a contextual CSS selector for styling.
currentClass: 'fx-active', // Classname to apply to the expanded accordion
// header and content.
headerClass: 'fx-header', // Classname to apply to the accordion header.
contentClass: 'fx-content', // Classname to apply to the content body.
headerSelect: '.block-title', // Query Selector of the header.
contentSelect: '.block-content', // Query Selector of the body.
fxspeed: 'normal', // speed (String|Number): "slow", "normal",
// or "fast") or the number of milliseconds
// to run the animation.
currentFocusText: ': in current focus',
// text to indicate for screenreaders on
// which accordion is in focus.
highlightTrigger: '.active, .active-trail, .active-menu',
// Query Selector to trigger the next option
// when there's a match in the content.
highlightClass: 'page-active' // Classname to apply to the head and body.
Comment | File | Size | Author |
---|---|---|---|
#3 | hexagon-847624c.patch | 3.89 KB | dvessel |
#2 | hexagon-847624b.patch | 3.89 KB | dvessel |
#1 | hexagon-847624.patch | 3.7 KB | dvessel |
Comments
Comment #1
dvessel CreditAttribution: dvessel commentedThe patch.
Comment #2
dvessel CreditAttribution: dvessel commentedThis patch does a better job of forcing type changes.
'true' or 'false' will be booleans in javascript and integers are handled better.
Comment #3
dvessel CreditAttribution: dvessel commentedTypo in the code comments.
Comment #4
penguininja CreditAttribution: penguininja commentedThe patch from comment #3 works great. Thanks! This is a great addition to Hexagon.
Comment #5
dvessel CreditAttribution: dvessel commentedGreat! Committed.