Copied to clipboard

Flag this post as spam?

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


  • Ismail Mayat 4511 posts 10058 karma points MVP 2x admin c-trib
    Jun 16, 2017 @ 08:03
    Ismail Mayat
    0

    Nexus with custom property

    Support,

    I have 7.5.10 site. I have one property which links the content item to a corresponding media folder, the content node is of type model and the media folder linked is portfolio of images for the model. Its not a picker, basically when you create a model content item using events we auto create corresponding media folder and then put id in the content item so client can jump to the folder easily,enter image description here

    The property data is just media folder id. One issue we have at the moment is when client deletes models from content tree we have orphaned media folders. So was thinking of using nexu to generate the relations table data. Then looking at running a query to determine all those media folders that do not have a related content item.

    Is this doable with nexu?

    Regards

    Ismail

  • Dave Woestenborghs 3272 posts 11111 karma points MVP 5x admin c-trib
    Jun 16, 2017 @ 08:41
    Dave Woestenborghs
    0

    Hi Ismail,

    So you store the id of the media folder with the content item. So in theory this could be handled by a Nexu parser.

    Here you find the docs for creating your own parser https://github.com/dawoe/umbraco-nexu/blob/develop/docs/extending.md

    But I can see issue with this not working because you set this in the save event and nexu also parses the content in the save event. And I think there is no way to order save event handlers in Umbraco. So it's possilbe that the nexu one fires before yours and the relation is not created.

    I already a public method on the API to get incoming links, but not one for outgoing links and that's your case. This is on the roadmap for a next version. But i'm happy to accept a PR for it.

    https://github.com/dawoe/umbraco-nexu/blob/develop/Source/Our.Umbraco.Nexu.Core/WebApi/NexuApiController.cs

    Then you could call this API in the delete event to to check for a incoming relation and delete the folder.

    Dave

  • Dave Woestenborghs 3272 posts 11111 karma points MVP 5x admin c-trib
    Jun 16, 2017 @ 08:42
    Dave Woestenborghs
    0

    Hi Ismail,

    Just ever having pushed the "Post reply" button I actually think you don't need Nexu for this.

    When you delete the item (remove from recycle bin) you can hook into that event. Get the linked media folder from the item and delete that as well.

    Dave

  • Ismail Mayat 4511 posts 10058 karma points MVP 2x admin c-trib
    Jun 16, 2017 @ 09:42
    Ismail Mayat
    0

    Dave,

    We do not want to auto delete too dangerous we want client todo it. I did not know about save event issue. So this may not work for me.

    Also I installed the package on another site and am having a play. One thing I dont think this will work for me because it looks like the relations are not bi directional. So if i link folder to content item, then try and delete content item it will not tell me this item is linking to a folder however deleting the folder should tell me content item is using it. Which i am assuming is the outgoing link issue?

    Regards

    Ismail

Please Sign in or register to post replies

Write your reply to:

Draft