Hi everybody,
Let's say I want to run a one-off code script to generate a number of nodes on my site, what is the best way of doing this? A few years it was possible with some back office packages that let you run Razor scripts dynamically but these don;t work on the latest versions, ie 7, and I couldn't find any recent packages that might help along these lines.
One approach would be to just run a command line program locally but I don't know how or if it is possible to connect this way to my remote Umbraco instance.
Thanks for any help or suggestions.
The really hacky quick way is to create a new doc type with a template and hack your code into the template (or more correctly call a helper method from it).
I'd check a flag is false that you set at the end of the script to true before the code executes (perhaps check a doc type property?) to ensure your special script only executes once.
Interested to hear if anyone has any better solutions?
Running back office code scripts
Hi everybody, Let's say I want to run a one-off code script to generate a number of nodes on my site, what is the best way of doing this? A few years it was possible with some back office packages that let you run Razor scripts dynamically but these don;t work on the latest versions, ie 7, and I couldn't find any recent packages that might help along these lines. One approach would be to just run a command line program locally but I don't know how or if it is possible to connect this way to my remote Umbraco instance. Thanks for any help or suggestions.
The really hacky quick way is to create a new doc type with a template and hack your code into the template (or more correctly call a helper method from it).
I'd check a flag is false that you set at the end of the script to true before the code executes (perhaps check a doc type property?) to ensure your special script only executes once.
Interested to hear if anyone has any better solutions?
Thanks. Yeah I followed that idea in the end. It works fine but surprising there is not enough need for this to merit a better solution!
is working on a reply...