Forum Discussion
This can be accomplished by setting up a content filter and setting the behavior to "replace". Whenever a keyword is matched, it will be replaced with the term you have chosen.
Community Admin > Mod Tools > Content Filters
One word of best practices advice here - make sure that you message to users why you are forcing the replacements. It can be frustrating to submit a post and then see that the content has magically been changed.
- tagged-leo13 years agoAce
Okay - one more detail here.
I have two CNAME'd URLs pointing to the same Lithium Community. Here they are:
http://help.tagged.com & http://help.hi5.com
The additional logic I need to put in there is:
If servername = help.tagged.com, replace all instances of 'hi5' to 'tagged'
Else if servername = help.hi5.com, replace all instance of 'tagged' to 'hi5'
Is this doable using content filters?
- BrianO13 years agoLithium Alumni (Retired)
As far as I know, we do not have the ability for a filter to use CNAME as a parameter as you have described.
- AdamN13 years agoKhoros Oracle
Hi Leo,
If you wanted to purely use freemarker, there may a few different standard components you'd have to replace depending on to what extent you wanted to make replacements. I think the key one would be the message body (via the Forum Message Page). You'd have to use the env context object to get the message id of the message you're rendering, then make a REST API call to get the message body. Then you'd need to use the http.request context object to determine what the current hostname is, in conjunction with the freemarker replace built in to swap the text.
If you're just interested in replacing links, jQuery would make it pretty straightforward to do that on the fly.
- tagged-leo13 years agoAce
Thanks Adam. jQuery may be the way to go; I'm just afraid that the user may see some strange flicker during the page load. I'll report once we have something working.
Related Content
- 2 years ago
- 3 years ago
- 2 years ago
- 3 years ago