Closed (fixed)
Project:
Wordfilter
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
7 Nov 2008 at 12:58 UTC
Updated:
1 Dec 2008 at 16:13 UTC
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
Comment #1
bartezz commented*CompanyName by
<span class="corporate">CompanyName</span>Comment #2
bartezz commented*Bump* sorry...
No ideas on this?
Comment #3
jaydub commentedYour 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>'
Comment #4
jaydub commentedIf 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.
Comment #5
bartezz commentedThanx for your help!!
Will look at the input filter settings and the modules you've mentioned!
Regards,
Bartezz
Comment #6
bartezz commentedWell 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>-phonebut 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>-podand 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
Comment #7
bartezz commentedEven 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>-careBut it's when it's being replaced it drops the hyphen -. Yet when I place it in the next paragraph;...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
Comment #8
jaydub commented#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.
Comment #9
bartezz commentedFound 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
Comment #10
bartezz commented"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
Comment #11
jaydub commentedComment #12
jaydub commented