Links or URL in model attributes

Release:

 • 4.6 •  5.0 •  5.1 •  5.2 •  5.3 •  5.4 •   •  6.0 •  6.1 •  6.2 •  6.3 •  6.4 •  6.5 •  6.6 •  7.0

A description, or other text attribute of a variable or other object, can contain a hyperlink to any web page, or even to an Analytica expression to run when it is clicked. This is useful for linking to detailed explanations, data, references, or to related downloadable Analytica models. In browse mode, hyperlinks are underlined in blue. When you click a hyperlink, your computer shows the indicated web page in your default web browser.

To add or edit a hyperlink (in edit mode), type the text that you want the user to see, select it, and press ctrl+k to open a dialog where you can edit the text and the link:

Edit Hyperlink dialog.png

Select either http:// or https://, enter the target URL and press OK. The text displays as a hyperlink. When you switch to browse mode, the HTML code displays as a hyperlink.

Or you can enter the link with standard HTML syntax of the form <a href="http://www.analytica.com/">Click here</a>}}type the text you want the user to see.

In edit mode:

Chapter9 21.png

In browse mode:

Chapter9 22.png

When you click on the link in browse mode, it opens the web page. When you click on the link in edit mode, you are given options to go to the page, change the link or remove the link.

Hyperlink options.png

The Change option re-opens the Edit Hyperlink dialog shown above.

You can also view the HTML-like "markup" text in edit mode by right-clicking within the attribute text and selecting Toggle show markup.

Chapter9 21.png

Eval links

You can create a link that evaluates an Analytica expression when you click on it. To do so, select "eval:" in the dropdown.

Hyperlink eval.png

Eval opens up numerous creative options, including:

  • Calling ShowPdfFile to open a PDF file.
  • Calling ShowWindow to show a particular object view (such as a result table, graph, and edit table, or to an object on a diagram, etc.).
  • Display a MsgBox with some computed information (as in the example shown).

HTML markup in Text Attributes

You can use appearance-related HTML tags in the Description of a text node and other objects (and other text-based attributes including user-defined attributes.) You use standard HTML syntax, like <html>...</html>. ACP renders these when the text node displays in a diagram You can include CSS styles inside styles attributes. Desktop Analytica renders only a subset of these HTML tags.

As of Analytica 7.0, these HTML tags that have an effect in desktop Analytica (but in text nodes only when they display on a diagram) when the attribute is surrounded by <html>...</html> (they can be nested):

  • Hyperlink: <a href="...">label</a>
  • Bold: <b>text</b>: bold
  • Italic: <i>text</i> or <em>text</em> (emphasis)
  • Underline: <u>text</u>
  • Strike-out: <s>text</s> or <strike>text</strike> or <del>text</del>
  • In-line block: <span> ... </span>
  • Non-inline block: <div>text</div>:
  • Paragraph block: <p>text</p>:
  • Line break: <br/>
  • Ordered list: <ol> ... </ol> containing items tagged as <li>item</li>
  • Unordered list: <ul> ... </ul> containing items tagged as <li>item</li> .

If you use a non-supported HTML tag, it treats it as in-line blocks (same as <span> ... </span>)

You can specify style="..." attribute on any tag, such as

<div style="color:red">some red text</div>

but only a few CSS styles have any affect in desktop Analytica. Recognized tags (as of Analytica 6.6) are:

  • color: Text color
  • background-color: But with some rendering limitations

History

The Edit Hyperlink dialog (a GUI for editing the hyperlinks) was added in Analytica 5.3. Prior to that, markup displayed in edit mode, hyperlinks in edit mode.

The ability to evaluate an arbitrary expression when the hyperlink is clicked was added in Analytica 6.0.

The bold and italics tags were added in Analytica 6.5.

The extended tags using <html> were added in Analytica 6.6.

See Also


Comments


You are not allowed to post comments.