Download link Pattern, type and size of files manually

Created on 21 April 2023, over 1 year ago
Updated 29 May 2023, over 1 year ago

Problem/Motivation

Hello !

On the download link pattern, I need to add file size and type on description field manually.

Is it possible to fetch file size and type dynamically using tokens for example , or any particular configuration to get the dynamic behavior once a file is uploaded using the pattern?

Attached images of custom block configuration

I appreciate your help, thank you!

Steps to reproduce

Create a custom block with a field type file with enable description field

Apply the download link pattern

💬 Support request
Status

Closed: works as designed

Version

1.0

Component

Code

Created by

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

Comments & Activities

  • Issue created by @Yidrissi
  • Status changed to Postponed: needs info over 1 year ago
  • 🇫🇷France pdureau Paris

    Hello Yidrissi,

    Thanks for your ticket.

    It seems your question is not related to ui_suite_dsfr, but to general Drupal architetcure.

    You want to add tokens to a text field ("Description"), which will retrieve data from other fields ("Type" and "Size") of the same content entity.
    Maybe you will find a module like field_token_value to achieve that.

    Or, instead of using your pattern as a field formatter plugin from an other entity, you may need to work on the content entity view display, where the pattern is a layout, where all those fields ("Description", "Type", "Size"...) are available, and where you can map many entity fields to a single pattern field.

    Is it useful?

  • Hello !

    Indeed it's a way to achieve that. Since I was implementing components as a potential contributor who doesn't have much knowledge in drupal than using a layout builder, I was rather thinking about an easier way to configure components.

    Thanks for your help !

  • Status changed to Closed: works as designed over 1 year ago
  • 🇫🇷France pdureau Paris

    You are welcomed Yidrissi.

Production build 0.71.5 2024