Copied to clipboard

Flag this post as spam?

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


  • Janet Kirklen 102 posts 212 karma points
    Sep 13, 2016 @ 23:14
    Janet Kirklen
    0

    Images in WordPress Content

    CMSImport is doing a nice job of importing posts into both Articulate and uSkinned Theme Blog docTypes. However, my WordPress posts have an image embedded in the Content area. Is it possible to get that image mapped to an image property on the target docType? WordPress has a separate export for Media. Is that useful for solving this issue?

  • Richard Soeteman 3977 posts 12479 karma points MVP
    Sep 14, 2016 @ 06:04
    Richard Soeteman
    0

    Hi Janet,

    Don't think it's built in in the Dataprovider for wordpress. but how are the images embedded and I assume you have the images on disk so you can import those?

    Best,

    Richard

  • Janet Kirklen 102 posts 212 karma points
    Sep 14, 2016 @ 14:45
    Janet Kirklen
    0

    Thanks for the quick reply Richard.

    Yes, the images in WordPress are currently in the /wp-content/Uploads folder and then there are sub folders for year/month. That's how WordPress organizes it's media library. Those could all be moved as-is or collapsed into to single a folder in the Umbraco root or uploaded into the Media section. But I'm not sure what the next step would be. Not sure how CMS Import would map those into the blog Post Image property.

  • Richard Soeteman 3977 posts 12479 karma points MVP
    Sep 15, 2016 @ 06:11
    Richard Soeteman
    0

    Hi Janet,

    I need to create "something" in the import provider that converts the tag to a normal media link or img tag then cmsimport does it automatically. Can you share how wordpress stores the image?

    Thanks,

    Richard

  • Janet Kirklen 102 posts 212 karma points
    Sep 15, 2016 @ 14:10
    Janet Kirklen
    0

    Here is an example of content taken from the HTML editor in WordPress. The code below is copied from the XML file exported from WordPress for this post. You can see the embedded image tag and the src attribute in below.

    <content:encoded><![CDATA[ 
    <strong><em>by Tina Bowers, MBA, CDM<a href="http://blog.methodisthealthsystem.org/2016/08/14/intentional-inclusion-and-diversity-embracing-our-differences-and-welcoming-all/tbowers_retouch1/" rel="attachment wp-att-3740"><img class="alignright size-medium wp-image-3740" src="http://blog.methodisthealthsystem.org/wp-content/uploads/2016/08/TBowers_retouch1-300x226.jpg" alt="TBowers_retouch1" width="300" height="226" /></a>
    </em></strong><strong><em>Director, Learning and Development
    </em></strong><strong><em>Methodist Health System</em></strong>...
    ]]</content:encoded>
    

    This would be the content that is mapped to a property with a Rich Text Editor in Umbraco. CMS Import does import the content into the RTE on my blog docType in Umbraco. The only issue is that the path is still the WordPress path.

    Meta data about media is stored in the database, but the image itself is stored in the file system in the /wp-content/uploads/ folder. No ID is assigned to the media item. The file name is whatever it was at upload time. I suspect WordPress just stores the path to the image in the database. WordPress creates the /year/month/ folders at upload time. Every instance I’ve seen of WordPress has this same folder structure for media items. /wp-content/uploads/year/month/filename

    With WordPress I guess there are a few scenarios:

    1. WordPress Image is in separate media picker field - This should be a simple mapping from xml field to Umbraco media picker
    2. WordPress Image is embedded in encoded content field - You could keep image in encoded content but update URL to the Umbraco media URL (good for when there are multiple embedded images) OR you could map the first image found in the encoded content to an Umbraco media picker property on the docType

    It would be easy to just copy the whole /wp-content/uploads/ folder and all its subfolders to the root of my Umbraco site. Perhaps if that folder structure was maintained then it would preserve the pathing so that CMSImport could easily find the related images.

    Let me know if that helps or if you need additional info. Thanks for taking a look at this.

  • Richard Soeteman 3977 posts 12479 karma points MVP
    Sep 16, 2016 @ 05:54
    Richard Soeteman
    0

    HI Janet,

    Thanks for the snippet. I assume you are using the PRO version of CMSImport? If so click on the plus sign and you see extra options for converting media. This imports the related media in the same format as above and converts the WP link to a media item link.

    Hope this helps,

    Richard

Please Sign in or register to post replies

Write your reply to:

Draft