Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Frank Alvarez 9 posts 30 karma points
    Aug 29, 2009 @ 07:37
    Frank Alvarez
    0

    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

  • Frank Alvarez 9 posts 30 karma points
    Aug 29, 2009 @ 08:00
    Frank Alvarez
    0

    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.

  • Chris Koiak 700 posts 2626 karma points
    Aug 29, 2009 @ 09:09
    Chris Koiak
    0

    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

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Aug 29, 2009 @ 17:13
    Dirk De Grave
    1

    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

  • Ron Brouwer 273 posts 768 karma points
    Aug 30, 2009 @ 12:46
    Ron Brouwer
    0

    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.

    Ron

  • Ron Brouwer 273 posts 768 karma points
    Aug 30, 2009 @ 14:28
    Ron Brouwer
    0
    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.

    Let me know what you think.

    Ron

  • Masood Afzal 176 posts 522 karma points
    Aug 30, 2009 @ 14:51
    Masood Afzal
    0

    I have created a repeater datatype, let me know if you want sample code

     

  • Ron Brouwer 273 posts 768 karma points
    Aug 30, 2009 @ 14:54
    Ron Brouwer
    0

    I would like to take a look at it.

    ron axendo nl

    thanks,

    Ron

  • Masood Afzal 176 posts 522 karma points
    Aug 30, 2009 @ 15:32
    Masood Afzal
    0

    Hi Ron,

    I have sent to you by email

    let me know if any issues.

    thanks

     

  • Ron Brouwer 273 posts 768 karma points
    Aug 30, 2009 @ 17:53
    Ron Brouwer
    0

    Thanks I will look at it asap.

    Ron

  • Frank Alvarez 9 posts 30 karma points
    Sep 01, 2009 @ 07:48
    Frank Alvarez
    0

    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

    <repeater id="featuredClients" parentNodeID="1130">
    <control umbracoType="Textstring"
    order="0"
    label="Caption"
    validation="true"
    validationText="Please enter a client name.">
    <data alias="umbracoText">ACME Corporation</data>
    </control>
    <control umbracoType="MediaPicker"
    order="1"
    label="Thumbnail"
    validation="true"
    validationText="Please select a thumbnail.">
    <data alias="umbracoFile">/media/6189/acme.jpg</data>
    <data alias="umbracoWidth">113</data>
    <data alias="umbracoHeight">100</data>
    <data alias="umbracoBytes">2919</data>
    <data alias="umbracoExtension">jpg</data>
    </control>
    <control umbracoType="RelatedLinks"
    order="2"
    label="Hyperlink"
    validation="false"
    validationText="">
    <data alias="...">...</data>
    </control>
    </repeater>

     

    Then our extension method may be able to retrive the data from this control with something like

    <xsl:for-each select="repeater.ext:GetXPathNodeIterator($nodeID,$repeaterID,'//control')">
        ....       
    </xsl:for-each>

    Just thinking out loud, not sure if this makes any sense

  • Frank Alvarez 9 posts 30 karma points
    Sep 01, 2009 @ 07:49
    Frank Alvarez
    0

    Masood, can I take a look at your sample code

    Thanks,

    Frank

     

  • Ron Brouwer 273 posts 768 karma points
    Sep 01, 2009 @ 13:22
    Ron Brouwer
    0

    @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

  • Masood Afzal 176 posts 522 karma points
    Sep 03, 2009 @ 23:27
    Masood Afzal
    0

    Frank, what is your email address so i can email to you?

     

  • Frank Alvarez 9 posts 30 karma points
    Sep 06, 2009 @ 18:38
    Frank Alvarez
    0

    Masood, you can email me at  frankishere[at]gmail.com, thanks!

  • Masood Afzal 176 posts 522 karma points
    Sep 10, 2009 @ 23:26
    Masood Afzal
    0

    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

     

     

  • Amardeep 13 posts 23 karma points
    Sep 18, 2009 @ 00:18
    Amardeep
    0

    Hi Masood,

    I need to implement a similar thing, is it possible to email the source code? Thanks in advance

    amardeephs[at]gmail[.]com

  • Masood Afzal 176 posts 522 karma points
    Sep 21, 2009 @ 23:18
    Masood Afzal
    0

    Amardeep, there are many requests for source code, i would be releasing it soon.

    cheers

     

     

Please Sign in or register to post replies

Write your reply to:

Draft