Reputation: 4618
I want to make a small change to how the text on panels is displayed in an Umbraco grid.
I've found I can make the change to nestedcontent.controllers.js
in just a few lines, and this works.
However, if/when we upgrade Umbraco this change may be lost.
What are the best practices? Alternative ways of changing Umbraco behavior?
Upvotes: 0
Views: 203
Reputation: 3447
Let try to answer this briefly... if you are talking about the back-end that is.
What are the best practices? Alternative ways of changing Umbraco behavior?
Best way by far is to write plug-ins. Plug-ins can be in the first place property editors. But it could also be used to interfere with the complete backend. But you can go much further.
Almost everything can be extended, custom dashboards, custom sections, custom trees, ... you name it and it probably is possible to extend in the backend.
Everything is powered by angular. Nothing stops you from doing very funky stuff. Packages like Nexu intercept every angular http call and then run their own logic.
A lot of the umbraco logic (like the complete request pipeline) can be replaced by your own implementation. Nothing stops you from run your own UrlProvider.
And what about the events (doing things after somethings happens). E.g. after a save.
I think a best practice is to leave umbraco as is. Do not change it if you don't really need to. Use all extension points where you can.
And use the default Umbraco stuff. Don't reinvent the wheel. Use things which already exists in Umbraco. It will give you the possiblity to build better websites for content editors, and faster for the users.
Upvotes: 1
Reputation: 246
I say make the change, and whilst you're at it put in a Pull Request for the project author to change it permanently.
Here's why I wouldn't worry about the Umbraco upgrades overwriting it:
Upgrades in Umbraco aren't automatic, unless you're using the cloud version. So this means you make a choice to upgrade. When doing any sort of development it is always a good idea to have your code checked into a source control of some sort. I like SVN or GitHub personally.
When upgrading an Umbraco site, I always make sure I have checked in all of my files to source control. If you do this, when it comes to doing the upgrade, you can see if the file has changed, and on the line where you made your change, you can revert that line back to what you had it at.
I hope this makes sense.
Upvotes: 0
Reputation: 3425
Looks like it's a package specific file (Nested Content)? You could download the package file, unzip it and make the change before re-zipping it and keep the zip file in a safe place? ;-) Or, if it's a change that everyone could benefit from, make a pull request on Github?
Upvotes: 0