Well actually I am allowing users to create events/programs by submitting a form.
When a user submits a form I just published it on website (no need for admin approval)
but I'll give admin an email that this(URL) event/program is published on website.
If it's a public site, that might be a bad idea. Because a republish will trigger cache/xml file updates. If your site gets flooded with requests, it will go down quickly.
One way to solve it, is keep items unpublished and let the admin publish the submission, the only link you need to add in your e-mail is a link to the backend page: http://yourdomainname.com/umbraco/#/content/content/edit/1262 (where the last number is the page id). You could even create an (public) API, allowing your users to publish the page with one button click in the e-mail (see UmbracoApiController). Be careful on your decision concerning security...
Another way of solving this is pushing the data to an external database table and handle all things yourself. It is more scalable if you have LOTS of submissions but will require much more development. For a smaller site the first solution is probably enough.
Custom umbraco dev
Hi all,
I hope you all doing well.
I am currently working to publish content via code.
I want to know can I get the published url of content which is published via code using umbraco content service's 'SaveAndPublish' method?
Thanks, Adnan
Why would you need the url immediately? That sounds like a code smell...
If you need it anyway, I guess the only way is to use the returned ID against some of the ContentCache helpers.
However using this approach would need you to be sure the content cache has been updated.
We don't know your exact use case, but my best guess is you probably need some of the ContentService Events.
Kind regards
Damiaan
Well actually I am allowing users to create events/programs by submitting a form.
When a user submits a form I just published it on website (no need for admin approval) but I'll give admin an email that this(URL) event/program is published on website.
And I'll try your solution and will inform you ASAP :)
If it's a public site, that might be a bad idea. Because a republish will trigger cache/xml file updates. If your site gets flooded with requests, it will go down quickly.
One way to solve it, is keep items unpublished and let the admin publish the submission, the only link you need to add in your e-mail is a link to the backend page: http://yourdomainname.com/umbraco/#/content/content/edit/1262 (where the last number is the page id). You could even create an (public) API, allowing your users to publish the page with one button click in the e-mail (see UmbracoApiController). Be careful on your decision concerning security...
Another way of solving this is pushing the data to an external database table and handle all things yourself. It is more scalable if you have LOTS of submissions but will require much more development. For a smaller site the first solution is probably enough.
Kind regards
Damiaan
I knew about first one...
But never used the api to publish with external link. I was looking for properties of published content.
By the way thank you soo much for your help @Damiaan :)
Regards,
Adnan Inayat
Glad to help you.
An UmbracoApiController has the same concept as WebApi in .Net. It is an easy way to expose data or to change data.
If you have other questions, don't hesitate to post a question on the forum.
Kind regards Damiaan
Here's shanon's public umbraco api to get you started: https://github.com/umbraco/UmbracoRestApi
is working on a reply...