Copied to clipboard

Flag this post as spam?

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


  • Matt 353 posts 825 karma points
    Jul 13, 2020 @ 09:22
    Matt
    0

    Manually adding media/content through uSync

    Hi,

    I'm just after some advice on best possible solution.

    So I'm using uSync complete, in our organisation we have an FOI system which we will then publish all of our FOI's on the website.

    We are building our new website using Umbraco + Usync, what I've done so far is got our FOI system to throw out a new .config file and place it in usync, with a unique generated content key using Guid.NewGuide()

    This works fine for content, however what I'm trying to understand is how I can get the media pulled across. Some FOI's have documentes attached to them, How could I add an attached document through rich text editor while adding media manually?

    As the media I add manually will need to link into the rich text editor content.

    Hope that makes sense.

    Thanks

  • Kevin Jump 2310 posts 14695 karma points MVP 7x c-trib
    Jul 13, 2020 @ 10:12
    Kevin Jump
    1

    Hi Matt.

    yes adding media this way would be a little more tricky but its do able.

    in uSync, you will need to create ".config" files for the media items (similar to how you are doing it for content), but you will also need to place the attachments into the media folder.

    Umbraco has a its own special way of creating the media folders (https://github.com/umbraco/Umbraco-CMS/blob/v8/contrib/src/Umbraco.Core/IO/MediaPathSchemes/UniqueMediaPathScheme.cs) but you don't have to use this, you just have to ensure that the folder you put your media in will not clash with something else (so you could just use the unique GUID value you might use in the media's .config file.

    to then insert the media into an RTE control inside the content you will need to know the media guid you used to create the media file. and put this in the html for the rte.

    if you look at a media link in the RTE it has the format :

    <a href="/{localLink:umb://media/662af6ca411a4c93a6c722c4845698e7}" title="Umbraco Campari Meeting Room">sit amet</a>
    

    so you need to replicate this, it might be worth having a template config.config file somewhere for your code to load and then do a replace of the guid with the one you are using to create the media file.

  • Matt 353 posts 825 karma points
    Jul 13, 2020 @ 10:40
    Matt
    0

    Thanks Kevin, I guess my biggest issue is trying to get the guide of the media and placing it in my config file for the content. As our FOI system will automatically create the content config file.

    As I will only get the media guide when its important into umbraco?

    I guess the most simple way would be to leave the media outside of Umbraco, just create a folder outside of the media and look get all of the media dumped into that. The only annoying thing would be that we would need to manage those documents from server side rather then through Umbraco.

Please Sign in or register to post replies

Write your reply to:

Draft