Copied to clipboard

Flag this post as spam?

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


  • David Ferguson 15 posts 35 karma points
    Jun 10, 2010 @ 20:50
    David Ferguson
    0

    Help implementing AutoFolders

    I have installed AutoFolders but I am struggling to get it to work.

    I am trying to organise my blog items within the tree structure so the format is; year >> month >> blogitems

    I have 2 doc types, blogArea and blogItem and a blogDate doctype which I can use for the contaning folders if required. I have amended the autofolders.config file but not sure if I have configured it correctly.

    When I try and create a new blogItem under the Blog folder (which is a blogArea page) the blogItem page is created but the date folders are not created as expected

    The autofolder.config file;

    <?xml version="1.0" encoding="utf-8" ?>
    <settings>
      <folderProviders>
        <folderProvider alias="DateFolderProvider_Simple"
                assembly="/bin/AutoFolders"
                type="AutoFolders.Providers.DateFolderProvider">
          <property alias="MonthFormat">MM</property>
          <property alias="YearFormat">yyyy</property>
        </folderProvider>
    
        <folderProvider alias="DateFolderProvider_Full"
                assembly="/bin/AutoFolders"
                type="AutoFolders.Providers.DateFolderProvider">
          <property alias="DayFormat">dd</property>
          <property alias="MonthFormat">MM</property>
          <property alias="YearFormat">yyyy</property>
          <property alias="DateField">MyReleaseDate</property>
        </folderProvider>
    
        <folderProvider alias="AlphaFolder"
               assembly="/bin/AutoFolders"
               type="AutoFolders.Providers.AlphaFolderProvider" >
          <property alias="UseUppercase">true</property>
        </folderProvider>
      </folderProviders>
    
      <autoFolders>
        <autoFolder docType="BlogItem"
                 folderProviderAlias="DateFolderProvider_Simple"
                 folderDocType="BlogArea"
                 />
    
        <autoFolder docType="Standard_FullExample"
                 folderProviderAlias="DateFolderProvider_Full"
                 rootFolders="//node[@level=2]"
                 folderDocType="BlogDate"
                 truncatedFolderUrl="folder-1/folder-2/blogitems"
                 />
    
      </autoFolders>
    
    </settings>

     

    This is driving me insane, please help!!

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Jun 10, 2010 @ 21:01
    Douglas Robar
    0

    Hi, David,

    To save yourself some effort, you could install the blog4umbraco package from the package repository or the projects area. It has most of the work done for you already, including date folders.

    But if you want to build your own then you're on the right track with a blog area and blog items. Under the blog items you'll probably use doc2form to create blog comment items, but let's resolve the date folder issue first before getting into blog comments. :)

    What you have appears to be correct. What, if anything happens when you create a new blog item? You might also look in the umbracoLog table in your database to see if there are any warnings or errors that might give you a hint want is going wrong.

    cheers,
    doug.

  • Matt Brailsford 4125 posts 22222 karma points MVP 9x c-trib
    Jun 10, 2010 @ 21:04
    Matt Brailsford
    0

    Hi Dave,

    You should be able to simply it down while your working it out, to something like:

    <?xml version="1.0" encoding="utf-8" ?>
    <settings>
      <folderProviders>
        <folderProvider alias="Blog"           
      assembly="/bin/AutoFolders"
      type="AutoFolders.Providers.DateFolderProvider">
      <property alias="MonthFormat">MM</property>
      <property alias="YearFormat">yyyy</property>
     </folderProvider>
      </folderProviders>
      <autoFolders>
        <autoFolder docType="BlogItem"            
      folderProviderAlias="Blog"            
      folderDocType="BlogArea"            
      />
      </autoFolders>
    </settings>

    Things to check if it's not working would be the casing of your alias' as these will be case sensitive.

    Matt

  • David Ferguson 15 posts 35 karma points
    Jun 10, 2010 @ 21:36
    David Ferguson
    0

    Thanks for the replies guys,

    Ok, doug, When I create a new blogItem it creates the page but just under the blogArea page, not nested under any date folders. I also checked the database and the only error that seems to be in there is;

    Error adding stylesheet to tinymce (id: 1049). System.ArgumentException: No node exists with id '1049'

     

    Matt: I have replaced the config file with the one you provided. I checked the casing which didn't actually match, so I changed them, with no results. 

    What is the 'Blog' alias referring to in the config code you provided in your last post. I don't have any pages or doc types with that alias. Should I change that to a doctype alias? If so, which one?

    Cheers again for your help on this

    Dave

  • Matt Brailsford 4125 posts 22222 karma points MVP 9x c-trib
    Jun 10, 2010 @ 21:43
    Matt Brailsford
    0

    Hi Dave,

    The folder provider alias related to the folder provider defined at the top of the xml doc so that should be fine.

    Looking over it again, i think folderDocType should be set to blogDate. If this doesn't work, I'd check the child doc type settings to make sure blogDate can be created under blogArea, and thet blogItem can be created under both blogArea and blogDate.

    Matt

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Jun 10, 2010 @ 21:50
    Douglas Robar
    0

    By the way, be sure to restart the site's application pool (you can just touch the web.config file) after changing the AutoFolder config files to be sure they get picked up.

    cheers,
    doug.

  • David Ferguson 15 posts 35 karma points
    Jun 10, 2010 @ 21:55
    David Ferguson
    0

    Yo Matt,

    Ok, I changed the folderDocType to blogDate and checked all the child doc type which appear to be all setup ok. This is becoming very confusing. If it's not too much to ask is there any chance you could try and recreate this setup on your system. Its fairly basic in that the root structure is;

    Home

    Blog -- doc type alias blogArea

    << then supposed to be year >> -- doc type blogDate

    << then month >> -- doc type blogDate

    Blog Item -- doc type blogItem

     

    See if you can get it to work at your end.

    Cheers pal

  • Matt Brailsford 4125 posts 22222 karma points MVP 9x c-trib
    Jun 11, 2010 @ 09:29
    Matt Brailsford
    0

    Hi Dave,

    I've just installed and it all worked fine for me.

    My setup is as follows

    Doc Types
    Name: Blog Area
    Alias: blogArea
    Allowed child docTypes: blogDate, blogItem

    Name: Blog Item
    Alias: blogItem
    Allowed child docTypes: none

    Name: Blog Date
    Alias: blogDate
    Allowed child docTypes: blogDate, blogItem

    Config

    <?xml version="1.0" encoding="utf-8" ?>
    <settings>
      <folderProviders>
        <folderProvider alias="Blog"
             assembly="/bin/AutoFolders"
       type="AutoFolders.Providers.DateFolderProvider">
       <property alias="MonthFormat">MM</property>
       <property alias="YearFormat">yyyy</property>
         </folderProvider>
      </folderProviders>
      <autoFolders>
        <autoFolder docType="blogItem"
               folderProviderAlias="Blog"
               folderDocType="blogDate"
               />
      </autoFolders>
    </settings>

    This setup should automaticaly use the createDate (or updateDate, not sure which) as the date to order the blog items.

    With this setup, I successfully have my blogItems created in year, month folders, ie

    Blog
    - 2010
    - - 06
    - - - Test Article

    Matt

  • David Ferguson 15 posts 35 karma points
    Jun 12, 2010 @ 12:59
    David Ferguson
    0

    Hi Matt

    Thanks for doing this for me. Your setup seems to be exactly what I have and it still doesn't create the date folders for me.

    Would it make a difference if the blogItem and blogArea are under a sub doctype and the blogDate isn't?

    That to me is the only difference between our two setups.

    Cheers again

    Dave

  • Matt Brailsford 4125 posts 22222 karma points MVP 9x c-trib
    Jun 14, 2010 @ 09:55
    Matt Brailsford
    0

    Hi Dave,

    If you mean you have used a Master doc type, then no, it shouldn't make a difference.

    Is your site somewhere accessible that I might be able to take a look at?

    Cheers

    Matt

  • Adam Hill 7 posts 27 karma points
    Nov 19, 2012 @ 10:59
    Adam Hill
    0

    Hi Guys,

    I've been struggling to get this working too without much success. To try and get it working I have recreated the setup Matt suggested on a fresh install of Umbraco (v4.6.1 which the package documentation says this is tested with). I've created the DocType's with the same names (and these are the only DocType's I've created) and copied the configuration file from this page.

    When I create a blog item underneath the blog folder it just sits underneath this node, no date folder is created. I was wondering if anyone had any advice for debugging this? Or are there any steps I've missed (e.g. Do I need to create any properties for the DocType or should the date be taken from standard DocType properties)?

    Cheers,

    Adam

     

Please Sign in or register to post replies

Write your reply to:

Draft