Answers.Body: <p>Wrong question was asked; fancy CiviCRM stuff works almost, if properly called via CiviCRM own jQuery methods; pretty strange  <strong>CRM.alert</strong> in Chrome pops up a default JS alert() message though, so it might be better to use  <strong>CRM.status</strong> with appropriate parameters</p>
  
  <p>This page helps a lot: <a href="https://wiki.civicrm.org/confluence/display/CRMDOC/Notifications+and+Confirmations" rel="nofollow">https://wiki.civicrm.org/confluence/display/CRMDOC/Notifications+and+Confirmations</a> </p>
  
  <p><em>Additional reading:</em></p>
  
  <ul>
  <li><a href="https://wiki.civicrm.org/confluence/display/CRMDOC43/Javascript+Reference" rel="nofollow">https://wiki.civicrm.org/confluence/display/CRMDOC43/Javascript+Reference</a></li>
  <li><a href="https://wiki.civicrm.org/confluence/display/CRMDOC43/Resource+Reference#ResourceReference-Javascript" rel="nofollow">https://wiki.civicrm.org/confluence/display/CRMDOC43/Resource+Reference#ResourceReference-Javascript</a></li>
  <li><a href="https://wiki.civicrm.org/confluence/display/CRMDOC/Ajax+Pages+and+Forms#AjaxPagesandForms-CRM.refreshParent" rel="nofollow">https://wiki.civicrm.org/confluence/display/CRMDOC/Ajax+Pages+and+Forms#AjaxPagesandForms-CRM.refreshParent</a></li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-23T22:49:13.623Z
Answers.LastActivityDate: 2016-02-23T22:49:13.623Z
Answers.UserDisplayName: yurg
Body: <p>We've got some CiviCRM status messages displayed outside of CiviCRM (Drupal pages), but they come as a default browser JS alerts, not as a fancy CiviCRM-styled status messages. We've    <strong>$manager->addCoreResources();</strong> included via  hook_page_build(&amp;$page); guess it's not enough though. </p>
  
  <p>There is a documentation at <a href="https://wiki.civicrm.org/confluence/display/CRMDOC/Resource+Reference" rel="nofollow">https://wiki.civicrm.org/confluence/display/CRMDOC/Resource+Reference</a>    which says:</p>
  
  <p><em>If you are working outside of CiviCRM core or extensions (such as a Wordpress plugin), you can still use the Resource Manager but will need to construct the urls yourself</em> </p>
  
  <p>with <code>addScriptFile, addScriptUrl, addStyleFile and addStyleUrl</code> methods available; the question is, which exactly CSS files contains fancy pop-ups formatting? </p>
  
  <p>Also, it's a bit unclear, how exactly <strong>css</strong> should be loaded? Normally, it should use addStyleFile / addStyleUrl, but an example given at documentation page states:<br>
  CRM_Core_Resources::singleton()->add<strong>ScriptUrl</strong>('<a href="http://example.com/" rel="nofollow">http://example.com/</a><strong>bar.css</strong>' (mean, use addScript to load CSS Style file) which is a bit confusing.. </p>
  
  <p>Thanks for any hint! </p>
  
Tags: <drupal><css><resource-urls>
Title: CiviCRM CSS outside of CiviCRM
ThreadText: # CiviCRM CSS outside of CiviCRM
  
  (Asked by: username_0 on 2016-02-16)
  
  We've got some CiviCRM status messages displayed outside of CiviCRM (Drupal pages), but they come as a default browser JS alerts, not as a fancy CiviCRM-styled status messages. We've **$manager->addCoreResources();** included via hook\_page\_build(&$page); guess it's not enough though.
  
  There is a documentation at <https://wiki.civicrm.org/confluence/display/CRMDOC/Resource+Reference> which says:
  
  *If you are working outside of CiviCRM core or extensions (such as a Wordpress plugin), you can still use the Resource Manager but will need to construct the urls yourself*
  
  with `addScriptFile, addScriptUrl, addStyleFile and addStyleUrl` methods available; the question is, which exactly CSS files contains fancy pop-ups formatting?
  
  Also, it's a bit unclear, how exactly **css** should be loaded? Normally, it should use addStyleFile / addStyleUrl, but an example given at documentation page states:  
  CRM\_Core\_Resources::singleton()->add**ScriptUrl**('<http://example.com/>**bar.css**' (mean, use addScript to load CSS Style file) which is a bit confusing..
  
  Thanks for any hint!
  
  **Tags:** drupal, css, resource-urls
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2016-02-23. Score: 1 | Accepted answer
  
  Wrong question was asked; fancy CiviCRM stuff works almost, if properly called via CiviCRM own jQuery methods; pretty strange **CRM.alert** in Chrome pops up a default JS alert() message though, so it might be better to use **CRM.status** with appropriate parameters
  
  This page helps a lot: <https://wiki.civicrm.org/confluence/display/CRMDOC/Notifications+and+Confirmations>
  
  *Additional reading:*
  
  * <https://wiki.civicrm.org/confluence/display/CRMDOC43/Javascript+Reference>
  * <https://wiki.civicrm.org/confluence/display/CRMDOC43/Resource+Reference#ResourceReference-Javascript>
  * <https://wiki.civicrm.org/confluence/display/CRMDOC/Ajax+Pages+and+Forms#AjaxPagesandForms-CRM.refreshParent>
  
  
  ---
  
  