Is there a way to change the label of the "View plain text" option on Weblink to a custom one?
Question
Question
Changing the "View plain text" label on weblink
Replies
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?
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.
@████████ 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>
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.
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>