Is it possible to set the datasource location (not the datasource) to be a sitecore query?
What I'm trying to do is to have the sublayout set its datasource location to a folder under the item containing it (current item).
The sublayout datasource location should point to a folder under the current item. So I tried setting the datasource location to query:./Items/*
but that did not work.
You don't need the query -- the sublayout datasource location can simply use a relative path. e.g.
Obviously though, that folder needs to exist already. I've been meaning to blog this code, and it may be overkill but I'll post here since it may help you. The following can be added to the
getRenderingDatasource
pipeline to create a relative path datasource location if it doesn't exist already. Add it before theGetDatasourceLocation
processor.On the sublayout, you'll want to add a parameter
contentFolderTemplate=[GUID]
to specify the template of the item that gets created.