Try our conversational search powered by Generative AI!

Customizing "Restricting content reference properties"

I have the following code:
public virtual IList Tags { get; set; }

Does anyone know how to customize the part where it says “You can add these content types [Type]” in the editor when using a list of content references?
Where does [Type] come from, and how can it be changed?
Mine just says “Page” and it is quite misleading..

I want it to write out something lige "Tag Page" in allowed types in the editor
Is there an attribute or something on the IList, which can be customized to specify the type of page allowed?
Edited, Aug 11, 2016 10:51

Not sure cause I haven't tested it before, but I bet it gets the DisplayName attribute for the page(s) added in the AllowedTypes.

Aug 11, 2016 11:05

It does not work. I just tried to change the DisplayName from "Tag Page" to "Tag-Page" (in case it was the space that did it), but that didn't have any effect.

Maybe it is simply because my TagPage has PageData as base class...?

        DisplayName = "Tag Page", 
        GUID = "e36d32f2-34e2-45e7-ae3d-cfe853282f01", 
        Description = "Tag landing page")]
    public class TagPage : PageData
Edited, Aug 11, 2016 11:16

Hm, ok. Might fetch it from the localized xml files then? Is there any reference for the tag page in /Resources/LanguageFiles/ContentTypeNames.xml in your solution?

Aug 11, 2016 12:20

I don't seem to have that folder. Where in the solution should it be located?

Aug 11, 2016 15:03

The default location is ~/Resources/LanguageFiles, but the location is configurable in web.config under the localization node

Aug 11, 2016 15:26

This text is fetch from a language file that is an embedded resource in EPiServer.Cms.Shell.UI.dll.  You can change this by adding the following to one of your language files:

      <language name="English" id="en">
                <allowedtypes>You can add these types, dude!</allowedtypes>

This will change the text for all content reference list editors though.

Aug 12, 2016 8:13

Then it does not really solve the problem if one would want more than one reference list?

Aug 12, 2016 9:29

I misunderstood your question.
To change the [Type] values, add localizaed values to your language file. For Your "Tag page", it would be something like:

        <name>Tag page</name>
        <description>Something something something</description>

Using "DisplayName" does not work for this purpose

Aug 12, 2016 9:43
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.