Hi,
thanks for this module!
Is it possible to add a fontawesome watch symbol to dates next to the field label?

thanks!

CommentFileSizeAuthor
#3 3156614-label-class-3.patch4.89 KBgausarts

Comments

inst created an issue. See original summary.

gausarts’s picture

Assigned: inst » Unassigned
Category: Support request » Feature request

Sorry for delay. I hope you can make one way or another.

Not via this module, I am afraid. Two options:

  • The easiest, via your theme CSS, be specific:
    .field--NAME .field__label::before { /* regular icon rules, normally :*/ content: \CODE; }
  • The harder, via Twig field.html.twig:
    field__label fa fa-watch, of course conditions must be applied accordingly.

We'll keep it a Feature for a while in case anyone is feeling invited to patch. Thanks.

gausarts’s picture

Status: Active » Needs review
StatusFileSize
new4.89 KB

This will add the new option for field label.

gausarts’s picture

Status: Needs review » Needs work

On second thought, the above will add extra useless divities and might break existing theming.

But can be useful if you want to hook into field template. However this can be added as an option in the future, like what Slick has, if anyone needed one which I highly doubted since it will add complication to theming field.

We'd better put the label inside the existing template linkicon.html.twig instead.

This way at future version we can even drop linkicon.html.twig for core item-list.html.twig to save us another theme to maintain which also support custom title with classes. Since both have similarities.

gausarts’s picture

Hmm, apparently item-list.html.twig has no title_attributes, doh.

No future for replacing linkicon.html.twig with this option in.

So leaving us to decide whether to go with field.html.twig or linkicon.html.twig.

Thoughts?

gausarts’s picture

Status: Needs work » Needs review

On third thought, I think it is fine since it is being optional you can always leave the option empty in case breaking for the recommended #2.
The obvious disadvantage is extra field divities if anyone can live with that :)

  • gausarts committed 43a44b4 on 8.x-1.x
    Issue #3156614 by gausarts, inst: add icon to field label
    
gausarts’s picture

Status: Needs review » Fixed

We have 20 modules to update for D10. Execution matters.

This will do for now. As always improvements or misses may follow behind the screen or bug reports.

Committed. Thank you for contribution.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.