Copied to clipboard

Flag this post as spam?

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


  • Micha Somers 134 posts 597 karma points
    Mar 02, 2017 @ 19:37
    Micha Somers
    0

    Alternatives for PreviewContent

    The PreviewContent class provides very interesting functionality but unfortunately uses some obsolete code.

    For example:

    public void PrepareDocument(User user, Document documentObject, bool includeSubs)
    

    where both User and Document are deprecated.

    Looking at the source code of PreviewContent (namespace umbraco.presentation.preview) , it starts with:

    //TODO : Migrate this to a new API!
    

    Are there already plans for implementing a new API for PreviewContent within the near future?

    Are there alternatives available that would work without having to use obsolete classes?

  • Gordon Saxby 1461 posts 1883 karma points
    Mar 27, 2017 @ 13:25
    Gordon Saxby
    0

    Is there an answer to this yet?

  • Micha Somers 134 posts 597 karma points
    Mar 27, 2017 @ 14:18
    Micha Somers
    100

    Hi Gordon,

    So far, I did not hear of any alternatives.

    Some publicly available examples/projects that are implementing similar functionality (such as 1-1 multilingual example) also use these obsolete classes.

    Although not a real future proof approach, I am also not aware of any serious issues that make it risky. So as long as there are no alternatives, I assume it's ok to use them as long as you keep in mind that the code will need to be changed in the (maybe near) future.

    Of course, feedback about potential risks and possible alternatives are still very welcome!

Please Sign in or register to post replies

Write your reply to:

Draft