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

Question

Question

Changing the "View plain text" label on weblink

asked on January 23, 2019 Show version history

Is there a way to change the label of the "View plain text" option on Weblink to a custom one?

0 0

Replies

replied on January 23, 2019

There's no built-in way, but you can add javascript to the page that changes the text.  What label would make more sense for you?

0 0
replied on January 23, 2019

Hi Brian, thank you for the immediate response.

We would like to change it to "CLICK HERE TO VIEW TEXT"

I believe weblink is ADA compliant but we are trying to perform some customization tailored to the customer's needs.

0 0
replied on January 23, 2019

@████████ It looks like localization strings are injected server side. If localization wasn't needed, would it be simpler to add JavaScript, or to just hardcode the string?

I found this in DocViewM.aspx

<a class="PageToolbarLink TextButton" id="ViewTextLink" href="#" ><%= m_strings.GetString("STR_SHOW_TEXT_BUTTON_TEXT") %> </a>

 

0 0
replied on January 23, 2019

You might be right, I didn't check the code to see if that label is in an editable location (vs an embedded control).  If it does come from an aspx page, it would be a simple fix.  BTW: the "M" suffix is for mobile.

0 0
replied on January 24, 2019 Show version history

Ok, I followed the rabbit hole all the way down. The strings come from somewhere that we as users can't manipulate. Brian's suggestion to use JavaScript is the easiest solution.

In DocView.aspx, just before the closing body tag, do the following:

    <!-- custom script -->
    <script type="text/javascript">
        $(document).ready(function() {
            $("#imageToolbar span[lflocalize='STR_SHOW_TEXT_BUTTON_TEXT']").text("CLICK HERE TO VIEW TEXT");
        });
    </script>
    <!-- end custom script -->
</body> <!-- don't add these last two tags, I just included them to show you where to put the script tag above.
</html>

 

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

Sign in to reply to this post.