Try our conversational search powered by Generative AI!

"Translating" content type restrictions for IList<ContentReference> property

Vote:
 

So I have this property (epi cms core 10.10.4, epi cms ui 10.11.0):

        [Display(
            Name = "Additional information links",
            Description = "Shown along with the additional downloads",
            Order = 320,
            GroupName = SystemTabNames.Content)]
        [CultureSpecific]
        [AllowedTypes(typeof(ArticlePageBase), typeof(SiteProductContentBase), typeof(TeaserBlock))]
        public virtual IList AdditionalInformationLinks { get; set; }

The TeaserBlock have [ContentType(DisplayName = "Teaser Block")] attribute declared.

Now, when this is displayed in the edit mode, I will see this:

Not very helpful, the base class declarations are somewhat understandable, as they have no content type porperty with a name attribute. Why it doesnt use the content type name attribute for the Teaser Block I dont know.

However, to localize content types, I can use this strucutre in lagfiles:

/contenttypes/teaserblock/name = "Teaser block"
/contenttypes/teaserblock/description = "Some description"

This will make the new content page show the localized text above, though the IList-property above will still just say "Block". What is the correct way of customizing the text in IList-property with content type restrictions?

Some suggest you can also "translate" base types in a similar fashion, though i get the same result (none) with those.

This page here: http://world.episerver.com/documentation/developer-guides/CMS/globalization/localizing-the-user-interface/ seem to suggest that you should be able to add these kind of thigs to base classes by "Creating an UIDescriptor", what exactly should that UIDescriptor do??

#185398
Nov 17, 2017 14:30
Vote:
 

First thing I react on is your IList<ContentReference> property, the recommended type to use for this kind of properties is ContentArea.

#185403
Nov 17, 2017 17:01
Vote:
 

Besides being completely unrelated to my question, it's a list of contentreferences, not a contentarea.

#185412
Nov 17, 2017 18:00
Vote:
 

Hi Erik!

"Why it doesnt use the content type name attribute for the Teaser Block I dont know." There is different implementations on how its shown in the contentreferencelist and when creating new content. In the current implementation its not possible to fall back to the displayName of the ContentType. 

But however to answer your "This will make the new content page show the localized text above, though the IList-property above will still just say "Block". What is the correct way of customizing the text in IList-property with content type restrictions?" I was able to change Block to "My teaser prop"

    <contenttypes>
      <teaserblock>
        <name>My Teaser prop</name>
      </teaserblock>
    </contenttypes>

I hope that helps 

Regards

#185446
Nov 20, 2017 14:12
Vote:
 

Hi Jim.

Your approach does not seem to work for us. It works in the "new content page" if you just try to create a block, it correctly says "My Teaser Prop", but not in the IList property editor. The IList property editor still just says "Block"

#185447
Edited, Nov 20, 2017 14:17
Vote:
 

Hi, i guess you already tried that but i had similar problems until i reset the iis and made a hard reset in chrome. Then it was updated from Block to "My Teaser Prop". If that doesnt work i will submit a bug and we need to investigate that. 

#185448
Nov 20, 2017 14:21
Vote:
 

Bingo!

Issreset and rebuild I tried, but ofcourse I should have cleared the browser cache also, thanks.

#185449
Edited, Nov 20, 2017 14:26
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.