Answers.Body: <p>It's quite simple actually. Add the css class <code>crm-popup</code> to the link and you're done :)</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-10-03T11:49:34.910Z
Answers.Text: That's pretty great!!
Answers.UserDisplayName: Aiden
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-08-05T17:10:40.160Z
Answers.LastActivityDate: 2017-08-05T17:10:40.160Z
Answers.UserDisplayName: Coleman
Body: <p>There are lots of links in CiviCRM which will: (a) open an overlaid modal dialog when clicked, and (b) open the same content in a new page when <kbd>Ctrl</kbd>+clicked or middle-clicked. This is cool and I want to make one link which does this. </p>
  
  <p>I see <a href="https://github.com/civicrm/civicrm-core/blob/0f03f337533bb76fb7fe6dcc25cdd624daef24f3/CRM/Custom/Page/Field.php#L46" rel="noreferrer">here</a> that <em>pages</em> can enable this behavior for <em>all links within the page</em> by extending <code>CRM_Core_Page</code> and setting <code>public $useLivePageJS = FALSE;</code>. Neat, but not quite what I want.</p>
  
  <p>I'm building an extension where I want to achieve the same result, but for one link which would live at the top level of the CiviCRM menu. Is there a class I can add somewhere, or a javascript function I can call somehow that will enable this "modal" functionality for one link?</p>
  
Tags: <developer>
Title: How do I make one hyperlink which shows its target page as a modal dialog when clicked?
ThreadText: # How do I make one hyperlink which shows its target page as a modal dialog when clicked?
  
  (Asked by: username_0 on 2017-08-04)
  
  There are lots of links in CiviCRM which will: (a) open an overlaid modal dialog when clicked, and (b) open the same content in a new page when `Ctrl`+clicked or middle-clicked. This is cool and I want to make one link which does this.
  
  I see [here](https://github.com/civicrm/civicrm-core/blob/0f03f337533bb76fb7fe6dcc25cdd624daef24f3/CRM/Custom/Page/Field.php#L46) that *pages* can enable this behavior for *all links within the page* by extending `CRM_Core_Page` and setting `public $useLivePageJS = FALSE;`. Neat, but not quite what I want.
  
  I'm building an extension where I want to achieve the same result, but for one link which would live at the top level of the CiviCRM menu. Is there a class I can add somewhere, or a javascript function I can call somehow that will enable this "modal" functionality for one link?
  
  **Tags:** developer
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-08-05. Score: 5 | Accepted answer
  
  It's quite simple actually. Add the css class `crm-popup` to the link and you're done :)
  
  > **Comments:**
  > **username_2**: That's pretty great!!  
  
  ---
  
  