Is it possible to modify the General Link field in Sitecore to enable queries to be used in the 'Source' in the template field definition? I'm hoping that it might be possible to add a pipeline processor to handle queries for the General Link field in a similar way that this article describes enabling queries for Treelists and Datasources.
Unfortunately it's not possible with a pipeline since the source resolution does not happen with a pipeline like it does with DropLink field for example.
You can set an absolute path and that works fine... In order to make the source queryable you would have to inherit Sitecore.Shell.Applications.ContentEditor.Link
and override the Source property to resolve the query, resolving the query in pretty much the same way you have linked to.
The current implementation does a simple GetItem:
Item obj = Client.ContentDatabase.GetItem(this.Source);
Whereas we need a item.Axes.SelectSingleItem()
type query. Unfortunately that means a custom field type or updating the current field type in the core database.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With