Add token support for fences classes fields

Created on 7 November 2022, over 1 year ago
Updated 14 February 2024, 4 months ago

Comment on this approach

I really like to 'global scope' approach of this module - the idea of setting up attributes ONCE and then being able to reply on them everywhere is refreshing.

What I trying to achieve with it

One of the things I am trying to effect with Fences is that ability to 'wrap' a paragraph field in a class like:

  • small
  • medium
  • large

And to do so on a paragraph-by-paragraph basis.

I realise that I can easily do that using Classy paragraphs β†’ but I'm trying to be as lean as possible and feels like I ought to be able to build this kind of structure easily using a simple 'size' field on my paragraphs in combination with a full-site approach like Fences but..

How do effect the kind dynamic action I'm after?

My instinct is to look to (https://www.drupal.org/project/token) and then use fields tokens to add the class attributes but Fences doesn't support tokens and there are no obvious discussions about it a far I can see.

So, either I've go the wrong end of the stick and very idea of thinking about dynamic classes with Fences is tantamount to heresy, in which case I'de be grateful for any pointers anyone has as to how to achieve what I'm after.

I know I easily do this type of thing routinely with Display Suite β†’ but I'm not sure I wan to go there again given my lean/Drupal 10+ bottom line and the D10 version isn't ready anyway.

Any guidance gratefully received.

Thanks

✨ Feature request
Status

Active

Version

3.0

Component

Markup

Created by

πŸ‡¬πŸ‡§United Kingdom SirClickALot Somerset

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024