faq-display-hyperlinks.adoc 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. [#faq-dashboard-display-hyperlinks]
  2. = Hyperlinks in dashboards
  3. This page explains how to add clickable links on dashboards using xref:dashboards/4-displays.adoc[display components] (`type: display`).
  4. == How do I add a clickable link on a dashboard?
  5. Use a `type: display` component and put normal HTML in its `title` field. OliveTin renders `title` as HTML, so use an anchor element, for example:
  6. [source,html]
  7. ----
  8. <a href="https://example.com">Documentation</a>
  9. ----
  10. == Should I open external links in a new tab?
  11. For links that leave OliveTin, `target="_blank"` is convenient. Combine it with `rel="noopener noreferrer"` so the new page cannot access your OliveTin tab and referrer details are limited. Example:
  12. [source,yaml]
  13. ----
  14. contents:
  15. - type: display
  16. title: |
  17. <a href="https://example.com/docs" target="_blank" rel="noopener noreferrer">Open docs</a>
  18. ----
  19. == Can I mix links with entity variables or plain text?
  20. Yes. `title` can combine literal text, xref:entities/intro.adoc[entity template variables], and HTML (such as `<br />`, `<strong>`, or `<a>`). Use YAML's `|` block scalar when you need several lines.
  21. == Does Markdown link syntax like `[text](url)` work?
  22. No. Display `title` is not run through a Markdown parser; it is treated as HTML. Use `<a href="...">...</a>` (or other tags you need) explicitly.
  23. == What should I avoid when embedding HTML?
  24. Treat anything you put in `title` as trusted markup only you control; do not paste untrusted strings into `href` or other attributes without strict validation.
  25. Some deployments use xref:security/content_security_policy.adoc[Content Security Policy] headers, which may block certain schemes or injected scripts—ordinary `https:` links are usually the safest choice.
  26. == Where else is this documented?
  27. See xref:dashboards/4-displays.adoc[Displays] for full display configuration (including xref:dashboards/css.adoc[CSS classes]).