Hi,

I was looking for a solution to replace words on my website with marked-up words and thought wordfilter would do the job. What I'm trying to accomplish is that if a moderator enters a text and forgets to change the markup that the system will do it for him.

For instance, if your brand is e-Phone but you want it written e-Phone. One could also imagine that the company name should have a different style applied to it you could replace CompanyName by CompanyName.

I couldn't get this to work with the current version of wordfilter, maybe I overlooked something, if not it would be a nice feature!

Thanx for a great module!
Cheers

Comments

bartezz’s picture

*CompanyName by <span class="corporate">CompanyName</span>

bartezz’s picture

*Bump* sorry...

No ideas on this?

jaydub’s picture

Your example works for me. You might want to check the order of your filters. If you have a filter that strips HTML such as your example of a tag then you won't get the end product you are seeking.

I tested your example literally meaning filtering on the string '*CompanyName" and replacing
with '<span class="corporate">CompanyName</span>'

jaydub’s picture

If you are looking for a more generalized markup filter then wordfilter isn't really what you should be looking at. One of the markup filters such as http://drupal.org/project/markdown or http://drupal.org/project/bbcode or http://drupal.org/project/customfilter might be what you would want in that case.

bartezz’s picture

Thanx for your help!!
Will look at the input filter settings and the modules you've mentioned!

Regards,
Bartezz

bartezz’s picture

Well I gave it a shot and what I had to do is to disable it for node titles as I can't find a way to enable HTML for it. It does work for the body field but it's buggy (or I have messed up).

I think it caches somehow. I create a word filter for the word i-phone -> <em>i</em>-phone but when I started the body field with that word i-phone it did nothing?? So I changed the word filter to i-pod -> <em>i</em>-pod and altered the body field of my content and preceded the word i-phone with i-pod.

My content was thus reading: "i-pod i-phone Lorem ipsum..."
But the output became i-pod <em>i</em>-phone Lorem ipsum...

So nu cursive on i-pod but on i-phone eventhough I changed and saved the word filter?

Bit strange?? What am I doing worng?

Cheers

bartezz’s picture

Even more funny; I have a node with just the word we-care in the body field (full HTML with word filter etc). I want it being shown as <em>we</em>-care But it's when it's being replaced it drops the hyphen -. Yet when I place it in the next paragraph;

<p>&nbsp;</p>
<p>we-care</p>

...it does work?!

Maybe there's a small bug in this module that hates the word 'we'?? :p Cause if i change the filter and node to do-care it does work on the first line???

Cheers

jaydub’s picture

#7 no such problems with the hyphen when I test your filter based on what you've stated.

#6 all Drupal filters cache their filtered results. That's by design. You can use the devel module to clear your caches or you can test by continuing to create new posts to avoid caching.

bartezz’s picture

Found it... I tried disabling and uninstalling... no avail, but when I disable the word filter in admin/settings/filters/, save the settings and then enable it (after creating new filters in admin/settings/wordfilter) it does work...

So when adding new filters: disable and re-enable the word filter for your input format :)

Cheers

bartezz’s picture

"all Drupal filters cache their filtered results"... didn't know that, sounds logical and thought that something like this was going on! Well got it working now, sorry for asking something I should have read up on more.

Regards,
Bartezz

jaydub’s picture

Status: Active » Fixed
jaydub’s picture

Status: Fixed » Closed (fixed)