If you want that kind of functionality in the editor i think you will have to index the classname to the search index yourself.
Implementation would vary depending on search provider.
this should be what you're after
var contentTypeRepository= ServiceLocator.Current.GetInstance<IContentTypeRepository>(); var modelUsage = ServiceLocator.Current.GetInstance<IContentModelUsage>(); var blockType= contentTypeRepository.Load(typeof(BLOCKTYPE)); var items = modelUsage.ListContentOfContentType(blockType);
then use contentlink property on each of the items to get a reference to all the blocks/pages of that type.
I would yeild caution on contentModelUsage as I think this queries the database instead of cache. My fellow collegues might know the answer about the database quering but I am pretty sure it does.
Sorry for the misunderstanding.
I am not sure you can without using episerver find or writing your own module to do so. EPiServer find has "Power Slice" but you will need to have a find license.
you do something as follows
[Component(PlugInAreas = "/episerver/cms/assets", Categories = "cms", WidgetType = "modeltypesearch/modelsearch", Title = "Content Type Search", Description = "")] [ServiceConfiguration(typeof(IContentQuery))] public class ModelTypeSearchComponent : ContentQueryBase { public override string Name { get { return "CustomQuery"; } } protected override IEnumerable<IContent> GetContent(ContentQueryParameters parameters) { / /Enter code above based on input to search for type. } }
<div> <div class="epi-gadgetInnerToolbar" data-dojo-attach-point="toolbar"> <div data-dojo-type="dijit.form.TextBox" data-dojo-attach-point="queryText" data-dojo-props="intermediateChanges:true" data-dojo-attach-event="onChange: _reloadQuery"></div> </div> <div data-dojo-type="epi.cms.component.ContentQueryGrid" data-dojo-attach-point="contentQuery"></div> </div>
The above is your template for the module.
then in module config, add the following
<?xml version="1.0" encoding="utf-8"?> <module> <assemblies> <add assembly="YourAssemblyName" /> </assemblies> <dojoModules> <add name="modeltypesearch" path="ModeTypelSearch" /> </dojoModules> </module>
Give that a try.
so the template and code goes in
/modules/ModelSearch/templates
/modules/ModelSearch/modeltypesearchcomponents.cs
The title is self explanatory. As an example, let's say i have a FooBlock and a FooPage. How do I find all instances of the FooBlock and the FooPage in the CMS? Searching for the FooBlock in the assets pane and the FooPage in the navigation pane does not yield any results.