The Hackadelic Sliding Notes Plugin– what a filter change can do
by admin on 06/06/10 at 3:05 pm
One of the best plugins which are out there belongs to a great owner known as The Hackadelic and its his sliding Notes plugin(http://hackadelic.com/solutions/wordpress/sliding-notes).So, reading his post and just going to his web site is a pure enjoyment to every code/developer.
In short, the “Sliding Notes” plugin enables a post writer to but this kind of open/close “ajaxed” button with info
here is an example of how it’s rendered (click on the link):
“click»Ok.so we understand how to use his plugin , and the number of comments in that post reflects the bug usage of others in that plugin.
when i started using his plugin, I needed to add dynamic data to the note.so, right from the begining i understood i had to use using his plugin but in a php style and not in a post writing. obeisllyy the way to use any shortcode in wordpress code is by calling the “do_shortcode” function.
So, here is an simple example of using the do_shortcode :
<?php
echo do_shortcode("slider title=\"click me again\"]nore data...[/slider"); //remeber to put '[' and ']' at the begining and the end.
?>
So, lets assume i am editing the single.php page and i want to add the dynamic data as a slidenote in the post.so what do we do?
Well, its quite a simple answer:just look for the call of
<?php the_content(); ?>
And then add the
<?php echo do_shortcode(put here the slideing shortcode) ?>
and that it.
So, up till here , nothing is quite new.you can read it on several of the article comments and get ti working.What i wanted to do was to add the shortcode and make the slider appear before the content of the post is rendered, so the first thing i tryed was putting the shortcode before the “the_content” call.
how naive i was, It didnt worked.
So, i personlly asked Hackadelic how to do it and he throw me a hint that there are filters/hooks involved that don’t allow this kind of behavoir.
mmmm.so we need to disable that hook right?
i went straight to his code and i found this block of code in the hackadelic-sliding-notes/hackadelic-sliders.php:
function initPublic() {
add_action('wp_print_scripts', array(&$this, 'enqueueScripts'));
add_action('wp_head', array(&$this, 'embedPrologue'), 99);
add_action('wp_footer', array(&$this, 'embedEpliogue'));
add_filter('the_content', array(&$this, 'preProcessContent'), 10);
//remark this line to enable rendering before "the_content" call
add_shortcode('slider', array(&$this, 'doShortcode'));
add_filter('the_content', array(&$this, 'postProcessContent'), 12);
// DO NOT preProcessContent with widget_text !
add_filter('widget_text', array(&$this, 'postProcessContent'), 12);
}
So, using the hint, i knew i was on the right track(include the fact that theere are none usage of add_filter call in any of the plugin files).Than i saw the 4th line (i hightlight t) and i remarked it.
the result, is that we can put the slidenot shortcode before the “the_content” call and it rendered and working.
Hope it was usefull to as it was to me.And Hackadelic!bravo on your plugins.
Popularity: 13% [?]





Cost to have transmission oil and filter changed in a 1994 gmc sierra 1500 with the 4l60e trans???
Jun 6th, 2010
[…] The Hackadelic Sliding Notes Plugin– what a filter change can do | The Office Survivor […]
pell grant
Jun 7th, 2010
Terrific work! This is the type of information that should be shared around the web. Shame on the search engines for not positioning this post higher!
bazel
Aug 24th, 2010
this can be used only on single, not on category template. when in category it gets the content form the first post an all others
yoavadler
Aug 26th, 2010
You are right.
I intend to post an article about the sliding alternativs.i will take in considaratin category templates.