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.
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.
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?
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..
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))
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 :)
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.
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?
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)
Your developers really should be using the same database instance that way any database related changes will appear for all your developers.
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
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
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
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
is working on a reply...