As content-type plug-ins could be used multiple times, the id attribute should not be used. Patch adds the ability to set id and class attributes. For backward compatibility id=logo will be used if config['id'] is not set.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

osopolar’s picture

Issue summary: View changes
Status: Active » Needs review
FileSize
2.1 KB

Workaround: Clone the content type plug-in in a custom module.

Chris Matthews’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll

The 4 year old patch to page_logo.inc does not apply to the latest ctools 7.x-1.x-dev and if still applicable needs a re-roll.

Checking patch plugins/content_types/page/page_logo.inc...
error: while searching for:

  if (!empty($logo)) {
    $image = '<img src="' . $logo . '" alt="' . t('Home') . '" />';
    $block->content = l($image, '', array('html' => TRUE, 'attributes' => array('rel' => 'home', 'id' => 'logo', 'title' => t('Home'))));
  }

  return $block;

error: patch failed: plugins/content_types/page/page_logo.inc:30
error: plugins/content_types/page/page_logo.inc: patch does not apply
shubham.prakash’s picture

Status: Needs work » Needs review
FileSize
2.11 KB

Rerolled #1

joelpittet’s picture

Category: Bug report » Task
Status: Needs review » Needs work
Issue tags: -Needs reroll

I like what this is trying to achieve, not really a bug but kind of a task so moving it to that.

  1. +++ b/plugins/content_types/page/page_logo.inc
    @@ -30,7 +62,21 @@ function ctools_page_logo_content_type_render($subtype, $conf, $panel_args) {
    +      $attributes['id'] = 'logo';
    

    This should probably go in the defaults as with the defaults it would be empty.

  2. +++ b/plugins/content_types/page/page_logo.inc
    @@ -30,7 +62,21 @@ function ctools_page_logo_content_type_render($subtype, $conf, $panel_args) {
    +      $attributes['class'] = $conf['class'];
    

    This needs to be an array or it throw an error in the l() function when it's used as one.