News:

BB code in posts seems to be working again!
I haven't turned on every single tag, so please let me know if there are any that are used/needed but not activated.

Main Menu

Tooltip Linebreak

Started by ashley.clements, June 12, 2013, 06:16:12 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ashley.clements

I am trying to create a datacenter layout that will ultimately be in HTML form. My goal is to have the equipment information pop up on hover while viewing the HTML document. I have successfully got the tooltip popping up with the information I desire, just not in a format I desire. It is one continuous string with no line breaks. I have tried using the CHAR(10) and CHAR(13) with no success. Any one have any way to insert line breaks. My current formula is below.

Current:
user.visEquivTitle = "Enclosure ID: " & Prop.EnclosureID & Prop.Location

Tried using this with no success:
user.visEquivTitle = "Enclosure ID: " & Prop.EnclosureID & CHAR(10) & Prop.Location

Jumpy

Could you fool the Convert to HTML with a <br> already in the formula?
Or maybe do the changes in the HTML ducumet afterwards?

Hey Ken


Ashley:

   Got just what you need. 

   I also encountered various problems when publishing hover text to the web that required me to A) hack at Visio, and B) diddle the HTML when the hacking failed.  But I eventually got what I needed, a macro for publishing a drawing to the web that sets the proper Visio options and automatically edits the main HTML source and each individual HTML page to fix all the anomalies.  With a minor modification, you can use the macro to address your line break issue (and maybe a number of other issues you're not yet aware of).

   The way I'd suggest you approach it is a two-step process:

1)  In Visio, put in some unique string where you'd like to see a line break, such as "~";
2)  Edit the final HTML to replace the "~" with the HTML code for a line break, specifically "&#10;".

   You can manually edit each of the generated HTML files, but the easier way is to use the web publishing code I mention above and add one more edit.  Where it says, "Remove floating page name (only appears in IE)", add the following:


        Const Marker = "~"
        Do Until I = 0
            I = InStr(1, AString, Marker)
            If I > 0 Then
                AString = Left(AString, I - 1) & "&#10;" & Right(AString, Len(AString) - I - (Len(Marker) - 1))
                End If
            Loop


   When you run the entire macro, it'll automatically replace the "~" with the HTML new line code.  Of course you can use other marker characters besides the tilde; just be sure to change the Const in the code above.  FYI I tried using CHAR(10) as the marker, but it always grabbed the end of every line.  Not good.  I also tried CHAR(13) (i.e., carriage return), but Visio translates it into a space somewhere along the line such that it doesn't appear in the HTML.  I also tried using <br>, but it doesn't work inside quotes.  There may be other solutions, but at least this one works.

   Good luck! 

   - Ken






Ken V. Krawchuk
Author
No Dogs on Mars - A Starship Story
http://astarshipstory.com

Browser ID: smf (possibly_robot)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 4: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 185 (show)
Files included: 40 - 1775KB. (show)
Memory used: 1310KB.
Tokens: post-login.
Cache hits: 14: 0.00200s for 26,743 bytes (show)
Cache misses: 4: (show)
Queries used: 17.

[Show Queries]