Movable Type Documentation > Appendices > Appendix: Template Tag Modifiers

dirify

Type: modifier

With a value of "1" encodes the tag value into a string suitable for usage in a file or directory name.

"Dirification" is a multi-step process. First the value is converted to lower case. Any HTML tags and entities are stripped. Characters that are not alphanumeric, the underscore (_) or whitespace characters (i.e. space, tab) are stripped. Finally whitespace characters are converted to an underscore characters.

The modifier dirify also converts certain high-ASCII characters (accented characters, etc) to their low-ASCII characters, meaning that something like "crudité" will be converted to crudite.

For example, if the value of the tag without this attribute were:

  • Foo "Baz" is Bar!

...then the dirified version would be

  • foo_baz_is_bar

Example

<mt:tagname dirify="1" />
This page was last updated on 2007-08-13, 15:48.  

1 User Contributed Notes

Su Author Profile Page said:

This filter will also accept a specific string to use as the separator. So, to "dashify" whatever you're modifying, for example, set dirify="-"

Submit a User Contributed Note

User contributed notes are a great way to share the knowledge you have gained in using Movable Type.

If you have a technical question or problem, please visit Movable Type Support.

(If you haven't left a note here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)