would it be possible to add a 'br' tag to the followline line in bean.module?

      'subject' => isset($bean->title) ? filter_xss($bean->title, $allowed_tags = array('em', 'strong', 'i', 'b')) : '',

as far as I can tell, this is the only way I can allow for break tabs in titles in beans, hook_block_view_alter won't work.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

markchitty created an issue. See original summary.

markchitty’s picture

Title: Adding a <br> tag to the list of allowed tags in the title » Adding a <br /> tag to the list of allowed tags in the title
Issue summary: View changes
kevster’s picture

Good idea @markchitty - I would find this very useful too - dont want to be hacking the module for obvious reasons.

abbym’s picture

This patch adds <sup> and <sub> as well as <br>, per the needs of a client.

abbym’s picture

Status: Active » Needs review
DamienMcKenna’s picture

Version: 7.x-1.9 » 7.x-1.x-dev
Status: Needs review » Needs work

A better approach would be to add a hook which would allow other modules to modify the list.

The hook should allow an array of allowed tags, which could then be modified by other modules as needed.

Samvel’s picture

Status: Needs work » Needs review
FileSize
2.1 KB

Integrated hook and alter to allow other modules modify allowed tags for title field, as said @DamienMcKenna

Patch attached.

Samvel’s picture

Attached new patch with explanations in bean.api.php

DamienMcKenna’s picture

Status: Needs review » Needs work

I don't think we need two hooks for such a tiny feature request, so bean_bean_title_allowed_tags() could be merged into bean_get_title_allowed_tags() and then remove the extra module_invoke_all().

Samvel’s picture

Status: Needs work » Needs review
FileSize
2.42 KB
1.33 KB

Provided new patch and interdiff with previous patch.

DamienMcKenna’s picture

Status: Needs review » Needs work

Minor polish.

  • The comments need to wrap at 80 characters.
  • The docblock added to api.php file shouldn't lead with the format "Implements hook_BLAH()." it should just describe what the function does.
  • The return part of the docblock on bean_get_title_allowed_tags() shouldn't have brackets after the word "array" and the comment line needs to be indented.
  • Please add a comment for the drupal_alter() line that indicates what hook is being called.
Samvel’s picture

Status: Needs work » Needs review
FileSize
2.42 KB
1.11 KB