Copied to clipboard

Flag this post as spam?

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


  • Marcus Mordenfeld 5 posts 85 karma points
    Nov 30, 2020 @ 11:16
    Marcus Mordenfeld
    0

    Hi!

    We've planned to use an Umbraco site for documenting and providing our system users with a User manual. Now I've run into a small problem...

    My wish is to be able to send system version, from our system via URL to the Umbraco site, to be able to show the right version of the user manual.

    In our system we have a bunch of entities, for example Carrier, that are documented in Umbraco, on separate content pages (based on a custom Document Type), with the properties Title and Description.

    Over different system versions the Description property might vary, so I need to be able to modify the description property but would still like to contain the different versions within the same content page; i.e. I want to be able to visit the following two URL's having them show the same content page but with different content.

    Is this possible?

  • Steve Morgan 1346 posts 4453 karma points c-trib
    Nov 30, 2020 @ 14:26
    Steve Morgan
    0

    Hi,

    My first thought - and just a suggestion...

    Why not create a redirect / rewrite rule that spots any urls with a the url param ?vX.xx

    And then redirects to https://v1-12.yoursite.com

    That way you can just create entire new sub site (copy the last one!) each time you reversion. Links can be to a generic domain - default you can just keep 302ing to the latest subdomain?

    Steve

  • Marcus Mordenfeld 5 posts 85 karma points
    Dec 01, 2020 @ 13:42
    Marcus Mordenfeld
    0

    Hi Steve!

    Thank you for your response.

    The thing is that only small parts of the documentation will be updated between different system versions, so to make a complete copy seems a bit to much?

    My current situation is that I have a document type that defines nested content and have VersionFrom, VersionTo and Text fields. Whenever updating the documentation I can now just add a new instance of the nested document type and define from what version this will be available. (This setup makes it possible to add some text in a new part, without having to remove the older text, having them visible simultaneously.) I have then created a custom function that parses the v URL attribute and shows/hides different parts of the documentation accordingly.

    Current code...

        @{
            foreach (var p in Model.Description)
            {
                if (MyLogic.CheckVersion(Request.QueryString["v"], (p.VersionFrom as ContentModels.Version)?.VersionName, (p.VersionTo as ContentModels.Version)?.VersionName))
                {
                    @p.Text
                }
            }
        }
    

    This all works fine in my dev environment - static class in /App_Data/MyLogic.cs, with a CheckVersion() method, which I refer in my razor like above. p being of my nested content document type. But when I drop my MyLogic.cs file into the prod environment App_Data folder it never recognizes it and I receive the following error:

    CS0103: The name 'MyLogic' does not exist in the current context
    

    What am I missing?

  • Marcus Mordenfeld 5 posts 85 karma points
    Dec 01, 2020 @ 13:56
    Marcus Mordenfeld
    0

    I just realized my own mistake - placing the code in the App_Data folder instead of App_Code. Moving the code file to the correct location solved my problem.

Please Sign in or register to post replies

Write your reply to:

Draft