1 travis_s Mar 06, 2008 17:16
3 travis_s Mar 06, 2008 18:04
EdB wrote:
... snip ... Your RenderItemAsHtml could easily say "if you see this bit anywhere in the post remove it from whereever it is and add this stuff to the very end of the content".
Yeah, that's what I've got, but I didn't want to have to add "[dzone]" to every post that I wanted to have the dzone widget on it. I was thinking a checkbox would be much more suitable in this instance.
I did try "opt-out" as means of putting it on all of the time (the way smilies are), but that didn't seem to do the trick.
4 yabba Mar 06, 2008 18:17
try "always" if you want to add it to old posts ( or even stealth ), also look into DisplayItemAsHtml .... all the hooks are in /inc/plugins/model/_plugins_admin.class.php or summat
¥
5 edb Mar 06, 2008 18:20
Does it not work without adding something to the post content for it to render? I never tried it but I was thinking something like
/* Somebody's gotta do some actual work around here! */
function RenderItemAsHtml( & $params ) {
$content = & $params['data'];
$content .= ' I wonder what a dzone is?';
return true;
}
hmmm... I need to look at smilies again. no: didn't help me. I have a plugin that intermittently and randomly after an unknowable amount of time decides to not render.
Anyway back on track: assuming you can add something without having something in the post to replace then the next thing is to make a couple of iterations of the plugin so you get multiple checkboxes. That way nothing goes in the post and all the bits are accessible from the back office.
In your plugin:
will give you a checkable checkbox that, when checked, will do whatever you have the RenderItemAsHtml hook tell it to do. For multiple thingies you would probably want a way to pick which thingie gets added by enjoying the AdminDisplayToolbar hook yah? Also depending on what you're adding, just using AdminDisplayToolbar would probably be enough.
No that's not right. No toolbar because that ... would ... people could place the thingie anywhere, but that's not really right. Your RenderItemAsHtml could easily say "if you see this bit anywhere in the post remove it from whereever it is and add this stuff to the very end of the content".
Tags are one of those "peripheral" bits like author and date and cats. Not a plugin, and typically treated outside the actual post content, but I suppose one could make a plugin that snaggles the tags and does something with them inside post_content. I mean, if one was smart and had a notion to do something like that. I gave up on tags after figuring out how to make my skin say "this post is untagged" if/when I opt to not use them.