Copied to clipboard

Flag this post as spam?

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


  • anthony hall 214 posts 507 karma points
    Dec 28, 2009 @ 18:16
    anthony hall
    0

    Autofolders, adding content programically

    i'm importing some content and i need to have control over the date folders. I have following code. I've looked at the source for autofolder and the date seems to be derived from CreateDateTIme. Here is the code that i'm using. My issue is that the date seems to always default to today date. 

    Document currentPage = Document.MakeNew("mypage", dt, author, parentNodeId);
            currentPage.CreateDateTime = DateTime.Parse("15-May-2009");
            currentPage.Save();
  • Chad Rosenthal 272 posts 474 karma points
    Dec 28, 2009 @ 22:25
    Chad Rosenthal
    0

    Basically, this is occurring because the CreateDateTime is the time that the new item is created, which would be today's date. You can't override this. What you need to do is to tell autofolders to use the value in a field (on Publish) rather than the CreateDateTime.

    Version 2.0 allows you to do what you are asking. 

     

  • anthony hall 214 posts 507 karma points
    Dec 29, 2009 @ 16:34
    anthony hall
    0

    Great thanks Chad.

        <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>
Please Sign in or register to post replies

Write your reply to:

Draft