Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Dominik Ernst 7 posts 97 karma points
    Oct 11, 2017 @ 12:27
    Dominik Ernst
    0

    How to generate IMaster

    Hi,

    I 'inherited' a website with Umbraco ;-), the developer somehow managed to generate a model called IMaster. How is that possible? I cann't find anything called IMaster?

    //------------------------------------------------------------------------------ // //------------------------------------------------------------------------------

    ...

    namespace Orca.Homepage.Core.PublishedContentModels { // Mixin content Type 1047 with alias "master" ///

    Master public partial interface IMaster : IPublishedContent {

    The other question is, how to generate something like that:

    //------------------------------------------------------------------------------ // //------------------------------------------------------------------------------

    ...

    namespace Orca.Homepage.Core.PublishedContentModels { // Mixin content Type 1216 with alias "contentPage" ///

    ContentPage public partial interface IContentPage : IPublishedContent { /// Inhalt Skybrud.Umbraco.GridData.GridDataModel Content { get; } }

    /// <summary>ContentPage</summary>
    [PublishedContentModel("contentPage")]
    public partial class ContentPage : PublishedContentModel, IContentPage
    {
    

    Thank you regards Dominik

  • Paul Wright (suedeapple) 264 posts 666 karma points
    Oct 11, 2017 @ 14:38
    Paul Wright (suedeapple)
    0

    You probably have a document, that is composed of a "master" composition/ documenttype

    Think of the "I", as "is composed of".

    Typically, you'd have "SEO" as a document type, which you can add to other document types. You could then do something like...

    If (Model is ISEO) {

    @Model.MetaTitle }

  • Dominik Ernst 7 posts 97 karma points
    Oct 11, 2017 @ 14:59
    Dominik Ernst
    0

    Hi Paul,

    there is a File "Master.generated.cs" with this line of code "public partial interface IMaster : IPublishedContent".

    When I was learning Umbraco, I generated also a Master-File, but the line was "public partial class Master : PublishedContent" (as I recall).

    Which Definition or Setting or Config changes the way Umbraco generates the File to IMaster?

    Regards Dominik

  • Paul Wright (suedeapple) 264 posts 666 karma points
    Oct 11, 2017 @ 16:02
    Paul Wright (suedeapple)
    0

    Thats part of the ModelsBuilder

    You should not be touching those autogenerated files :-) As they are auto generated by Umbraco.

  • Dominik Ernst 7 posts 97 karma points
    Oct 12, 2017 @ 06:37
    Dominik Ernst
    0

    I don't want to edit the file manually, I want to know how I can modify the settings, that ModelsBuilder generates the file with interfaces.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies