By maxiorel on
Hi, I am using Custom filters module and I need to place my own code after first end of paragraph. How can I do this using Custom Filters?
I have </p> in pattern and in replacement text i have this:
$result = '</p>';
$result .= '<!-- info -->';
return $result;
However that doesn't seem to work. It replace every occurrence of paragraph end. The bigger problem is that it seems to be placed into another < and >. :-(
Comments
Re: Custom filters and placing after first </p>
anyone has an advice for me please?
Jan Polzer, Drupal & Symfony developer
I never used the custom
I never used the custom filters module. A question like this may be best answered in the "I installed drupal, how do I.." forum. This forum is for people coding their own modules.
OK, sorry for my bad choose.
OK, sorry for my bad choose.
Jan Polzer, Drupal & Symfony developer
Hi, maxiorel,
Hi, maxiorel,
The key is, there should be a mechanism to record the first paragraph detected, and to replace matched string only when it is the first detected paragraph. An example might be like this:
The pattern cannot just a plain
</p>, but we should enclose it with(..)or<..>like this:(</p>).Hope it helps.
This works
Thank you very much! This works excellent.
Jan Polzer, Drupal & Symfony developer
replace break
First
<p>replacement solution by arhip works well.Is it possible to replace
<!--break-->? Or print something after<!--break-->on node view?Thanks.
Federico