Copied to clipboard

Flag this post as spam?

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


  • Ole Andreas Myhre Olsen 4 posts 74 karma points
    Jan 06, 2022 @ 22:39
    Ole Andreas Myhre Olsen
    0

    Template files are on the server but not visible in the Settings Tree under Templates

    Hi

    I have a site deployed to several servers, and all except one displays all the templates as expected, but one site does not pick up the template files in the /View folder and show them in the Template Tree under Settings.

    Any idea why the don't show?

    Partials and MacroPartials are visible as expected.

    Any input is appreciated :)

  • Søren Kottal 702 posts 4497 karma points MVP 5x c-trib
    Jan 08, 2022 @ 10:39
    Søren Kottal
    1

    Hi Ole

    This is because templates is actually database entities, with a reference to the files. You can just create a new template with an alias matching the view-file to make it show up. It will not overwrite the file.

    So if you have a /Views/MyTemplate.cshtml file, create a Template in Umbraco called My Template (MyTemplate - will be the alias), and you get the required database entity for the template.

  • Danny Vandergriff 2 posts 22 karma points
    Sep 27, 2023 @ 20:34
    Danny Vandergriff
    0

    This is still an issue in Umbraco v12.2. The resolution that Søren proposes above actually does work. However, that's not going to translate well when you have dozens of developers each trying to maintain their local instance of Umbraco. Each one of them has to notified that a new template "exists," pull down the file from the repo, and then manually create an alias for the new template locally? This is a terrible user experience.

    Can we perhaps have a tool added to allow a user to synchronize templates in the file system with the database?

  • Søren Kottal 702 posts 4497 karma points MVP 5x c-trib
    Sep 28, 2023 @ 13:14
    Søren Kottal
    0

    Hi Danny

    How are you handling other database entities, like document types, data types, documents etc.?

    As Marc says, uSync is what you need (or Deploy / Umbraco Cloud)

  • Huw Reddick 1737 posts 6098 karma points MVP c-trib
    Sep 29, 2023 @ 14:34
    Huw Reddick
    0

    Your developers really should be using the same database instance that way any database related changes will appear for all your developers.

  • Søren Kottal 702 posts 4497 karma points MVP 5x c-trib
    Sep 29, 2023 @ 17:48
    Søren Kottal
    0

    You should never share a database between different environments running Umbraco. This is essentially load balancing the backoffice which is not supported. You can read more about why, here https://docs.umbraco.com/umbraco-cms/fundamentals/setup/server-setup/load-balancing#faqs

  • Huw Reddick 1737 posts 6098 karma points MVP c-trib
    Sep 29, 2023 @ 17:59
    Huw Reddick
    0

    We've never had any issues doing this, perhaps because we have a small dev team and are generally working on different parts of umbraco

  • Marc Goodson 2141 posts 14344 karma points MVP 8x c-trib
    Sep 27, 2023 @ 21:48
    Marc Goodson
    0

    Hi Danny

    Have you had a look at uSync?

    https://jumoo.co.uk/uSync/

    When we have teams of developers working on the same site, we have uSync installed, when devs create a new doc type + template in their local dB, uSync writes out on disk corresponding XML files, when the dev completes the feature they commit the template and usync files into source control... And then when other devs checkout the branch, uSync can automatically import the changes, no need to manually create templates... Similarly when you deploy to a staging or production environment you have your updated code+ set of uSync files which will update the environments Umbraco install to be in sync with the development work..

    Regards

    Marc

  • Danny Vandergriff 2 posts 22 karma points
    Sep 29, 2023 @ 14:24
    Danny Vandergriff
    0

    We are using uSync - or at least we are trying to. We are using it to import Doc Types / Media Types, Templates, Partial Views, Users, etc. All of the files are brought over when running the uSync 'Import' command from the Back Office UI. But that's it - there is no corresponding entry for these files being added to the database. That seems to be the issue. We are using the defaults of the uSync configuration, but will take a closer look. For the record, we are using Umbraco 12.0.0 and uSync 12.0.2 (Snapshots (v12.0.2), Exporter (v12.0.2), PeopleEdition (v12.0.2), Publisher (v12.0.2), Complete (v12.0.2))

    Thanks,

    Danny

Please Sign in or register to post replies

Write your reply to:

Draft