We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Where do I put plugin-related javascript & css files?

Development and Programming

spacey310's avatar
spacey310
17 posts
10 years ago
spacey310's avatar spacey310

I’ve got a plugin that requires the user to include additional css & image files in the template. In EE2, I uploaded the image files to the /public_html/themes/third_party/my_plugin_name/png/ folder, and in my plugin I had some code which looks like this:

$imagePathPNG = URL_THIRD_THEMES.'my_plugin_name/png/';

As part of the upgrade instructions to EE3, I moved the /public_html/themes/third_party/my_plugin_name/png/ folder to /public_html/themes/user/addons/my_plugin_name/png/. But now the URL_THIRD_THEMES constant (and similarly PATH_THIRD_THEMES) doesn’t point to the same place as it did in EE2. I changed my code to this:

$imagePathPNG = URL_THIRD_THEMES.'addons/my_plugin_name/png/';

Is this correct way to do this now? Or should I have put all of my files in /public_html/themes/user/my_plugin_name/png/ instead? I’m asking because I installed another third-party add-on, the Tag module, and the supporting files are at /public_html/themes/user/tag/ rather than /public_html/themes/user/addons/tag/. Thanks!

       
Kevin Cupp's avatar
Kevin Cupp
791 posts
10 years ago
Kevin Cupp's avatar Kevin Cupp

Yes that’s right, there is no addons subfolder needed in the themes/user/ directory, the intention is to just put your addon themes in the user directory. We didn’t really see a need to divide things up in there. Hope this answers your question.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.