I would like to know how developers usually solve issue in backend architecture when creating frontpage/landing page AJAX carousels, teasers, campaigns and other areas that links to a subpages.
Let's say you are about build bbcnews.com in Umbraco and you need to push some news in the frontpage. News in frontpage of BBC News are not automatically picked up as the latest but they are top stories somehow chosen. How would you pick up those top stories?
1. Static fields in Frontpage node? - Do you make it "static" field on document type where you then manually write teaser texts?
2. Push to frontpage in actual news document type? - Do you make some checkbox/weight -fields on news document type? For example saying this is breaking news/show in breaking news, this news weight is 1-5?
3. Custom functionality - Would you create some custom news picker functionality that builds frontpage from content items?
traditionally I tend to use option 2 when dealing with featureing content. This, especially with regards to news items, is usually coupled with an expiration date so that automatic removal from the page will happen if it doesn't get pushed off by the "top n" logic. If you are trying to run this as an Ajax call or consume it via a simple XML get you can also consider generating the XML (or other format) doc upon publishing of your news doc type by tieing into ante Document_AfterPublish event.
You could also make some fields on the document type with the content picker datatype. That would require the content editor to manually select the frontpage news. The advantage is that you don't need to have duplicate data in your tree. But it's not ideal if you need it to happen automatically of course.
Just thought that I would mention this option, since it can be very nice in some scenarios.
In a corporate intranet I developed, there is a news section for each department. When a newsitem is created the user (web editor) decide if it has potential to make it to the frontpage (is it general news or just for the department?) by checking a true/false property “showOnFrontpage”.
Then the xslt for-each looks something like this:
<xsl:for-each select="umbraco.library:GetXmlAll()/descendant-or-self::node [@nodeTypeAlias=’newsItem’ and string(data[@alias='showOnFrontpage']) = '1' ]">
I use Multiple Picker (http://our.umbraco.org/projects/tree-multi-picker) to pick what to show on homepage, when you go to showOnFrontpage route, you have problems with sorting.
You can also use RCC (http://our.umbraco.org/projects/repeatable-custom-content) and config it to allow pick news item and and add some text to item.
Specific nodetypes and a flag "show on homepage" usually does it for me, we also have a lot of "navigation from source" blocks that we use on homepages...
Option two, and then build flexible macro's which you can pass different parameters too.
A common macro I'd use, would allow you to select the parent ID, how many child items (sorted by date), wrap tags, and parent/child classes, and say also if a summary is displayed.
This can then be used multiple times on the frontpage, and also in sub sections where you need summaries of content.
-
Generally our apporach is to build an XSLT macro and then refactor it to make it flexible so it can be reused across the site and also as starting point code for other projects.
-
When the front-page might have a changing mashup of different page content you could also have a frontpage doctype, which had content pickers which the selected ID's could be used to call the relevant Macros.
I think Multiple Picker field approach would be the most suitable. I would assume that pushing content to the frontpage using "showinfrontpage" field in actual news node would result hard to control frontpage as there would not be much control what in the end is shown and in which order. Though, I guess ideal would be some kind of combination but that would then probably result complexity for the editors.
We use a "show on homepage" field (of sorts) on Freelance Supermarket - see the "popular stories" on the right-sidebar, (mis-leading title, as they aren't popular, but editorial picked).
The way we got around the sorting problem was instead of using a checkbox, we used a numeric data-type ... so if the value was greater than zero, it displays in the right-sidebar. The sort order is ascending, so 1 is top and 99+ is bottom, for conflicting numbers/priorities, we fall-back on date/time sorting (descending).
We did consider using a multiple-content picker - which would work, but that meant republishing the homepage - whereas my client preferred control on a per-article/node basis.
-marking items as news, with a checkbox and a newsexpire date and a priority field. when the page loads i select the XX newst items that are marked as news and are not yet expired. Some pages use the priority property of the pages as well.
Best Practices for dynamic frontpage
I would like to know how developers usually solve issue in backend architecture when creating frontpage/landing page AJAX carousels, teasers, campaigns and other areas that links to a subpages.
Let's say you are about build bbcnews.com in Umbraco and you need to push some news in the frontpage. News in frontpage of BBC News are not automatically picked up as the latest but they are top stories somehow chosen.
How would you pick up those top stories?
1. Static fields in Frontpage node?
- Do you make it "static" field on document type where you then manually write teaser texts?
2. Push to frontpage in actual news document type?
- Do you make some checkbox/weight -fields on news document type? For example saying this is breaking news/show in breaking news, this news weight is 1-5?
3. Custom functionality
- Would you create some custom news picker functionality that builds frontpage from content items?
4. Other ideas?
Hi,
traditionally I tend to use option 2 when dealing with featureing content. This, especially with regards to news items, is usually coupled with an expiration date so that automatic removal from the page will happen if it doesn't get pushed off by the "top n" logic. If you are trying to run this as an Ajax call or consume it via a simple XML get you can also consider generating the XML (or other format) doc upon publishing of your news doc type by tieing into ante Document_AfterPublish event.
Hope this is useful info.
-- Nik
Hi Jukka
You could also make some fields on the document type with the content picker datatype. That would require the content editor to manually select the frontpage news. The advantage is that you don't need to have duplicate data in your tree. But it's not ideal if you need it to happen automatically of course.
Just thought that I would mention this option, since it can be very nice in some scenarios.
/Jan
Hi Jukka
In a corporate intranet I developed, there is a news section for each department. When a newsitem is created the user (web editor) decide if it has potential to make it to the frontpage (is it general news or just for the department?) by checking a true/false property “showOnFrontpage”.
Then the xslt for-each looks something like this:
Hope you can use it!
/Finn
I use Multiple Picker (http://our.umbraco.org/projects/tree-multi-picker) to pick what to show on homepage, when you go to showOnFrontpage route, you have problems with sorting.
You can also use RCC (http://our.umbraco.org/projects/repeatable-custom-content) and config it to allow pick news item and and add some text to item.
Petr
Specific nodetypes and a flag "show on homepage" usually does it for me, we also have a lot of "navigation from source" blocks that we use on homepages...
Sorting absolutely no problem…
Here is an example with a property called newsDate that has a dateTimePicker as datatype
And you can sort on everything else as normal with xslt!
Option two, and then build flexible macro's which you can pass different parameters too.
A common macro I'd use, would allow you to select the parent ID, how many child items (sorted by date), wrap tags, and parent/child classes, and say also if a summary is displayed.
This can then be used multiple times on the frontpage, and also in sub sections where you need summaries of content.
-
Generally our apporach is to build an XSLT macro and then refactor it to make it flexible so it can be reused across the site and also as starting point code for other projects.
-
When the front-page might have a changing mashup of different page content you could also have a frontpage doctype, which had content pickers which the selected ID's could be used to call the relevant Macros.
/Lau
I think Multiple Picker field approach would be the most suitable. I would assume that pushing content to the frontpage using "showinfrontpage" field in actual news node would result hard to control frontpage as there would not be much control what in the end is shown and in which order. Though, I guess ideal would be some kind of combination but that would then probably result complexity for the editors.
We use a "show on homepage" field (of sorts) on Freelance Supermarket - see the "popular stories" on the right-sidebar, (mis-leading title, as they aren't popular, but editorial picked).
The way we got around the sorting problem was instead of using a checkbox, we used a numeric data-type ... so if the value was greater than zero, it displays in the right-sidebar. The sort order is ascending, so 1 is top and 99+ is bottom, for conflicting numbers/priorities, we fall-back on date/time sorting (descending).
We did consider using a multiple-content picker - which would work, but that meant republishing the homepage - whereas my client preferred control on a per-article/node basis.
I did it with a combination of :
-marking items as news, with a checkbox and a newsexpire date and a priority field. when the page loads i select the XX newst items that are marked as news and are not yet expired. Some pages use the priority property of the pages as well.
- (semi) randomly selected teasers
is working on a reply...