Community & Support

Can I apply input format filters like urlicon to blocks like menus?

I want to apply the urlicon input format filter to all of my blocks, not just customized ones. I want icons to show up next to the menu links just as they do on my page bodies.

Can I apply input format filters like urlicon to blocks like menus?

I tried using an embed snippet to put out the block in a custom block that does have the filter but nothing is outputted. I have gotten custom blocks to output other custom blocks but not the module-generated blocks.

<?php
$block
= module_invoke('user', 'block', 'book', 0);
print
$block['content'];
?>

Comments

intersting ask

Not sure about the best approach to you first question, but for invoking arbitrary blocks, you want:

<?php
$block
= module_invoke( $module_name, $hook, $action, $block_identifier) );

$block = module_invoke( 'user', 'block', 'view', 0) );
?>

Your example wil not work because 'user' module does not allow the action 'book' on its block #0.

.dan.
How to troubleshoot Drupal | http://www.coders.co.nz/

what hooks should I use for blocks and views?

I'd also like to be able to apply input type filters to Views so that links could have icons applied by urlicon. Is there a hook I could use for Views and Blocks output where I could apply the format filters just as they're hooked into node content display?

no idea

I have no idea where you'd start with that.
If the views are rendering textareas, they should respect the filter rules they were entered with.
If it was a textfield, plaintext is not filtered.
You say views, but isn't this a CCK rendering issue instead?

I guess you could try running the filter over all your $content by modifying your page.tpl.php or something.

.dan.
How to troubleshoot Drupal | http://www.coders.co.nz/