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 4 posts 73 karma points
    Oct 11, 2017 @ 12:27
    Dominik Ernst
    0

    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?

    //------------------------------------------------------------------------------ // // This code was generated by a tool. // // Umbraco.ModelsBuilder v3.0.7.99 // // Changes to this file will be lost if the code is regenerated. // //------------------------------------------------------------------------------

    ...

    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:

    //------------------------------------------------------------------------------ // // This code was generated by a tool. // // Umbraco.ModelsBuilder v3.0.7.99 // // Changes to this file will be lost if the code is regenerated. // //------------------------------------------------------------------------------

    ...

    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) 166 posts 460 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 4 posts 73 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) 166 posts 460 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 4 posts 73 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.

Please Sign in or register to post replies

Write your reply to:

Draft