Bug #240

the_sniplet() template tag not working

Added by Anonymous 49 days ago. Updated 4 days ago.

Status : Closed Start : 07/20/2008
Priority : Normal Due date :
Assigned to : - % Done :

100%

Category : -
Target version : -

Description

the_sniplet() template tag doesn't work. I've tried it on both page, post, blog index, and front page templates. It always returns nothing. I'm running Sniplets 1.3.2 on Wordpress 2.6. It didn't work on Wordpress 2.5.1 either. I'm no expert but I think it's because $this->sniplets['manual'] isn't populated properly. If you check a sniplet using the have_sniplet() function, it returns false.

History

#1 07/21/2008 11:13 AM - Anonymous

Hey John - Zain here.

I've also tested this and can verify that the template tags (and placements) do not work properly.

One thing I've noticed is that if you try and use any placement, then by default the sniplet always appears before a post. So if you define it to appear after a post, it now appears in 2 positions - before AND after the post.

I'd check to see if the random feature for limits is working but I can't even get the sniplet place to render properly. Nothing gets displayed to the screen.

Anyway, I'm also testing Sniplets v1.3.2 and WP v2.6 (and WP v2.5 as well!).

Cheers,

Zain

#2 07/25/2008 03:00 PM - Luciano Passuello

Yes, just for the record, the same as Zain here: custom placements have no effect at all :(
(WP2.6 / Sniplets 1.3.2)

Best Regards,
Luciano.

#3 08/19/2008 03:47 PM - John Godley

Status changed from New to Feedback

Do these problems still exist?

I have no problems with the_sniplet tag, nor do I have any duplication of placements.

#4 08/20/2008 12:44 PM - Luciano Passuello

Hi John,
I just downloaded again and tested for a sanity-check and the problem still persists.
I define a sniplet. If I select a pre-defined placement like, say, "header", it works fine.
If I define a custom placement, it doesn't show: Here's what I did:

Defined placement customplace in Options page.
Assigned the custom placement customplace to the sniplet in the Shared Sniplets page.
Added the following code to my template:
<?php the_sniplet_place ('footerplace'); ?>

I expected the sniplet text to appear in the rendered page at the location I inserted the code above, but that doesn' happen.

Best Regards,

#5 08/28/2008 10:53 AM - Anonymous

Hi John,

Same issue here as Luciano's got. Custom placements just won't work but pre-defined ones do.

This then also affects the randomise options for custom places.

Cheers,

Zain

#6 09/02/2008 05:01 PM - Anonymous

Whoohoo, I finally got it working. It seems it was a misplacement of unique names/descriptive names. For others intested (Zain, anyone else) this is how I made it:

In functions.php:

add_filter ('sniplet_places', 'litemind_places');

function litemind_places ()
{
  return array
  (
    'Litemind' => array
    (
      'litemind/footerplace' => 'Litemind Footerplace'
    )
  );
}

In the theme code:

<?php the_sniplet_place ('footerplace'); ?>

Now all you need to do is select "Litemind/Litemind Footerplace" as a placement for your sniplet (your theme-specific placements it will appear in their own session in the dropdown).

Of course you'll use different names, but at least you can get an idea of where to use the descriptive names/unique names...

Maybe that's what in the documentation since the beginning, but for some reason I didn't find it clear enough (not sure if this is my fault or documentation's).
John, thanks for this great plug-in!

Best Regards,
Luciano.

#7 09/02/2008 05:28 PM - Anonymous

Oh, not so fast. I figured out the problem. I was doing it right all along.
The problem is that I was testing in the site front page.
The sniplet code above shows right in all pages of the site EXCEPT for the front page (index).

This is seems like a bug, since the custom placement is defined in footer.php and it should then appears on ALL site pages.

This is what this other thread is probably about:
http://urbangiraffe.com/support/topic/homepage-sniplet-display

John, can you try to repro and confirm??

#8 09/03/2008 09:32 AM - John Godley

% Done changed from 0 to 100

The thread you linked to was for another issue relating to placements.

The correct code to insert into your template is:

<?php the_sniplet_place ('litemind/footerplace'); ?>

#9 09/04/2008 09:02 AM - John Godley

Status changed from Feedback to Closed

Update

Notes

Files
Optional description
Add another file (Maximum size: 5 MB)

Preview

Also available in: Atom PDF

Loading...


You are viewing a mobilized version of this site...
View original page here

Mobilized by Mowser Mowser