2

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?

9
  • 1
    Did you try ASCII encoding? Try and replace the "#" with "%23" and see if it works.
    – Sleewok
    Dec 11, 2018 at 14:47
  • Thanks, but that was the first thing I tried. It doesn't seem to have any effect. Dec 11, 2018 at 17:20
  • 1
    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.) Dec 12, 2018 at 17:50
  • 1
    And what is the result of running CRM.url('civicrm/a/#/tournament') in the console of your browser on a civicrm page? Dec 13, 2018 at 19:06
  • 1
    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 docs.civicrm.org/dev/en/latest/framework/angular/loader. You may need to initialize the angular loader separately.
    – Demerit
    Dec 13, 2018 at 20:53

1 Answer 1

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).

1
  • 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. Dec 14, 2018 at 16:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.