Vulnerability in EPiServer.Forms

Try our conversational search powered by Generative AI!

Remove the «Suggested Page Types» section when creating a new page



Is it possible to remove the section called «Suggested Page Types» when creating a new page? When there's few available pagetypes I find it redundant to show the «Suggested Page Types» section, because it looks like there are duplicate page types available.

Does anyone know how to do this through configuration or code?

// Anders

Sep 10, 2014 16:23


Never liked this feature. We always try to reduce the number of template you can choose from, and it would look much more tidy without the "Suggested Page Types" section.

Sep 10, 2014 19:55

There seems to be an Ajax call similar to /EPiServer/cms/Stores/contenttype/?query=getsuggestedcontenttypes&parentReference=4048_4124&requestedTypes=episerver.core.pagedata, which is handled by EPiServer.Cms.Shell.UI.Rest.ContentTypeStore.GetSuggestedContentTypes. I guess the best approach would be to avoid making this call in the first place... But how O_o

Sep 10, 2014 22:59

Yeah, maybe.

We now alot of control when it comes to altering the CMS itself through it's .js files, but by altering the code I might break something?

Sep 11, 2014 7:21


Please try this client approach:

var registry = epi.dependency.resolve("epi.storeregistry");
var contentTypesStore = registry.get("epi.cms.contenttype");
require(["dojo/_base/lang", "dojo/aspect"], function(lang, aspect) {
    aspect.around(contentTypesStore, "query", function(originalMethod) {
        return function(query, options) {
            if(lang.isObject(query) && query.query === "getsuggestedcontenttypes") {
                return [];
            return originalMethod(query, options);

Hope that help!

// Ha

Sep 12, 2014 9:48

Cool! But how can we inject this code into the EPI UI?

Sep 12, 2014 9:51

Hi Johan,

Simplest way, you can put the code directly into Chrome's console.

Some formal ways:



// Ha

Edited, Sep 12, 2014 9:59

I first tried injecting this into the console but I believe this code has to be executed on page load, right? So injecting it into the browser will prolly be too late?

Sep 15, 2014 11:59

Oh yes, inject in chrome's console just for test, if ok I think we need to create an add-on and then insert code into the add-on client initialize module like this:

// dojo

// epi

function (
// dojo

// epi
) {

    return declare([_Module], {

        initialize: function () {
            // summary:
            //		Initialize module


            // Patch episerver

        _removeSuggestedTypes: function () {
            // summary:
            //      Return an empty array to hide the suggested types when create new content.
            // tags:
            //      private

            var registry = epi.dependency.resolve("epi.storeregistry");
            var contentTypesStore = registry.get("epi.cms.contenttype");
            aspect.around(contentTypesStore, "query", function (originalMethod) {
                return function (query, options) {
                    if (lang.isObject(query) && query.query === "getsuggestedcontenttypes") {
                        return [];
                    return originalMethod(query, options);

// Ha Bui

Sep 15, 2014 12:10

The most correct approach would probably be to avoid making the request in the first place, I haven't investigated that way of doing it though.

What I do know is this - A GET request is made to ContentTypeStore (in EPiServer.Cms.Shell.UI.Rest).
In the class constructor it accepts a few arguments, one being a list of IContentTypeAdvisor, an interface that exposes a single method, GetSuggestions.

From the somewhat quick examination I did, the interface is only being referenced from ContentTypeStore, and implemented by DefaultContentTypeAdvisor.

This solution should probably do what you want..

Implement IContentTypeAdvisor

public class ZeroSuggestionsContentTypeAdvisor : IContentTypeAdvisor
	public IEnumerable<int> GetSuggestions(IContent parent, bool contentFolder, IEnumerable<string> requestedTypes)
		return Enumerable.Empty<int>();

Remove the previously added implementations, and add the new one
(Like I said, the ContentTypeStore accepts a list of IContentTypeAdvisor in its construtor, so simply registering the new one wont make a difference)

The following method can be found in the AlloyTech sample, DependencyResolverInitialization class

public void ConfigureContainer(ServiceConfigurationContext context)

	DependencyResolver.SetResolver(new StructureMapDependencyResolver(context.Container));

private static void ConfigureContainer(ConfigurationExpression container)


Hope that it helps!

Edit: Updated code regarding removing and adding implementations to match the AlloyTech sample.

Edited, Oct 12, 2015 13:14

Nice solution Kim. There should really be a setting somewhere instead. This function is so stupid, unless it's super smart implemented, which it isn't. E.g. it doesn't make sense two display two suggested content types when there's only two available in total.

Oct 12, 2015 15:46

@Kim and whomever made it work,

Hi,  I followed the latter advice and managed to get the ZeroSuggestionsContentTypeAdvisor firing in the code but I cannot find a suitable initaliser place that I can set the second method (ConfigureContainer).  How did you make it execute? 

Oct 22, 2015 15:05

Hi Yannis.

I updated my post to match the alloy tech sample, hope that clarifies things

Oct 22, 2015 16:19

Actually don't need a "ZeroSuggestionsContentTypeAdvisor". All you need to do is to remove all registered instances


Apr 17, 2016 14:55

Thanks Alf, that simple solution did the trick.

I agree with the suggestion that we should have more control over this though. I had a scenario where only 2 page types were allowed, but when creating the page it was actually showing 4 in the dialog because of the suggestions. 

Maybe it should only show the suggestions if there are > 10 page types available?

Edited, Feb 08, 2017 15:20
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.