Hi Andrew

Unfortunately, the Habari Silo isn't easily extensible at the moment.  It's
something I've been thinking about as I think it would be great if plugin
developers could create plugins that enhance the default Habari Silo rather
than writing a whole new plugin that re-invents the wheel just to insert
simple functionality enhancements or customisations.

Real case scenarios when this would be useful include plugins that provide:

- a drag-and-drop HTML5 upload interface which over-rides the default silo
- add links to something like Picnik for basic image editing etc along the
top
- add image editing/cropping/resizing tools
- add buttons for different sizes and content.

I'll write up a better explanation at a later date and log a ticket for it
for further input.

In the mean time, lets get back to your question:  yes, plugins should not
over-write media.js, however you can "over-rule" media.js via your own
plugin.  This is what I do in the SmugMug Silo plugin and I over-rule the
exact bit of code you mention. Instead of having a simple "insert" button
below the image, the SmugMug Media Silo over-rules this and provides a
series of buttons for inserting different image sizes.

You can grab the SmugMug Silo Plugin from
http://lildude.co.uk/projects/smugmug-media-silo-plugin and check the source
to see what I've done .  You'll also see a screenshot which illustrates what
I'm talking about.

HTH
Colin



On Fri, Jan 21, 2011 at 12:44 AM, Andrew Heath <[email protected]>wrote:

> *(I apologize if this has been covered before in Habari-Dev. Google Groups
> is blocked in China and I haven't a VPN handy at the moment that would allow
> me to search the group archives.)*
>
> I'd like to change the code when inserting images into a post from the
> silo. Specifically, I'd like the insertion to create something akin to this
> code by default (new parts in bold):
>
> *<div class="image">*
>   <img alt="" src="" width="" height="" *title=""* />
> *  <div class="imageCaption"></div>
> </div>*
>
> As I understand it, currently */system/admin/js/media.js* controls this
> ability, with lines 169~171 governing the inserted image's code.
>
> I can manually edit these lines to satisfy my needs, but what would I do if
> I wanted to make a plug-in for this ability? Or with a more general scope -
> let's say a plug-in that allows the user to define an inserted image's
> default HTML.
>
> It's a no-no for plug-ins to overwrite media.js, is it not?
>
> Thank you for your time!
>
> - Andrew
>
> --
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/habari-dev




-- 
Colin Seymour
Blog: http://colinseymour.co.uk
Tech Stuff: http://lildude.co.uk
Barefoot Running: http://barefootrunner.co.uk
IRC: lildude #habari

-- 
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at http://groups.google.com/group/habari-dev

Reply via email to