Copied to clipboard

Flag this post as spam?

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


  • Hampus Bengtsson 10 posts 29 karma points
    Aug 01, 2012 @ 11:05
    Hampus Bengtsson
    0

    MetaWebLog / ContentChannel / Word integration with uBlogsy

    Does the ContentChannel method (posting from Word or similar) work well with uBlogsy for someone?

    Here is how it works out of the box for me (umbraco v4.7.2, uBlogsy v2.1):
    I have to set the Content Channel up to put posts in a Year folder. When I create a post from Word, the title becomes the name of the node (not uBlogsy title) and the content is correctly formatted in the content section.
       However, since the uBlogsy title and date isn't filled in (not to mention Author etc), the post cannot be published directly.
       Editing existing posts works, though only for editing the content (not title etc).

    This would be solved if we could write glue logic somewhere: for a specific user*, we would know what author and time to fill in.

    It would also be nice if our code would put the node in the correct datefolder, but it's not completely necessary. We could have a specific login for every year (author A, blog B, year 2012 / author A, blog B, year 2013 etc).

    So, for the actual question: has someone done this? Is there an existing, cleaner way of doing this? If not, where would I need to add/change code? Pointers appreciated, I'm a beginner to Umbraco.

     

    *There is one umbraco user per author and per blog (and per year, see following paragraph)

  • Hampus Bengtsson 10 posts 29 karma points
    Aug 01, 2012 @ 11:27
    Hampus Bengtsson
    0

    Ok, so I had obviously missed that the datefolders were disabled in uBlogsy.config.

    Neat.

    So the only important piece missing is the title... Is there some way to set it? Right now, the node name gets the name, but it should (also) be set in the uBlogsy title.

  • Hampus Bengtsson 10 posts 29 karma points
    Aug 01, 2012 @ 16:52
    Hampus Bengtsson
    0

    I ended up changing the sourcecode for uBlogsy. It works, but it ain't pretty. Also, I don't know how to fix tags and/or custom author.

    In uBlogsy.BusinessLogic.EventHandlers.UmbracoExtensions.Document_AfterSave(), append:

    // replace empty titles with node names
    var title = sender.getProperty("uBlogsyContentTitle");
    if (String.IsNullOrEmpty(title.Value.ToString()))
    {
        title.Value = sender.Text;
    }
  • Hampus Bengtsson 10 posts 29 karma points
    Aug 01, 2012 @ 17:23
    Hampus Bengtsson
    0

    Oops, seems I was a bit eager. This obviously doesn't enable _editing_ of the title from Word. Need to think through how I actually want this to behave, but unless uBlogsy is redesigned to properly implement this, I guess the code should be changed in DocumentService.EnsureCorrectPostNodeName: instead of just copying from title -> node, copy from node to title. Perhaps when useTitleAsNodeName != "1"?

  • Hampus Bengtsson 10 posts 29 karma points
    Aug 02, 2012 @ 09:52
    Hampus Bengtsson
    0

    Works as supposed now. I do have a feeling I will update the code some more, but if I remember I'll post the code here.

    DEAR PEOPLE FROM THE FUTURE: if I forget to post the code, pray that Dropbox still works: http://dl.dropbox.com/u/12960864/uBlogsy.BusinessLogic.dll
    Update uBlogsy - Landing doctype with this property under the Use Title As Node Name (General Settings):

    Name          OVERRIDE THE ABOVE
    Alias uBlogsyGeneralForceUseNodeNameAsTitle
    Type True/False
    Description When this is checked, the title will always be copied from the node name
    (effectively the above but in the other direction - this has precedence). Use when editing posts from MetaWebLog API (MS Word etc).

    Edit: [pre] should have spaces, not tabs. Also, this feels a bit like a monologue... 

Please Sign in or register to post replies

Write your reply to:

Draft