Answers.Body: <p><code>civicrm/a</code> is a fullscreen-only page and cannot be opened in a popup. However, recent work in Afform (FormBuilder) <em>does</em> allows Afforms to be loaded in a popup, which would give you the functionality you want. Simply call:</p>
  <pre><code>CRM.loadForm(CRM.url('civicrm/path/to/my-afform'));
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-08-20T18:17:08.933Z
Answers.LastActivityDate: 2023-08-20T18:17:08.933Z
Answers.UserDisplayName: Coleman
Answers.Body: <p>How about just plain javascript:</p>
  
  <p>window.open(CRM.url('civicrm/a/#/tournament'), 'mywindow', 'scrollbars=yes');</p>
  
  <p>Obviously 2nd and 3rd parameters can be whatever you want.</p>
  
  <p>Works on dmaster.demo.civicrm.org (with 'civicrm/a/#/caseType/new', since I assume "tournament" is something custom).</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-14T16:38:35.887Z
Answers.Text: That renders the content I want, but also a lot more that I don't want, e.g., all the WordPress and CiviCRM menus. My attraction to loadForm was to avoid reloading all that from the server.
Answers.UserDisplayName: Mike Steigerwald
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-14T02:05:59.813Z
Answers.LastActivityDate: 2018-12-14T02:05:59.813Z
Answers.UserDisplayName: Demerit
Body: <p>This call:</p>
  
  <pre><code>CRM.loadForm(CRM.url('civicrm/a/#/tournament'));
  </code></pre>
  
  <p>works very well for any url that does NOT contain 'civicrm/a/#'. As soon as I try to open anything from an extension, the popup stays 'white.' No errors. Just ... white.</p>
  
  <p>Is there a way to make that work for such url?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-12-11T14:47:12.573Z
Comments.Text: Did you try ASCII encoding? Try and replace the "#" with "%23" and see if it works.
Comments.UserDisplayName: Sleewok
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-12-11T17:20:27.290Z
Comments.Text: Thanks, but that was the first thing I tried. It doesn't seem to have any effect.
Comments.UserDisplayName: Mike Steigerwald
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-12-12T17:50:01.503Z
Comments.Text: Do you have that problem using CRM.loadPage with the same argument? (Is is a problem with the form wrapper or is it the loading of that url.)
Comments.UserDisplayName: Luke Stewart
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-12-12T22:04:13.470Z
Comments.Text: Unfortunately, yes. The behavior is the same with both CRM.loadForm and CRM.loadPage.
Comments.UserDisplayName: Mike Steigerwald
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-12-13T19:06:09.210Z
Comments.Text: And what is the result of running CRM.url('civicrm/a/#/tournament') in the console of your browser on a civicrm page?
Comments.UserDisplayName: Luke Stewart
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-12-13T20:53:00.423Z
Comments.Text: The # is usually used as a dummy anchor which is bound later by javascript to a click event, which then loads the content using ajax. So that binding is probably not happening when done standalone. See also https://docs.civicrm.org/dev/en/latest/framework/angular/loader/. You may need to initialize the angular loader separately.
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-12-13T21:48:33.733Z
Comments.Text: The result of running CRM.url('civicrm/a/#/tournament') in the console of my browser on a civicrm page is pretty much what I expected: "/wp-admin/admin.php?page=CiviCRM&q=civicrm/a/#/tournament"   That renders fine as a page, but not in a popup.
Comments.UserDisplayName: Mike Steigerwald
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-12-13T21:52:32.023Z
Comments.Text: I'm not clear on the meaning of 'done standalone?' In my mind, the 'standalone' version would be https://dev.agloa.org/wp-admin/admin.php?page=CiviCRM&q=civicrm/a/#/tournament which renders exactly the way I want. I guess what I'm trying to learn is what would be different loading that in a popup?
Comments.UserDisplayName: Mike Steigerwald
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-12-13T23:57:16.073Z
Comments.Text: Sorry maybe standalone is not the right word, I mean loadForm loads some supporting code, but maybe not everything the same as loading the same url in the browser, so is more "lonely". But I'm not familiar enough with the whole framework to tell you what you might need to do extra to also load the other stuff. My thinking is it's related to the angular loader.
Comments.UserDisplayName: Demerit
Tags: <api><extension><urls>
Title: Why won't CRM.loadForm render url containing civicrm/a/#?
ThreadText: # Why won't CRM.loadForm render url containing civicrm/a/#?
  
  (Asked by: username_0 on 2018-12-09)
  
  This call:
  CRM.loadForm(CRM.url('civicrm/a/#/tournament'));
  
  works very well for any url that does NOT contain 'civicrm/a/#'. As soon as I try to open anything from an extension, the popup stays 'white.' No errors. Just ... white.
  Is there a way to make that work for such url?
  
  **Tags:** api, extension, urls
  
  > **Comments:**
  > **username_1**: Did you try ASCII encoding? Try and replace the "#" with "%23" and see if it works.  
  > **username_0**: Thanks, but that was the first thing I tried. It doesn't seem to have any effect.  
  > **username_2**: Do you have that problem using CRM.loadPage with the same argument? (Is is a problem with the form wrapper or is it the loading of that url.)  
  > **username_0**: Unfortunately, yes. The behavior is the same with both CRM.loadForm and CRM.loadPage.  
  > **username_2**: And what is the result of running CRM.url('civicrm/a/#/tournament') in the console of your browser on a civicrm page?  
  > **username_3**: The # is usually used as a dummy anchor which is bound later by javascript to a click event, which then loads the content using ajax. So that binding is probably not happening when done standalone. See also https://docs.civicrm.org/dev/en/latest/framework/angular/loader/. You may need to initialize the angular loader separately.  
  > **username_0**: The result of running CRM.url('civicrm/a/#/tournament') in the console of my browser on a civicrm page is pretty much what I expected: "/wp-admin/admin.php?page=CiviCRM&q=civicrm/a/#/tournament"   That renders fine as a page, but not in a popup.  
  > **username_0**: I'm not clear on the meaning of 'done standalone?' In my mind, the 'standalone' version would be https://dev.agloa.org/wp-admin/admin.php?page=CiviCRM&q=civicrm/a/#/tournament which renders exactly the way I want. I guess what I'm trying to learn is what would be different loading that in a popup?  
  > **username_3**: Sorry maybe standalone is not the right word, I mean loadForm loads some supporting code, but maybe not everything the same as loading the same url in the browser, so is more "lonely". But I'm not familiar enough with the whole framework to tell you what you might need to do extra to also load the other stuff. My thinking is it's related to the angular loader.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_4 on 2023-08-20. Score: 0
  
  civicrm/a is a fullscreen-only page and cannot be opened in a popup. However, recent work in Afform (FormBuilder) does allows Afforms to be loaded in a popup, which would give you the functionality you want. Simply call:
  CRM.loadForm(CRM.url('civicrm/path/to/my-afform'));
  
  
  ---
  
  ### Answer by username_3 on 2018-12-14. Score: 0
  
  How about just plain javascript:
  
  window.open(CRM.url('civicrm/a/#/tournament'), 'mywindow', 'scrollbars=yes');
  
  Obviously 2nd and 3rd parameters can be whatever you want.
  
  Works on dmaster.demo.civicrm.org (with 'civicrm/a/#/caseType/new', since I assume "tournament" is something custom).
  
  > **Comments:**
  > **username_0**: That renders the content I want, but also a lot more that I don't want, e.g., all the WordPress and CiviCRM menus. My attraction to loadForm was to avoid reloading all that from the server.  
  
  ---
  
  