Author: dekode

  • Color card

    Color card

    Simple card with title text and link to set

    Also allows to select card color.

    Example usage in the DinUtvei project:

    https://dinutvei.no/

  • Better Core iframes

    Better Core iframes

    Features:

    • Play in popup
    • Load iframe on demand – Iframes are no longer added to the HTML, they are embedded only when user click button, reducing loads
    • Fetch priority for thumb, when iframe is placed on top of the page it is important to set fetch priority to avoid bad LCP. This plugin allows to do this
    • By default plugin will fetch the thumb from YT/Vimeo and Dailymotion, but user can set their own.
    • Video caption – this is text displayed below (if not styled differently)

    Customization

    The block contains few PHP hooks for customization e.g for button if needed, all of which is described in [readme.md]

    NOTE: Plugin haven’t been tested with Dekode GTM iFrame CookieBot blocking feature yet!
    So may not “block” iframes as expected.

  • Info Product cards

    Info Product cards

    Like pricing cards,

    Cards could have or not the media header

    • Image
    • Icon – T2, configurable in t2.json (see below)
    • none

    On mobile it become an slider

    Cards allow set custom colors, support for native blogGap, and custom Featured card color per card.

    Each element suport many of native controls form wordpress, e.g You’re able to change badge color using native bg select.

    Each element in card is an inner locked block which allows easy override for block and hooking into it in case it is needed.

    Editor

    Design in Neas

    Mobile carousel: At viewport widths ≤ 640 px the grid automatically becomes a Swiper carousel — one card visible at a time with pagination dots and prev/next arrows. The carousel is initialised on DOMContentLoaded and re-evaluated on window resize (debounced 150 ms): it is destroyed when the viewport exceeds 640 px and re-created when it drops back below. Requires at least 2 cards in the block. Swiper parameters can be customised via the dekode-library/product-info-cards/swiper-config PHP filter.

    • Featured card toggle with custom background/text colour
    • Media type selector: none | image (icon reserved for future use)
    • Badge toggle (show/hide)
    • Background colour, text colour
    • Border: colour, width, style, radius
    • Spacing: padding, blockGap
    • Responsive column grid (1–4 columns, configurable)
    • Block alignment: wide, full

    Library json config

    The features can be show/hidden and adjust using library.json

    dekode-library/product-info-cards

    KeyTypeDefaultDescription
    layout.defaultColumnsnumber3Initial column count applied on first block insertion
    layout.columnsnumber[][1,2,3,4]Which column options appear in the inspector

    dekode-library/product-info-card

    KeyTypeDefaultDescription
    features.allowBadgebooleantrueShow the badge toggle in the inspector. When false the badge sub-block is never inserted
    features.featuredColorsbooleantrueShow the Featured colours panel in the inspector
    features.mediaTypestring[]["none","icon","image"]Restrict available media type options. A single-item array forces that type silently on first insertion
    layout.imageSizestring"large"WordPress image size used when rendering the card media image. Any registered size name is accepted (e.g. "medium""full""my_custom_size"). Can be further overridden by the dekode-library/product-info-cards/card-media/image/size PHP filter
    layout.iconSizenumber32Size in pixels for the card media icon (T2 icon). Can be further overridden by the dekode-library/product-info-cards/card-media/icon/size PHP filter
    settings.colors.featuredBackgroundColorstring | objectnullDefault featured background. Plain string (hex/css), or { "color": "#hex" } / { "slug": "preset-slug" }
    settings.colors.featuredTextColorstring | objectnullDefault featured text colour. Same format as above
    {
      "dekode-library/product-info-cards": {
        "layout": {
          "defaultColumns": 3,
          "columns": [1, 2, 3, 4]
        }
      },
      "dekode-library/product-info-card": {
        "settings": {
          "colors": {
            "featuredBackgroundColor": "#ff0000",
            "featuredTextColor": "#ffffff"
          }
        },
        "features": {
          "allowBadge": true,
          "featuredColors": true,
          "mediaType": ["none", "image"],
          "imageSize": "medium_large"
        }
      }
    }

    For more info see plugin’s readme

    Example

    400,-

    Kunde uten strømavtale

    • Spotpris historikk
    • Smart forbrukskalkulator
    • Spotprisen time for time
    +43,-per mnd

    550,-

    Kunde uten strømavtale

    • Alt i forrige plan, pluss:
    • Nettleien i sanntid
    • Strømstøtten i sanntid
    • Alt i en oversiktlig graf med summering og kostnader

  • TABS

    Tabs Block

    Display related content in a compact tab. Originally forked out of T2.

    Features

    • Tabbed content navigation with accessibility support (ARIA attributes, keyboard navigation)
    • Customizable prefix and suffix headings (H1-H6)
    • Icon support for individual tabs with size and position controls
    • Flexible tab button alignment (left, center, right)
    • Configurable allowed blocks within tab panels
    • Screen reader-friendly icon-only mode

    Library.json

    {
    	"dekode-library/tabs": {
    		"template": [
    			["core/paragraph"]
    		],
    		"allowedBlocks": ["core/paragraph", "t2/link-list"],
    		"features": {
    			"allowTabsPrefix": true,
    			"allowTabsSuffix": true,
    			"allowChangingTabsJustification": true,
    			"allowIcons": true,
    			"allowIconSize": true,
    			"allowIconPosition": true,
    			"defaultIcon": "arrow-right",
    			"defaultIconSize": 24,
    			"defaultIconPosition": "left"
    		}
    	}
    }

    Configuration Options

    Basic Settings

    • template – Default template for new tabs
    • allowedBlocks – Allowed blocks inside each tab panel
    • justifyTabs – Alignment: left / center / right

    Feature Flags

    • allowTabsPrefix – Enable prefix heading
    • allowTabsSuffix – Enable suffix heading
    • allowChangingTabsJustification – Enable alignment control

    Icon Settings

    • allowIcons – Enable icons
    • allowIconSize – Enable icon size control
    • allowIconPosition – Enable left/right position
    • defaultIcon – Default icon slug
    • defaultIconSize – Default size
    • defaultIconPosition – Default position

    Block Attributes

    Tabs Block (Parent)

    • headingLevel
    • tabsPrefix
    • tabsSuffix
    • justifyTabs

    Tab Inner Content (Child)

    • icon
    • iconSize
    • iconPosition
    • hideText

    Usage Examples

    Basic Tabs

    {
    	"dekode-library/tabs": {
    		"template": [["core/paragraph"]]
    	}
    }

    Tabs with Prefix and Suffix

    You can add a prefix like “Choose a topic:” and suffix like “More info below”.

    {
    	"dekode-library/tabs": {
    		"features": {
    			"allowTabsPrefix": true,
    			"allowTabsSuffix": true
    		}
    	}
    }

    Tabs with Icons

    {
    	"dekode-library/tabs": {
    		"features": {
    			"allowIcons": true,
    			"defaultIcon": "arrow-right"
    		}
    	}
    }

    Full Configuration

    {
    	"dekode-library/tabs": {
    		"template": [
    			["core/paragraph"],
    			["core/heading", { "level": 3 }]
    		],
    		"allowedBlocks": ["core/paragraph", "core/heading", "core/image"],
    		"justifyTabs": "center",
    		"features": {
    			"allowTabsPrefix": true,
    			"allowTabsSuffix": true,
    			"allowIcons": true,
    			"defaultIcon": "check"
    		}
    	}
    }

    CSS Classes

    • .dekode-library-tabs
    • .tabs-position-{left|center|right}
    • .has-prefix
    • .has-suffix

    Frontend Hook

    document.addEventListener('onLibraryTabChange', function(event) {
    	console.log(event.detail);
    });

    Foo

  • Query block extended

    Query block extended

    There is no dedicated time for this. So I did it in spare time …
    So sorry for any issue, please report in gitHub any issue if find.

    All elements supports interactivity navigation.

    Styling is really basics just to have something, and cover at least plug-in solutions.

    NOTE: Filters relation is AND

    Key features

    • Search
    • Clear filters –
      • It also fetch the core button regsitered styles and apply to button (outline is buggy in backed due to how WP handles it)
    • Taxonomy filters
      • WP Query block setting aware! – If you select some filtered categories in query it will pick only one that are selected!
    • Order
    • Author
    • Load more
      • Button load more
        • It also fetch the core button regsitered styles and apply to button (outline is buggy in backed due to how WP handles it)
      • Infinity load more
    • Chips
    • Mobile collapse per filers/group filters
    • Post type – Require Library extension to support multi-post type for query block.
    • Native Interactivity API usage – so may not work with custom query block but works with WP core query.

    Multiple way to display filters

    • Dropdown
    • Radio
    • Checkbox
    • Multiselect

    Filter

    Filter can display taxonomies, post type, author and order filter.

    IMPORTANT: Block will automatically fetch available taxonomy and terms (frontend)based on the current query!

    Filter is a single interactive element which allows to build UI as you want.

    Taxonomies loads all taxonomies from currently selected post type in the query.

    The filters type:

    • Taxonomy
      • Dropdown
      • Radio (Vertical/horizontal)
      • Checkbox (Vertical/horizontal)
      • Native multiselect – to allow hook any favorite JS here.
    • Order
    • Author
    • Post Type – in case of multi-post type library extension usage.

    When added it asks to select filer which could be done in sidebar

    The filter in Radio/Checkbox mode can have mobile toggle filter – this is for hide/close the filter to not take too much space

    Editor:

    Basic frontend:

    Cehckbox

    Radio:

    Dropdown:

    Multiselect:

    Filters

    This block allows to add inner block:

    • Query Single filter
    • Query Clear filters
    • Query Chips
    • Query Search
    • Core filters count
    • Core paragraph
    • Core Heading

    The purpose is to allow grouping the filters to have one global collapse on mobile

    Chips

    Show currently applied filters

    Each element has class type of taxonomy/data-type so can be easy styled per taxonomy or type.

    Load more/Infinity load

    This block should not be used with pagination block! Remove it if exists!

    Adds load more functionality. Not there is no align settings for button – sorry 😀

    Infinity load has option for treshold load

    Search

    Custom search for query to make it work and don’t realy on standard search – intentionally to not create any side effects.

    Clear filters

    Adds button to clear filters -visible only when there are filters applied.


    Example usage


    The filters

    18 results found
    Order / Order By

  • Toggle block

    Toggle block

    Simple blocs to toggle visibility of content.

    Block example:

    T2 Facta

    The block is slightly different.

    Facta

    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam cursus consequat enim, eu rhoncus nibh. Praesent tempor ex elit, eget finibus nibh maximus ac. Donec vehicula ultrices augue, ac efficitur tortor.

    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam cursus consequat enim, eu rhoncus nibh. Praesent tempor ex elit, eget finibus nibh maximus ac. Donec vehicula ultrices augue, ac efficitur tortor.

    Features

    For up to date details see https://github.com/DekodeInteraktiv/dekode-library/tree/main/library/dekode-toggle-blocks

    – T2 icons for open close

    "dekode-library/toggle-blocks": {
    	"icons": {
    		"open": "chevronDown",
    		"close": "chevronUp"
    	},
    	"iconPosition": "right"
    }

    – Custom open/close events for tracking :

    • dekode/toggle:open
    • dekode/toggle:close
    document.addEventListener('dekode/toggle:open', (e) => {
        gtag('event', 'toggle_open', {
            toggle_id: e.detail.blockId,
            toggle_label: e.detail.label,
        });
    });
    
    document.addEventListener('dekode/toggle:close', (e) => {
        gtag('event', 'toggle_close', {
            toggle_id: e.detail.blockId,
            toggle_label: e.detail.label,
       

    – Toggle visibility of content blocks

    – Accordion style toggles

    – Customizable toggle labels

    – Accsessible and keyboard-navigable

    – Supports library.json config (see example below).

    – Auto variation registration via Dekode Library Config.

    – Anchor support.

    – Accesibility and keyboard navigation support.

    library.json example

    	"dekode-library/toggle-blocks": {
    		"settings": {
    			"allowedInnerBlocks": ["core/paragraph", "core/image", "core/heading", "core/list"],
    			"template": [["core/image", {}]],
    			"templateLock": false
    		},
    		"variations": {
    			"tester": {
    				"name": "mega-tester",
    				"title": "Mega toggler",
    				"icon": "media-video",
    				"description": "A mega slide.",
    				"settings": {
    					"allowedInnerBlocks": ["core/image", "core/paragraph", "core/list"],
    					"template": [["core/image", {}], ["core/list", {}]],
    					"templateLock": true
    				},
    				"attributes": {
    					"togglePlacement": "top"
    				}
    			}
    		}
    	}

  • Carousel wrapper

    Carousel wrapper

    Basic example

    A wrapper block to make an easy carousel with your desired inner blocks. It will make a wrapper block, a slide block and then you can choose the innerblock. It will automatically add swiper pagination and navigation. The navigation buttons is the t2 chevron left and right.

    Note: This is a very barebone style block, and you will need to style it yourself. It will just generate the functionality.

    Define in your theme.json what inner blocks you want to allow and what the default template should be. If you want multiple carousels with different innerblocks you can create a blockVariation, and define the values in the carousel-wrapper block attributes.

    Everything you define in the block attributes will override the theme.json settings.

    The UX

    UI is simply optimized to show add/remove slide when focused.

    The wrapper has easy to access ADD next slide button

    Carousel only when focused will show the all slides.

    When no slides are available there is a screen to add first slide:

    Variations

    The carousel support register variation from theme.json.

    Each variation can have it’s own unique features/settings.

    Each variation will have extra class to hook styling.

    This way you can have multiple unqie sliders on one page using single block.

    The variation’s settings are read from library.json not from attributes, which make it easy to change later if there is need to.

  • Card template

    Card template

    A simple card wrapper that allow to add custom content inside a card. The idea is to simplify the process of creating a card block with a predefined layout.

    By default, the block block does not have any styling.