Plugins: Asset Plugin supporting images request.

1 view
Skip to first unread message

Joe

unread,
Jan 3, 2011, 8:50:16 PM1/3/11
to ColdMVC
Can the Assets Plugin support image paths as well? If the image exists
in the working project use that one else use the one in the plugin's
public >> image directory. I feel like the plugin's contents can have
a prefix. Example mypluginname_mypic.jpg.

Tony Nelson

unread,
Jan 3, 2011, 10:31:22 PM1/3/11
to ColdMVC
Last weekend I made some updates to allow project's to pull in views
from plugins if they don't already exist in the project. I should be
able to apply similar logic to how the AssetManager pulls in assets.
For example, all public assets (images, js, css) inside a plugin will
be automatically copied into your project into a folder located at /
public/plugins/{plugin-name}/(images|js|css)/, while keeping track
where assets are coming from inside an internal cache. Then when you
request to display an image (<c:image name="some_image.gif" />), it
will look up the actual path to the image using the value stored in
the internal cache.

I don't anticipate this update taking too long and I can try to have
it done sometime this week, or the weekend at the latest.

-Tony

Tony Nelson

unread,
Jan 3, 2011, 11:34:48 PM1/3/11
to ColdMVC
I got a little over anxious and made the updates to the asset plugin
that I described above. All css, js, and images will be copied from a
plugin into the root project if they don't already exist into the
following folder structure: /public/(css|js|images)/plugins/{plugin-
name}/{asset-name}. The code you use to render the assets shouldn't
change. I just extended the asset helper to delegate to the
AssetManager plugin component. Let me know if you have any questions.

For others, the asset plugin can be found at https://github.com/tonynelson19/ColdMVC-Assets
if you're curious.

-Tony
Reply all
Reply to author
Forward
0 new messages