Findmore plugin inactive for sticky posts?

Creating and modifying plugins.
User avatar
Fabien
Regular
Posts: 172
Joined: Wed Mar 15, 2006 2:02 pm
Location: Paris (France)
Contact:

Findmore plugin inactive for sticky posts?

Post by Fabien » Mon Sep 17, 2012 9:06 am

I use the findmore pligin, but I would like it to be inactive for sticky posts. Is there an easy way to do that?

Thanks, Fabien
Fabien Chabreuil (blog)

User avatar
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Findmore plugin inactive for sticky posts?

Post by Timbalu » Mon Sep 17, 2012 10:07 am

Salut Fabien

Yes, go the Smarty way...
The findmore event plugin has a template file, named plugin_findmore.tpl.
You could edit it and add something like this surrounding that files content:

Code: Select all

{if not $dategroup.is_sticky}
    ...
{/if}
That would need the findmore plugin to appear after the entryproperties plugin, I assume.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian

User avatar
Fabien
Regular
Posts: 172
Joined: Wed Mar 15, 2006 2:02 pm
Location: Paris (France)
Contact:

Re: Findmore plugin inactive for sticky posts?

Post by Fabien » Mon Sep 17, 2012 10:52 am

Hi Ian,

Thanks for your message. I tried your solution, but alas no effect !

Cheers, Fabien
Fabien Chabreuil (blog)

User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Findmore plugin inactive for sticky posts?

Post by garvinhicking » Mon Sep 17, 2012 10:59 am

Hi!

Did you maybe check instead for:

Code: Select all

Sticky value: {$entrydata.properties.ep_is_sticky} {$entrydata.properties.is_sticky}
{if NOT $entrydata.properties.ep_is_sticky AND NOT $entrydata.properties.is_sticky}
(I'm not sure if the key is is_sticky or ep_is_sticky, so I added both...)

It could be that $dategroup is not available within this tpl file; currently I don't have my test installation accessible to test it on my own...

HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/

User avatar
Fabien
Regular
Posts: 172
Joined: Wed Mar 15, 2006 2:02 pm
Location: Paris (France)
Contact:

Re: Findmore plugin inactive for sticky posts?

Post by Fabien » Mon Sep 17, 2012 11:08 am

Hi Garvin,

Thanks for being here!

No effect also.

Warmly, Fabien
Fabien Chabreuil (blog)

User avatar
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Findmore plugin inactive for sticky posts?

Post by Timbalu » Mon Sep 17, 2012 11:22 am

{if NOT $entrydata.properties.ep_is_sticky AND NOT $entrydata.properties.is_sticky} should be much better than mine.
Did you also made sure to have the entryproperties before the findmore plugin in the plugin management?

You could also try to add that sticky check {if ... } {/not} into the entries.tpl of your template, right there where plugins hook in...
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian

User avatar
Fabien
Regular
Posts: 172
Joined: Wed Mar 15, 2006 2:02 pm
Location: Paris (France)
Contact:

Re: Findmore plugin inactive for sticky posts?

Post by Fabien » Tue Sep 18, 2012 9:28 am

Yes the findmore plugin is the last event plugin.
Fabien Chabreuil (blog)

User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Findmore plugin inactive for sticky posts?

Post by garvinhicking » Tue Sep 18, 2012 12:46 pm

Hi!

When you use my code, you should see in the plugin an output like this:

Code: Select all

Sticky value: 
Does this appear for you as well? You might want to enhance it to:

Code: Select all

<pre>
Entry data: {$entrydata|@print_r}
Global Entry data: {$entry|@print_r}
Global Entrygroup data: {$dategroup|@print_r}
</pre>
This would give a clue on what variables are there, and how/if/why the seem to be misbehaving. Sorry for this, but currently my devel-webserver is down for maintenance and I can't check it on my own :-/

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/

User avatar
Fabien
Regular
Posts: 172
Joined: Wed Mar 15, 2006 2:02 pm
Location: Paris (France)
Contact:

Re: Findmore plugin inactive for sticky posts?

Post by Fabien » Tue Sep 18, 2012 2:50 pm

Here is what i see above the icons

Code: Select all

Entry data: Array
(
    [url] => http://www.integralpersonality.com/IPBlog/archives/1-Aller-au-cur-de-la-connaissance.html
    [title] => Aller au cœur de la connaissance
    [path] => /IPBlog/plugins/serendipity_event_findmore/img/
)
1
Global Entry data: 1
Global Entrygroup data: 1
 Sticky value: 
Cheers, Fabien
Fabien Chabreuil (blog)

User avatar
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Findmore plugin inactive for sticky posts?

Post by Timbalu » Tue Sep 18, 2012 4:27 pm

Where did you try this, in plugin_findmore.tpl or in entries.tpl?
Are there many sticky entries in your blog? If not, you you could try to workaround with

Code: Select all

{if NOT $entrydata.title == 'Aller au cœur de la connaissance' AND  NOT $entrydata.title == 'some other sticky title'} and so on
...
{/if}
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian

User avatar
Fabien
Regular
Posts: 172
Joined: Wed Mar 15, 2006 2:02 pm
Location: Paris (France)
Contact:

Re: Findmore plugin inactive for sticky posts?

Post by Fabien » Tue Sep 18, 2012 5:02 pm

I have only one sticky entry. I have tried your solution and also with entrydata.url: no result!

Thanks, Fabien
Fabien Chabreuil (blog)

User avatar
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Findmore plugin inactive for sticky posts?

Post by Timbalu » Tue Sep 18, 2012 6:00 pm

Try again in your templates entries.tpl and find this part...

Code: Select all

$entry.plugin_display_dat}
and change it like this

Code: Select all

{if NOT $entry.title == 'Aller au cœur de la connaissance' AND NOT $entry.is_sticky}
{$entry.plugin_display_dat}
{/if}
I am not sure if $entry.is_sticky is available, but you could make the |print_r tests as before
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian

User avatar
Don Chambers
Regular
Posts: 3638
Joined: Mon Feb 13, 2006 3:40 am
Location: Chicago, IL, USA
Contact:

Re: Findmore plugin inactive for sticky posts?

Post by Don Chambers » Tue Sep 18, 2012 6:17 pm

Ian - I think you were on the right track before, just not quite the right syntax. if it is only a single sticky entry, try this:

Code: Select all

{if $entrydata.title!='Aller au cœur de la connaissance'}....{/if}

User avatar
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Findmore plugin inactive for sticky posts?

Post by Timbalu » Tue Sep 18, 2012 6:51 pm

Sure, that could be as well :wink: I remember I had a fuzzy twilighted feeling with that other syntax... it felt so mysqlish..., but should Smarty not support this too?
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian

User avatar
Don Chambers
Regular
Posts: 3638
Joined: Mon Feb 13, 2006 3:40 am
Location: Chicago, IL, USA
Contact:

Re: Findmore plugin inactive for sticky posts?

Post by Don Chambers » Tue Sep 18, 2012 7:01 pm

I think {if NOT $entrydata.title} is a logical true/false test.... whereas {if $entrydata.title!='whatever'} is a string evaluation... or something like that. What do I know?! I just do the occasional template, and I have not had much time for any of this stuff lately! :mrgreen:

Post Reply