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',
      ),
CommentFileSizeAuthor
#3 edit_move_help_text-2825781-3.patch2.13 KBcebasqueira
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

criz created an issue. See original summary.

cebasqueira’s picture

Assigned: Unassigned » cebasqueira
cebasqueira’s picture

Assigned: cebasqueira » Unassigned
Status: Active » Needs review
FileSize
2.13 KB
faline’s picture

Status: Needs review » Reviewed & tested by the community

I applied the patch and It's ok for me.

  • criz committed 2b92b3e on 8.x-1.x authored by cebasqueira
    Issue #2825781 by cebasqueira, criz, faline: Move help text html into a...
criz’s picture

Thanks, looks good. It has been committed to latest dev.

criz’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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