This is an idea I've been thinking about while developing an Umbraco site and adding nodes for simple items like "featured clients". I want to add pieces of content that will only appear on one page and should not have their own pages. Intead of creating nodes in a tree and marking them with the umbracoNaviHide (essentially hidding them) I thought it would be nice to just add it directly to the page content area.
Here's an example
Requirement: Add a featured items list on the home page. Each
item will have a caption, a thumbnail and a hyperlink (internal or
external).
Current solution: Add a custom Document Type that has three properties, Caption, Thumbnail and hyperlink using the data types Textstring, Media Picker and Related Links respectively. This document Type will have no associated design template since the featured items will not be pages. Create a Content node for each featured item, check off umbracoNaviHide so it doesn't show up on navigation and search and anythign else that brings up pages.
Better Solution: Create a custom data type using the "repeatable custom content" Render Control. Add three properties to it, Caption, Thumbnail and hyperlink. Then in my home page document type add to it the custom data type we just created. Go to the home page content node and add the featured item content, to add another you hit an "add" button to repeat the three properties.
This solution would enable us to eliminate creating content nodes just to have that neccessary repeatable feature and treat the content like it was meant to, as a piece of related content.
I think it's a very interesting idea and would love to see an example. It's really like creating a embedded child page editor in a single datatype.
You could implement it by Creating a custom data type that take a textstring alias of a DocType. The DocType describes the fields, data types that should be displayed. The data created by the datatype would be stored as xml, similarly to MultiPicker implementations. This data would be used to construct the number of repeated sections.
I think this is the kind of work that, once built for a client/project, makes a great contribution to the community. Can't wait to see it.
How about an datagrid (as a datatype) to display/add/update/delete new items. A datagrid can accept xml as input and you only need to take care of saving it as xml, just as Chris mentions as this would make it perfect candidate to iterate using xslt.
Am thinking out loud, but this would be a great datatype, maybe even with options to set the number of columns and the type of data.
I like the idea. I've been thinking about something simmular.
I came to the conclusion that an repository with subrepositories for specific content (that way you can control the kind of documents created) as extra node next to the website works just as nice.
Home
Repository
Testimonials
Banners
Promotionblock
etc..
Doeing so those items will not appear in the xml used for generating your menu and stuff (Better performance).
Using the Axendo Ultimate Picker XPath you can select the node you want to read from. The benefit from this is that this content can be used on different places on your website. And you always have the posibility to use a template in the future.
The benefit from this is that this content can be used on different places on your website. And you always have the posibility to use a template in the future.
As an addition: I know you don't need it elsewhere and don't want to use a template, but from experience i can tell that clients rearly stick to the initial design.
In case they want to use a description for a "featured client" or show some "featured clients" on a specific product page. You can't just tell them that it's not posible to reuse the content.
There is one exception where it could be useful. If the content is just plain text and will absolutely never be used elsewhere For example if you want to restrict the contenteditor to add subtitles using the tinymce. Than you could allow them to create paragraps with a subtitle instead of an tinymce.
Ron, wouldn't it be possible to reuse the data in other nodes by creating some an xsl extension method, which can take in the node id which houses the data type, the "repeater id" (which you can set when you create the data type) and an XPath to the content?
for example the repeater interface XML for the given example can be something like this
You're thinking in the right direction, I would do it in a simular way. However what i ment whas that it won't be posible to use a Ultimatepicker or any other datatype to select them elsewhere. All those datatypes assume that you use the default umbraco structure. For that reason I choose to use an repository.
repeatable content data type
This is an idea I've been thinking about while developing an Umbraco site and adding nodes for simple items like "featured clients". I want to add pieces of content that will only appear on one page and should not have their own pages. Intead of creating nodes in a tree and marking them with the umbracoNaviHide (essentially hidding them) I thought it would be nice to just add it directly to the page content area.
Here's an example
Requirement: Add a featured items list on the home page. Each item will have a caption, a thumbnail and a hyperlink (internal or external).
Current solution: Add a custom Document Type that has three properties, Caption, Thumbnail and hyperlink using the data types Textstring, Media Picker and Related Links respectively. This document Type will have no associated design template since the featured items will not be pages. Create a Content node for each featured item, check off umbracoNaviHide so it doesn't show up on navigation and search and anythign else that brings up pages.
Better Solution: Create a custom data type using the "repeatable custom content" Render Control. Add three properties to it, Caption, Thumbnail and hyperlink. Then in my home page document type add to it the custom data type we just created. Go to the home page content node and add the featured item content, to add another you hit an "add" button to repeat the three properties.
This solution would enable us to eliminate creating content nodes just to have that neccessary repeatable feature and treat the content like it was meant to, as a piece of related content.
-Frank
Wow I posted that without explaining why!
Just want to know if you guys think this is a good idea and to have some umbracoholics shoot away some ideas as to "how" this can be developed.
I think it's a very interesting idea and would love to see an example. It's really like creating a embedded child page editor in a single datatype.
You could implement it by Creating a custom data type that take a textstring alias of a DocType. The DocType describes the fields, data types that should be displayed. The data created by the datatype would be stored as xml, similarly to MultiPicker implementations. This data would be used to construct the number of repeated sections.
I think this is the kind of work that, once built for a client/project, makes a great contribution to the community. Can't wait to see it.
Chris
How about an datagrid (as a datatype) to display/add/update/delete new items. A datagrid can accept xml as input and you only need to take care of saving it as xml, just as Chris mentions as this would make it perfect candidate to iterate using xslt.
Am thinking out loud, but this would be a great datatype, maybe even with options to set the number of columns and the type of data.
Cheers,
/Dirk
I like the idea. I've been thinking about something simmular.
I came to the conclusion that an repository with subrepositories for specific content (that way you can control the kind of documents created) as extra node next to the website works just as nice.
Doeing so those items will not appear in the xml used for generating your menu and stuff (Better performance).
Using the Axendo Ultimate Picker XPath you can select the node you want to read from.
The benefit from this is that this content can be used on different places on your website. And you always have the posibility to use a template in the future.
Ron
As an addition: I know you don't need it elsewhere and don't want to use a template, but from experience i can tell that clients rearly stick to the initial design.
In case they want to use a description for a "featured client" or show some "featured clients" on a specific product page.
You can't just tell them that it's not posible to reuse the content.
There is one exception where it could be useful. If the content is just plain text and will absolutely never be used elsewhere
For example if you want to restrict the contenteditor to add subtitles using the tinymce.
Than you could allow them to create paragraps with a subtitle instead of an tinymce.
Let me know what you think.
Ron
I have created a repeater datatype, let me know if you want sample code
I would like to take a look at it.
ron axendo nl
thanks,
Ron
Hi Ron,
I have sent to you by email
let me know if any issues.
thanks
Thanks I will look at it asap.
Ron
Ron, wouldn't it be possible to reuse the data in other nodes by creating some an xsl extension method, which can take in the node id which houses the data type, the "repeater id" (which you can set when you create the data type) and an XPath to the content?
for example the repeater interface XML for the given example can be something like this
Then our extension method may be able to retrive the data from this control with something like
Just thinking out loud, not sure if this makes any sense
Masood, can I take a look at your sample code
Thanks,
Frank
@Frank
You're thinking in the right direction, I would do it in a simular way. However what i ment whas that it won't be posible to use a Ultimatepicker or any other datatype to select them elsewhere. All those datatypes assume that you use the default umbraco structure. For that reason I choose to use an repository.
Ron
Frank, what is your email address so i can email to you?
Masood, you can email me at frankishere[at]gmail.com, thanks!
Frank have a look at this package http://our.umbraco.org/projects/repeatable-custom-content
I will send to you source code asap.
Regards
Masood
Hi Masood,
I need to implement a similar thing, is it possible to email the source code? Thanks in advance
amardeephs[at]gmail[.]com
Amardeep, there are many requests for source code, i would be releasing it soon.
cheers
is working on a reply...