Copied to clipboard

Flag this post as spam?

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


  • Adriano Fabri 459 posts 1602 karma points
    Oct 01, 2009 @ 16:16
    Adriano Fabri
    2

    Possible New feature

    Hi,
    When I create a new "newsItem" under "News" Folder the autoFolders create correctly an "Year" and a "Month" Folder.
    But if I create a new "newsItem" under a "Month" Folder, the autoFolders create an "Year" and a "Month" Folder "UNDER THIS FOLDER".

    This is a problem!

    I would have the Year and the Month folders only under the "News" Root Folder.

    The solution could be solved with one of these methods:
    1 ) - Create an addictional property in the "FolderProvider" like this:
    <Property alias="RootFolderType">News</Property>
    2 ) - Create an addictional parameter in the DocTypes like this:
    <DocTypes>
         <DocType alias="RootFolderType" name="News" />
         <DocType alias="NewsItem" folderProvider="DateFolder" />
    </DocTypes>
    3 ) - Create a new parameter like this:
    <RootFolderTypes>
         <RootFolderType alias="News" />
    </RootFolderTypes>

    In all these cases, The RootFolderType can be used to:
    1 ) - Discover the Parent Node with this NodeTypeAlias;
    2 ) - Check if Year Folder exist and If No, create the new Year and the Month Folders and move the new newsItem;
    3 ) - If Yes, check if Month Folder exist and if yes move only the new newsItem into this folder, otherwise create only the new month folder and move the new newsItem;

    What do you think?

    Bye
    Adriano

  • Marco Lusini 176 posts 1370 karma points
    Oct 01, 2009 @ 16:41
    Marco Lusini
    0

    A general solution could be the use of an XPath expression to identify the RootFolder, instead of relying only on the type of the RootFolder.

     

  • Chris Koiak 700 posts 2626 karma points
    Oct 01, 2009 @ 18:03
    Chris Koiak
    1

    Hi,

    Thanks for the input and suggestions... keep em coming.

    Are we thinking something like

    <DocTypes>
         <DocType alias="NewsItem" folderProvider="NewsProvider" RootFolder="//node[@level = 2]" />
         <DocType alias="BlogItem" folderProvider="BlogProvider" RootFolder="//node[@docTypeAlais='Blogs']" />
    </DocTypes>

    ??

  • Adriano Fabri 459 posts 1602 karma points
    Oct 02, 2009 @ 10:57
    Adriano Fabri
    0

    Hi Chris,
    I think it is perfect the second line:

    <DocType alias="BlogItem" folderProvider="BlogProvider" RootFolder="//node[@docTypeAlais='Blogs']" />

    In this case we can find the first parent node that have thew docTypeAlias specified in the RootFolder parameter and start the normal check/insert/move actions.

    I think the RootFolder parameter must be optional.
    Without it the autoFolders must run like now.

     

    Do you think you will quickly publish the new feature?

    Bye
    Adriano

     

     

  • Marco Lusini 176 posts 1370 karma points
    Oct 02, 2009 @ 11:34
    Marco Lusini
    0

    @Chris: it would be fantastic!

     

  • Chris Koiak 700 posts 2626 karma points
    Oct 02, 2009 @ 14:13
    Chris Koiak
    0

    It's a plan!

    Not tonight (it is Friday night after all), but it'll be in place for Monday morning

    Chris

  • Adriano Fabri 459 posts 1602 karma points
    Oct 02, 2009 @ 15:05
    Adriano Fabri
    0

    @Chris: Perfect...I'm ready to test it.

    Thank you

  • Chris Koiak 700 posts 2626 karma points
    Oct 04, 2009 @ 10:11
    Chris Koiak
    0

    Hi,

    Version 1.3 has now been released with this new feature. You can now specifiy a 'rootFolder' against the FolderProvider.

    I know the attribute is in a different place that we discussed, it's part of a bigger discussion I've started at http://our.umbraco.org/projects/autofolders/general/4441-Settings--Configuration-Improvements

    Please let me know how you get on with 1.3.

    Chris

  • Chris Koiak 700 posts 2626 karma points
    Oct 04, 2009 @ 10:12
    Chris Koiak
    0

    Oh... and remember to vote up the package (and this thread) if you're happy with it.

  • Adriano Fabri 459 posts 1602 karma points
    Oct 05, 2009 @ 12:03
    Adriano Fabri
    0

    @Chris: Wonderful, I'm downloading and I'll try in the afternoon.

    Thank you

    Adriano

  • Adriano Fabri 459 posts 1602 karma points
    Oct 05, 2009 @ 16:09
    Adriano Fabri
    1

    Hi Chris,

    I've tested your package, but it wasn't working the way I needed. Since it was easier to change your code than trying to explain better what I needed, I modified it so that the rootFolder xPath property is meant to directly return the node under which to search for year, month (and day) folders.

    With this approach I can use rootFolder="//node[@id='1181']" to directly specify a given root node or use a more general expression like rootFolder="$currentParent/ancestor::node[@nodeTypeAlias='news'][1]" to specify the first ancestor of type 'news'.

    This allows me to have several 'news' folders in my content tree and, at the same time, helps my content editors to keep clean the news folders structure.

    If you want I can send you my code for evaluation.

     

     

  • Chris Koiak 700 posts 2626 karma points
    Oct 05, 2009 @ 22:08
    Chris Koiak
    0

    Yes please do.

    Send it too chriskoiak {_at} gmail.

    I'll report back to this thread once i've seen what you've done.

    Chris

     

  • Adriano Fabri 459 posts 1602 karma points
    Oct 08, 2009 @ 10:15
    Adriano Fabri
    0

    Hi Chris,
    I just sent the email with the updated project.

    You can test it and report me your opinion about it.

    By

    Adriano

  • Adriano Fabri 459 posts 1602 karma points
    Oct 13, 2009 @ 00:33
    Adriano Fabri
    0

    Chris,
    Did you receive my email?

    Can you tell me about my solution?

    Thanks
    Adriano

  • Chris Koiak 700 posts 2626 karma points
    Nov 04, 2009 @ 21:18
    Chris Koiak
    1

    OK... so it took almost a month... but the new version now supports this feature.

    I liked your solution, and I've included your changes in the latest release (v2.0), but renamed RootFolder to rootParents to support mutliple parent structures.

    Cheers,

    Chris

  • Adriano Fabri 459 posts 1602 karma points
    Nov 12, 2009 @ 11:00
    Adriano Fabri
    0

    Hi Chris,
    sorry for delay I saw now the new version.

    Now I think it is perfect.

    Thanks and have a good day.

    Adriano

Please Sign in or register to post replies

Write your reply to:

Draft