Drupal Aggregator Data Input Format

The core Drupal Aggregator module is useful, but you have a lot of problems. Drupal 7 talks a lot about improvement.

I am currently using the Aggregator module that comes with Drupal 6. I am creating an aggregator site and there is one BIG problem. Sometimes feeds contain HTML tag attributes (like style, dir, title), but the aggregator input format filter ignores some attributes (like style and directory) and allows others (class and href). Without some of the attributes, feeds look very boring. The aggregator contains its own input format, it does not use other input formats (and this complicates the task!).

The question is how to allow some attributes of HTML tags to appear in feeds.

PS The last thing to do is change the main Aggregator files

+1


source to share


4 answers


You might want to consider switching to one of the new solutions built on top of FeedAPI

http://drupal.org/node/326601



As you can see from now on, this is an action, aggregated.

+1


source


Move to FeedAPI. The only drawback of this is the lack of direct blocks for different channels. However, it is possible to set them using a nodeblock and embed the view in the feed node of the feed items, which also allows you to use Views and the feedapi mapper to determine what information is displayed in each feed.

An aggregator is just a bad module for any heavy lift with feeds. It doesn't provide flexibility and doesn't play well with Views. If you are serious about creating an entire site for aggregation, switch to feedapi and then use views to control the display of nodes that can be generated from feeds.



It will take some work, but you will end up saving yourself headaches trying to find a mystical feed aggregator solution that probably doesn't exist.

+1


source


I ditched the aggregator a long time ago, but I would suggest you dig into the source to understand what the problem is. Most of the base modules are well documented, and this is the easiest way to see how a module works.

My guess is that it either uses a hardcoded tag string to allow, or it is copied in Filtered HTML format.

0


source


In short and simple. Have a look at the aggregator_filter_xss () function at http://api.drupal.org/api/function/aggregator_filter_xss .

<?php
function aggregator_filter_xss($value) {
  return filter_xss($value, preg_split('/\s+|<|>/', variable_get('aggregator_allowed_html_tags', '<a> <b> <br> <dd> <dl> <dt> <em> <i> <li> <ol> <p> <strong> <u> <ul>'), -1, PREG_SPLIT_NO_EMPTY));
}
?>

      

As you can see there is a drupal variable called aggregator_allowed_html_tags.

You only need to make it editable in the settings form from one of your modules. Since I haven't found which drupal admin page allows you to edit this variable, I would say it doesn't.

Here's the code you'll need for your custom module:

function your_module_settings()
{
    $form = array();

    // Params para aggregator
    $form['aggregator_allowed_html_tags'] = array(
        '#type'          => 'textarea',
        '#title'         => t('Core Module Aggregator allowed tags'),
        '#default_value' => variable_get('aggregator_allowed_html_tags', '<a> <b> <br> <dd> <dl> <dt> <em> <i> <li> <ol> <p> <strong> <u> <ul>'),
        '#required'      => TRUE,
        '#description'   => t('Core Module Aggregator allowed tags'),
    );

    return system_settings_form($form);
}

function your_module_menu()
{
    $items = array();

    $items['admin/content/your-module'] = array(
        'title'            => 'My module settings',
        'description'      => 'desc',
        'page callback'    => 'drupal_get_form',
        'page arguments'   => array('your_module_ pasos'),
        'type'             => MENU_NORMAL_ITEM,
    );

    return $items;
}

      

Hope this is helpful.

0


source







All Articles