Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
  • Register
Welcome to the Q&A for Question2Answer.

If you have questions about the platform, click here to ask and please use English.

If you just want to try Q2A, please use the demo, which also grants admin access.

Apr 29: Q2A 1.5.2

how to include css file in plugin folder

0 votes

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
asked Feb 4 in Plugins by rajul885
closed Feb 4 by rajul885

1 Answer

0 votes
 
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.

answered Feb 4 by NoahY
selected Feb 4 by rajul885