Copied to clipboard

Flag this post as spam?

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


  • Jeavon Leopold 3072 posts 13628 karma points MVP 10x admin c-trib
    Apr 03, 2014 @ 12:54
    Jeavon Leopold
    0

    uSync v2 - Umbraco v7.0.4 - creating .master pages

    My website is fully MVC but when using uSync to read, it is creating .master files inside my masterpages folder, the files contain the same code as my views...?

    Any ideas?

  • Kevin Jump 2310 posts 14695 karma points MVP 7x c-trib
    Apr 03, 2014 @ 13:01
    Kevin Jump
    0

    Hi

    usync calls the Template.Import function (which is the 'old' api) - I will look and see if there are ways in which that differentiates between views and master but I think it's in the core.

    the next version of usync v2.2 (ready for when v7.1 is released :) ) uses the new API packagingService.ImportTemplate() - so hopefully that will be fine, but there where issues with that in 7.0.4 so I won't be able to port it back.

  • Jeavon Leopold 3072 posts 13628 karma points MVP 10x admin c-trib
    Apr 03, 2014 @ 13:03
    Jeavon Leopold
    0

    ah awesome, v7.1 is but moments away!

  • Kevin Jump 2310 posts 14695 karma points MVP 7x c-trib
    Apr 03, 2014 @ 13:06
    Kevin Jump
    0

    actually looking at Template.Import in v7.0.4 that uses packageingService.ImportTemplate() so i will have to work out if that is causing the problem :(

    usync does other stuff but it doesn't physically create the template files. I don't know if there is some trigger in the background creating the master pages..

  • Kevin Jump 2310 posts 14695 karma points MVP 7x c-trib
    Apr 03, 2014 @ 13:12
    Kevin Jump
    0

    looking at https://github.com/umbraco/Umbraco-CMS/blob/7.1.0/src/Umbraco.Core/Services/PackagingService.cs

    umbraco checks if the page is a master page by looking for the following

    return Regex.IsMatch(code, @"<%@\s*Master", RegexOptions.IgnoreCase) ||
                    code.InvariantContains("<umbraco:Item") || code.InvariantContains("<asp:") || code.InvariantContains("<umbraco:Macro");
    

    do your views contain any of that ?

    if they do then the IsMasterPageSyntax() function in the importer returns true, and the files are saved to the MasterPagePath which is suspect is the masterpages folder.

  • Jeavon Leopold 3072 posts 13628 karma points MVP 10x admin c-trib
    Apr 03, 2014 @ 13:34
    Jeavon Leopold
    0

    Ah ha, yes, this is the issue:

    Layout = "SiteMasterView.cshtml";
    
  • Jeavon Leopold 3072 posts 13628 karma points MVP 10x admin c-trib
    Apr 03, 2014 @ 13:37
    Jeavon Leopold
    0

    Actually, on second look that regex is smarter than just looking for "Master"

Please Sign in or register to post replies

Write your reply to:

Draft