Best practices and will getting documents like this work?
As someone new to Umbraco I am just trying to get my head around the various conventions and ways of doing things within Umbraco.
I want a section of the sites front page to automatically update when a particular page type is saved for the first time (newly created). This is how I was thinking I would do it.
Create a UserControl on the front page to display the content and subscribe to the document saved event.
Then when the correct doc is created display it as it will always be the latest of this type and move the other previously shown documents down the list.
Is this the right way to do this or is there a better way?
First of all I don't recommend that you use Webforms unless you have a very specific reason to do so since Umbraco 7 is by default shipping with MVC as the engine. However it is possible to switch to using Webforms. But unless you have a good reason to do so just use MVC instead.
In regards to have the frotpage displaying the latest published documents you don't need to hook into a backoffice event etc.
As I understand what you're writing above you simply want your homepage view to be updated so the latest added page is shown first in a list of pages on the frontpage - Is that correct? If so then you need to setup a macro to display your desired nodes on your homepage and whenever you create a new document and publish it in Umbraco the homepage will automatically be updated with the new page and listing it first.
You can probably achieve this using the build in Razor snippet for generating navigation.
But I think that you can probably benefit from reading a bit more up on how to use Umbraco so I'll recommend that you start by checking out these links
Actually what I am wanting to display on the front page is:
The Article's Image
Article Title
Article summary
The articles will be displayed within 3 container divs and need to be updated in realtime. From what I have seen the navigation snippet will not do this for me.
Nope, you're right about that - But as I wrote that was how I understood what you asked about in the first post :)
When you say real time, is it when a new page has been saved and published in the backoffice? Then the concept is the same - You need a macro to fetch these properties for you and when you publish a new page then that will be listed first in your rendering.
Or do you need it to happen even before the "Save and publish" button has been hit?
Best practices and will getting documents like this work?
As someone new to Umbraco I am just trying to get my head around the various conventions and ways of doing things within Umbraco.
I want a section of the sites front page to automatically update when a particular page type is saved for the first time (newly created). This is how I was thinking I would do it.
Create a UserControl on the front page to display the content and subscribe to the document saved event.
Then when the correct doc is created display it as it will always be the latest of this type and move the other previously shown documents down the list.
Is this the right way to do this or is there a better way?
Hi Dave and welcome to our :)
First of all I don't recommend that you use Webforms unless you have a very specific reason to do so since Umbraco 7 is by default shipping with MVC as the engine. However it is possible to switch to using Webforms. But unless you have a good reason to do so just use MVC instead.
In regards to have the frotpage displaying the latest published documents you don't need to hook into a backoffice event etc.
As I understand what you're writing above you simply want your homepage view to be updated so the latest added page is shown first in a list of pages on the frontpage - Is that correct? If so then you need to setup a macro to display your desired nodes on your homepage and whenever you create a new document and publish it in Umbraco the homepage will automatically be updated with the new page and listing it first.
You can probably achieve this using the build in Razor snippet for generating navigation.
But I think that you can probably benefit from reading a bit more up on how to use Umbraco so I'll recommend that you start by checking out these links
http://24days.in/umbraco/2014/how-to-set-up-an-umbraco-site/ http://our.umbraco.org/documentation/Using-Umbraco/Creating-Basic-Site/
You can also buy a subscription to http://umbraco.tv where you can learn all the basics and more.
Hope this helps as a starting point - And please don't hesitate to ask further questions :)
Cheers, Jan
Thanks for that
Actually what I am wanting to display on the front page is:
Hi Dave
Nope, you're right about that - But as I wrote that was how I understood what you asked about in the first post :)
When you say real time, is it when a new page has been saved and published in the backoffice? Then the concept is the same - You need a macro to fetch these properties for you and when you publish a new page then that will be listed first in your rendering.
Or do you need it to happen even before the "Save and publish" button has been hit?
/Jan
is working on a reply...