[MTOS-dev] attaching vs. embedding assets to entries patch

Timothy Appnel tim at appnel.com
Sun Mar 23 11:38:58 PDT 2008


On Sat, Mar 22, 2008 at 6:57 AM, Hirotaka Ogawa
<hirotaka.ogawa at gmail.com> wrote:

>  Tim, I can't understand well what you exactly mean by "attaching" and
>  "embedding".  Why any assets, which are associated with an entry by
>  objectassets, cannot be treated as *embeded* assets?

Sorry I thought this was generally understood and discussed. Perhaps
it was on another MT list though.

So there is an asset object that can then be associated to one or more
objects via the objectasset class to make the association. Currently,
if I want to associate an asset with an entry (or page) I have to use
very specific markup (the form element with certain asset id tags) to
get MT to make the association. If I remove that markup from the body
of the entry or page the association is removed. So in order to
associate an asset to an entry or page I must embed specific markup
(regardless of what text editor) in my text. I had a need where the
asset needs to be associated to the entry, but it doesn't make sense
to embed it in the body. (Think of a presentation file, word doc or
some see also links.) What is missing is the functionality equivalent
of an email attachment. The ability to associate an asset to an entry
without having to embed specific markup and decided its layout in the
body of an entry or post.

I looked into implementing such functionality as a plugin; however,
the MT::Entry save method will remove any asset association it cannot
find in the text or text_more columns upon saving. This makes creating
an asset association of any other type not possible. I can create it,
but as soon as the entry is saved MT will delete the association
because it can't find it as a form tag. The patch I sent would change
that by marking an association if it was created by the markup in the
body of an entry and only remove those if they are no long present in
those fields. If an association were created outside of that context
without the embedded flag up then it would remain for the other system
(plugin) to handle.

So embedding means the association is created by specific markup in
the text or text more columns. Attachment means a specific association
is created like attaching a file to an email message. Its sent and
part of the message, but it doesn't appear in the message itself.

<tim/>

-- 
Timothy Appnel
Appnel Solutions
http://appnel.com/


More information about the MTOS-dev mailing list