Search content item for specific content upon creation/publish

Topics: Administration, Core, Customizing Orchard, General
Aug 28, 2014 at 6:23 PM
Is there a way to use the Orchard Workflows module to search the contents of any content item when it is created or published for any anchor tags and then alter those anchor tags to include a "speed bump"?
Aug 29, 2014 at 3:30 AM
You could if you wrote a custom Activity that does this for you.
Question: what is a "speed bump"?
Aug 29, 2014 at 4:46 AM

A speed bump is what I was told the warning that pops up when a user is about to leave the site and go to a site on another domain is called. You can see an example of this if you go to and click on the blue "directions" button. I need to create this but in Orchard preferably using the workflows module.

How would I go about writing a custom activity that will do that for me. I'm fairly new to c#, .net, orchard, and the whole mvc model. I have created a custom activity before that shows up in the list of activities but I was unable to make the activity do what I wanted it to do. I suspected this would be possible if I created a custom activity but I do not know how to get it started. Sorry for my noobishness.

Thank you for your help it is greatly appreciated.
Aug 29, 2014 at 6:07 AM
Edited Aug 29, 2014 at 6:07 AM
Please see my answer regarding the speed bump implementation on the other thread.
Regarding the question in your title: you could access the BodyPart of a content item (if it has one) and search its Text property. But given your scenario, I don't think you want to change the URLs upon creation/publication. Instead, you either want to do this client side using script, or on the fly at runtime, server side, using a custom implementation of IHtmlFilter, which lets you implement a method called ProcessContent. In this method, you can search for <a> elements and modify their href attribute.
Marked as answer by emeraldarcher on 8/29/2014 at 9:48 AM