More flexible rendering / text format

Created on 21 May 2019, about 5 years ago
Updated 9 September 2023, 10 months ago

It's a good thing that this module provides a lot of options, however, the text format is a bit restrictive. It will be good to be able to type the copyright notice by hand.

Solution 1: Twig template

Simply send all variables to a twig file and let it handle the rendering. That way, if someone wants a different text format, they can simply override the twig file.

Solution 2: Format string

Alternatively, create one more option which will allow the admin to enter a copyright message string with tokens. These tokens can then be replaced by the actual variables. Make sure this format string is translatable though.

Ex: ยฉ [start-year] - [end-year] [organization-name]. All rights reserved.

โœจ Feature request
Status

Needs work

Version

2.0

Component

Code

Created by

๐Ÿ‡จ๐Ÿ‡ฆCanada jigarius Montrรฉal

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.

  • First commit to issue fork.
  • @rowrowrowrow opened merge request.
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Manoj Raj.R Chennai

    Looks like a good catch to me.

  • Status changed to RTBC over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia rckstr_rohan

    Reviewed the MR !6, worked well for me.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States yas California ๐Ÿ‡บ๐Ÿ‡ธ

    @kecsot @manoj-rajr @rckstr_rohan @rowrowrowrow

    Thank you for your contribution and sorry for my super-late response. I posted my comment fo the coding standards, however I prefer Solution 2 if we want to customize the format since the proposed patch introduces somewhat additional layers such as 'Twig' and 'module'.

    I understand that we need .module to use hook_theme(), on the other hand the design concept of this module is to provide as a block plugin, which should be simple as much as possible. Therefore, this module for a copyright block doesn't have .module file purposefully. Also, in modern UI era such as SPA, I assume that the role of Twig will be getting less and less.

  • Status changed to Needs work 10 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States yas California ๐Ÿ‡บ๐Ÿ‡ธ
Production build 0.69.0 2024