Currently the aggregator module does not provide fine grained template suggestions for its blocks. The normal path for overriding block themes is insufficient (e.g. removing the Read More link for a specific feed/category). A simple reorganization provides the support needed. Will have a patch posted ASAP for review.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dcousineau’s picture

Status: Active » Needs review
FileSize
1.71 KB

Included patch to introduce block template suggestions

20th’s picture

Version: 7.x-dev » 8.x-dev
FileSize
4.52 KB

Hi! Maybe there will be even more control over theming, if this block returns a renderable array instead of a string, as it should. That way there will be no need for overriding theme to remove the Read More link, as it could be done simply in a hook_block_view_alter().

Also, I think it is already too late to make this sort of changes in D7.

fprevos2’s picture

Could something like this be done for Drupal 6? I would like to theme each the feeds items with a different theme for each feed.

Thank you

EDIT:
I made the following change to aggregator to use template file for items. I'm currently unable to get the core using git to make a proper patch.

Add a line in the function aggregator_theme:

  Before change:
    'aggregator_block_item' => array(
      'arguments' => array('item' => NULL, 'feed' => 0),
    ),

  After Change:
    'aggregator_block_item' => array(
      'arguments' => array('item' => NULL, 'feed' => 0),
      'template' => 'aggregator-block-item',
    ),

Add the following code:

/**
 * preprocess_aggregator_block_item_hook().
 *
 * @param &$variables
 * 
 */
function aggregator_preprocess_aggregator_block_item(&$variables) {
  if (isset($variables['item']) && isset($variables['item']->fid)) {
    $variables['template_files'][] = 'aggregator-block-item-' . $variables['item']->fid;
  }
}

After the change I create a default template file (aggregator-block-item.tpl.php) that output the same as the function theme_aggregator_block_item.
You can now create a new template file for each feed (name your file aggregator-block-item-x.tpl.php where x is the feed number).

mohan gowda’s picture

Version: 8.x-dev » 6.x-dev

can you please elaborate more on this.
I am trying to redefine my template as shown in the below pattern.

The main heading of the block

  • subheading1
  • subheading2
  • subheading3

that is the requirement is to indent the subheading.

please help me out to get user defined block.

ParisLiakos’s picture

Version: 6.x-dev » 8.x-dev
Issue tags: -aggregator

This should go in d8 first, please dont change versions

closed #1877830: Possibility for a theme to hook item_list only for Aggregator module as duplicate

Status: Needs review » Needs work

The last submitted patch, 2: aggregatortheming-1130902-2.patch, failed testing.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev
quietone’s picture

Project: Drupal core » Aggregator
Version: 9.3.x-dev » 1.x-dev
Component: aggregator.module » Code
Issue summary: View changes

The aggregator module has been removed from Core in 10.0.x-dev and now lives on as a contrib module. Issues in the Core queue about the aggregator module, like this one, have been moved to the contrib module queue.

larowlan’s picture

Status: Needs work » Closed (works as designed)

Now these are entities, there are preprocessing hooks