steps to duplicate content_image tag as content_pdf (or other content types)?
Posted: Tue Nov 16, 2010 7:44 pm
Howdy. I am currently in need of a (relatively) user friendly way to allow site admins to associate a PDF with a given page (and possibly other filetypes as well). Functionally, the "content_image" tag behaviour is ideal but unfortunately, the filename parameters are hardcoded into a core CMSMadeSimple class. What I want then is a "content_pdf" tag that behaves the same except it looks for a different filename pattern.
Looking through the codebase I see that there is a plugin for handling the display portion of the problem which can be trivially copied and modified for the display side of things ("plugins/function.content_image.php").
What I am unclear about is how to hook a similar version of the logic from "lib/classes/contenttypes/Content.inc.php" associated with the "content_image" tag with a new "custom_file" tag *without* modifying the core class (which would break updgrading). This happens between lines 490 and 566 and again, looks like it should be a copy and paste job mostly if I knew how to hook this in.
Any guidance much appreciated.
Cheers
Looking through the codebase I see that there is a plugin for handling the display portion of the problem which can be trivially copied and modified for the display side of things ("plugins/function.content_image.php").
What I am unclear about is how to hook a similar version of the logic from "lib/classes/contenttypes/Content.inc.php" associated with the "content_image" tag with a new "custom_file" tag *without* modifying the core class (which would break updgrading). This happens between lines 490 and 566 and again, looks like it should be a copy and paste job mostly if I knew how to hook this in.
Any guidance much appreciated.
Cheers