We are storing some legal text in a Site Setting and rendering it via Twig. I was wondering if there is a way for me to obtain a render array of the actual field holding the text, rather than just getting the raw value via {{ site_settings.X.Y }}.

This would be a time saver as on our project it would mean the text would be rendered through our field--text-long.html.twig template, which would make sure the font-size, line-height etc was all correct.

Comments

Phil Wolstenholme created an issue. See original summary.

Phil Wolstenholme’s picture

Issue summary: View changes
Phil Wolstenholme’s picture

Title: Rendering site settings entities » Rendering the fields that hold site setting values using render arrays
scott_euser’s picture

Hi there,

There is no option for this at the moment but it is not the first time I have heard a request for that. Would be grateful if someone would be willing to contribute a patch. The current functionality should be the default, to avoid it being a breaking change, with an option to choose perhaps a field formatter or if an entity a display mode?

Thanks,
Scott

anybody’s picture

Status: Active » Closed (duplicate)

Well I think it's the same requirement as in #3067325: Provide the whole (rendered) entity as token so let's close this issue as duplicate. It would be nice to get some help / support in that other issue @Phil Wolstenholme!