Content Filters
About Content Filters
Content Filters in DasBlog let you filter and change the input text based on regular expressions. This allows you to create a shorthand for things like similes, Google searches, etc.
Overview
Certain Content Filters are enabled by default in DasBlog and you can create your own, as well as modify and/or delete the existing filters.
Content Filter Settings
Apply filters when rendering content on web pages
When checked, DasBlog will evaluate content against the Content Filters and render output on the DasBlog Web pages accordingly.
Apply filters when rendering content in syndication formats
When checked, DasBlog will evaluate content against the Content Filters and render output on the DasBlog syndication feed(s) content accordingly.
Default Filters
|
Description |
Content |
Maps To |
Regular Expression |
Sample Input |
|
Google search |
\$g\((?<expr>[\w\s\d]+)\) |
<a href="http://www.google.com/search?q=${expr}">${expr}</a> |
Yes |
term produces a hyperlink to a Google search on the term(s) specified in the parentheses |
|
Definition search |
\$d\((?<expr>[\w\s\d]+)\) |
<a href="http://dictionary.reference.com/search?q=${expr}">${expr}</a> |
Yes |
definition produces a hyperlink to a search on dictionary.reference.com for the term specified in the parentheses |
|
Open Mouth Emoticon |
:-o |
<img alt=":-o" src="smilies/openmouth.gif">  |
No |
:-0 displays the openmouth.gif image from the smilies directory |
|
Frown Emoticon |
:-S |
<img alt=":-S" src="smilies/frown.gif">  |
No |
:-S displays the frown.gif image from the smilies directory |
|
Happy Emoticon |
:-D |
<img alt=":-D" src="smilies/veryhappy.gif">  |
No |
:-D displays the veryhappy.gif image from the smilies directory |
|
Unhappy Emoticon |
:'( |
<img alt=":'(" src="smilies/unhappy.gif">  |
No |
:'( displays the unhappy.gif image from the smilies directory |
|
Wink Emoticon |
;-) |
<img alt=";-)" src="smilies/wink.gif">  |
No |
;-) displays the wink.gif image from the smilies directory |
|
Happy Emoticon |
:-) |
<img alt=":-)" src="smilies/happy.gif">  |
No |
:-) displays the happy.gif image from the smilies directory |
Community Contributed Filters
|
Description |
Content |
Maps To |
Regular Expression |
Sample Input |
|
NetFlix Search |
\$nf\((?<expr>[\w\s\d])\) |
<a href="http://www.netflix.com/Search?v1=${expr}" title="Search for ${expr} on NetFlix.com">${expr}</a> |
Yes |
$nf(term) displays a hyperlink to a search on NetFlix.com for the term in parentheses |
|
ISBN Search |
\$isbn\((?<expr>[\w\s\d])\) |
<a href="http://isbn.nu/${expr}" title="Search for ISBN ${expr} on isbn.nu">${expr}</a> |
Yes |
$isbn(number) displays a hyperlink to a search on isbn.nu for the number in parentheses |
|
IMDB Search |
\$imdb\((?<expr>[\w\s\d])\) |
<a href="http://www.imdb.com/find?q=${expr}" title="Search for ${expr} on imdb.com">${expr}</a> |
Yes |
$imdb(term) displays a hyperlink to a search on IMDB.com for the term in parentheses |
|
del.icio.us |
\$del\((?<expr>[\w\s\d]+)\) |
<a href="http://del.icio.us/tag/${expr}">${expr}</a> |
Yes |
$del(term) searches del.icio.us tags for the search term |
|
Open links in new window |
\$e\((?<expr>[\w\s\d\./]+)\) |
http://${expr}" target="_blank |
Yes |
If you add $e(url) as href for a link, it gets manipulated so the link opens in a new window. NOTE: Enter the url without http:// |
Filters can also be added to the ContentFilters section of the SiteConfig\site.config file
<ContentFilter find="\$del\((?<expr>[\w\s\d]+)\)" replace="<a href="http://del.icio.us/tag/${expr}">${expr}</a>" isregex="true" />
More Information
For more information about regular expressions in .NET, see Regular Expressions Language Elements in the MSDN Library.
Others to play with:
http://www.flickr.com/photos/tags/