reverse engineering alloy question - properties don't match up at all?

Vote:
 

The About us page has 4 regions editable in the CMS editor:

  1. Name
  2. Page Description
  3. Main Body
  4. Large Conent area.

Looking at the pages properites, it is of type "Standard Page"

Looking in the source:  Models/Pages/StandardPage.cs has only 2 properties, and only one matches:

    public class StandardPage : SitePageData
    {
        [Display(
            GroupName = SystemTabNames.Content,
            Order = 310)]
        [CultureSpecific]
        public virtual XhtmlString MainBody { get; set; }

        [Display(
            GroupName = SystemTabNames.Content,
            Order = 320)]
        public virtual ContentArea MainContentArea { get; set; }
    }

And "Large Content Area" is missing, as is page name and description.

The page inherits from SitePageData, which has meta stuff, Teaser text (which I dont see anywhere in the UI), but also no "large conent area" etc.

Any suggestions?

#210434
Nov 22, 2019 22:29
Vote:
 

Hi John,

To see, which property name in CMS belongs to which property in code. Go to CMS > Admin > ContentType (Tab). Here you can see all your page types, block types, media types and system type.

Select your page type (say Standard Page)

Now, next thing comes into mind is that on Standard Page your property don't have Name="Large content area" defined. So, in answer, that is done in language file, where you can add language specific text that will be visible for editors in that specific language. (Read more about Localizing the user interface)

You can find this file at /Resources/LanguageFiles/PropertyNames.xml, see the tag with your property name MainContentArea

<maincontentarea>
    <caption>Large content area</caption>
</maincontentarea>

If you see the hierarchy of root elements

<contenttypes>
    <icontentdata>
        <properties>

Now open the EPiServer.Core.IContentData, we have a property named Property which returns collection of all properties defind on your type.

For more information, this IContentData is base for Page Types, Block type and any media types. Other properties like Name is defined on EPiServer.Core.PageData and remaing one you can see in LanguageFile.

Now, answer to TeaserText not visibile on UI. You need to render that. For that, go to /Views/StandardPage/Index.cshtml and add the following code line

@Html.PropertyFor(x=>x.CurrentPage.TeaserText)

Let me know if need more information.

Thanks

#210439
Nov 23, 2019 4:07
Vote:
 

Nice answer @Praful!

#210461
Nov 25, 2019 9:51
Praful Jangid - Nov 25, 2019 11:28
Thanks Henrik :)
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.