You are viewing limited content. For full access, please sign in.

Question

Question

Customize Weblink

asked on February 18, 2021

Our public portal provides access to documents for the residents of our county.  There are Commissioner Meeting Minutes and Planning Board Agendas, for instance.  I know I can add text to the Welcome Page of Weblink but can you add text to the browse/search page.  For example, if they access the County Commissioner's documents, can that specific page have unique text ( a disclaimer for those specific documents)? 

0 0

Replies

replied on February 18, 2021 Show version history

Hi Shannon,

You can add a script inside the <body> tag of the relevant ASPX page that listens for changes in the URL, checks whether the URL contains a specific folder ID, and modifies an element on the page in response.  For example, you can set up an invisible box with the disclaimer text in it, and have the script hide/show the box based on the URL.  Here's an example (you can modify the styling as needed):

    <div id="DisclaimerBox" style="position: absolute; left: 35%; top: 50px; width: 30%; z-index: 1000; background-color: white; color: red; padding: 10px; border: 2px solid red;">Disclaimer: Your disclaimer text here</div>

    <script type="text/javascript">
        var checkDisclaimer = function () {
            var regex = new RegExp(/(&|\?)id=55555(&|$)/);
            if (location.href.match(regex)) {
                $('#DisclaimerBox').show();
            }
            else {
                $('#DisclaimerBox').hide();
            }
        };

        (function(history){
            const pushState = history.pushState;
            history.pushState = function(state) {
                if (typeof history.onpushstate == "function") {
                    history.onpushstate({state: state});
                }
                var ps = pushState.apply(history, arguments);
                checkDisclaimer();
                return ps;
            }
        })(window.history);
    </script>

In this example, the message is displayed for folder 55555.  You would modify "id=55555" to contain the folder ID you want to display the message for.

With this example styling, it would look like this:

1 0
You are not allowed to follow up in this post.

Sign in to reply to this post.