Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Where should external plugin resources be stored?
Hello Textpattern Community!
This is my first post here. I started working with Textpattern in july 2011 and i love it very much!
Currently, i am writing some plugins wich are based on a self-made standalone web gallery.
Now, i have a question: Some of these plugins use external resources (css, js, swf, php). For now, i place these files into a directory with the name of the plugin within the “plugin_cache_dir” (e.g. /plugins/xyz_plugin).
Is that the right place to store external resources used by plugins?
Thanks in advance!
Offline
Re: Where should external plugin resources be stored?
developr wrote:
Is that the right place to store external resources used by plugins?
That is not an ideal location. Pretty much anything else than the plugin cache directory works. Just do not place external plugin resources to plugin_cache_dir (in any case at least not to root) or tmp directory.
Placing something unnecessary to plugin_cache_dir will just marginally slow Textpattern. Plugin cache dir is looked for plugins (i.e. *.php files). The more items the directory has, the longer the look up operation will take.
Offline
Re: Where should external plugin resources be stored?
I concur with Gocom: avoid the plugin cache dir for everything except the plugins themselves.
I tend to lump external scripts at site root:
/css
|-> shadowbox
|-> [shadowbox css files]
|-> cycle
|-> [cycle css files]
/js
|-> shadowbox
|-> [shadowbox js files]
...
Since I use the rvm_css plugin for serving stylesheets I already have a /css dir set up with all my site’s stylesheets in it so to have additional subdirs off that for third party scripts fits my workflow. You can of course lay it out however suits.
Last edited by Bloke (2011-09-24 22:53:53)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Re: Where should external plugin resources be stored?
Thanks for this clear answers! Good to know.
I will change storage locations and use a structure like te one proposed by Bloke.
Offline
Re: Where should external plugin resources be stored?
Placing something unnecessary to plugin_cache_dir will just marginally slow Textpattern. Plugin cache dir is looked for plugins (i.e. *.php files). The more items the directory has, the longer the look up operation will take.
Ah, good to know, thanks.
I’ve a few folders inside the /admin/plugins/
folder, and also a README file. Now that I know, I’ll move the plugins (the .php files) to a subfolder.
Offline