Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
984 views
in Plugins by
closed by

I have css file in Plugin folder and I want to include css file in  plugin folder through layer , If anybody know please help me out.

Like qa_path_to_root() give URL to root of Q2a site but how to get URL of Plugin folder.

closed with the note: Solved
by
Sidenote: For anyone who stumbles over this and needs the path to the theme folder, FYI, use $this->rooturl within your advanced theme.

1 Answer

0 votes
by
selected by
 
Best answer

Use the constant, QA_HTML_THEME_LAYER_URLTOROOT:

  1. QA_HTML_THEME_LAYER_DIRECTORY contains the full local path of the plugin directory. This can be used as a prefix for include statements within the layer's code.
  2. QA_HTML_THEME_LAYER_URLTOROOT contains the URL of the plugin directory, relative to the current page request. If the layer outputs HTML that references other files (such as images) within the plugin directory, this prefix should be used for the corresponding URLs.

http://www.question2answer.org/layers.php

The embed plugin uses this.

...