Inspired by Tridion Stack Exchange Question.
There is one more thing about list definition which is not used enough despite being flexible and powerful.
It is List Definition Path resolver.
In dashboard view you can define associations between items and theirs list representations (configured in list definitions). You can do so specifying EditorName, ViewID, ControlID, parent ItemID regular expression mask and associated definition path. When dashboard is asked to load content of the item which fits the conditions, it will render the list, based on associated definitions.
To define this association in extension you should extend existing editor configuring listdefinition section in the extensions section.
In this case all items in FilteredItemsList from DashboardView whose parent item ID matches the ^tcm:0$ rule will be rendered with /Xml/Definitions/ListDefinition.xml definition.
In this case the following rules are used to determine the association priority:
In simple, the more specific the association is, the higher priority it has.
There is one step further you can do.
When you define an association, you can also define path resolver which will resolve this association definition path.
The resolver usage is very simple, it has the following parameters: EditorName, ViewId, ControlId, itemId. And as a result it should return the path to the List Definition XML file.
And then it is up to you how to resolve the path. You can map it to HTTP handler and pass a bunch of parameters. And then leave it up to the server to decide what should be output.
You also have an access to entire CME runtime, and can simply use repository or all other variables you might need to use.