Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The html for the help text is hardcoded currently. See shariff_help().
Although this is done in most modules this way currently I propose to add an extra template file for this that could look like this:
{#
/**
* @file
* Template for shariff help text html.
*
* Available variables:
* - title: The help title.
* - content: The main help text.
*
*/
#}
<h3>{{ title }}</h3>
<p>{{ content }}</p>
The variables title and content can be provided in shariff_help() like this:
$output = array(
'#theme' => 'help_shariff',
'#title' => t('About') . ' Shariff',
'#content' => t('The Shariff social media buttons library by heise online enables website users to share their favorite content without compromising their privacy. For more information see <a href="@url">@url</a>.', array('@url' => 'https://github.com/heiseonline/shariff'))
);
return $output;
Of course the new template must be registered in shariff_theme():
'help_shariff' =>
array(
'variables' => array(
'title' => NULL,
'content' => NULL
),
'template' => 'help--shariff',
),
Comment | File | Size | Author |
---|---|---|---|
#3 | edit_move_help_text-2825781-3.patch | 2.13 KB | cebasqueira |
Comments
Comment #2
cebasqueira CreditAttribution: cebasqueira at CI&T commentedComment #3
cebasqueira CreditAttribution: cebasqueira at CI&T commentedComment #4
faline CreditAttribution: faline at CI&T commentedI applied the patch and It's ok for me.
Comment #6
crizThanks, looks good. It has been committed to latest dev.
Comment #7
criz