Page 1 of 2

Recent Entries Sidebar

Posted: Tue Mar 02, 2010 5:00 pm
by diroddi
Hello -

I would like to have the Recent Entries Sidebar plugin display entries regardless of their category when landing on the front page, but after navigating to a specific entry, display only entries for the category of the entry being viewed.

It appears that part of this can be accomplished with 'Parent Category' when configuring the plugin, although it only displays entries when the category is selected. When selecting a specific entry or landing on the front page nothing is displayed in recent entries.

Thanks

Re: Recent Entries Sidebar

Posted: Tue Mar 02, 2010 7:43 pm
by Don Chambers
Try this (untested)...

Install the plugin, and configure to show all categories, and for "when to show", select "overview page only".

Install the plugin a SECOND time in the same sidebar (left or right).... This time, select "parent category" and for when, select "extended entry only".

Re: Recent Entries Sidebar

Posted: Wed Mar 03, 2010 5:14 am
by diroddi
Thanks for the suggestion. Unfortunately no luck. The first install of the plugin works as expected and shows on the overview page only and then disappears when selecting an entry or category. The second install appears as expected but doesn't show any entries.

Any other ideas?

Re: Recent Entries Sidebar

Posted: Wed Mar 03, 2010 11:47 am
by garvinhicking
Hi!

Don's idea was quite good already, but by default when you view a single blog entry, the "category" does not get set as the current category.

I believe for that to happen, you need to install the categorytemplates ("Extended options/templates for Categories") event plugin, which allows you to forcibly set the categoryID to that of the currently shown entry, which would then make sure that the sidebar plugin knows what the "current category" is...

HOWEVER.

I just patched the recententries plugin to make "Current category" also understand the ID of a single entry and fetch the proper ID.

You can get the updated plugin PHP file here:

http://svn.berlios.de/viewcvs/*checkout ... ision=2641

Regards,
Garvin

Re: Recent Entries Sidebar

Posted: Wed Mar 03, 2010 8:22 pm
by Don Chambers
Garvin - does your recent patch require the categorytemplates plugin?

Re: Recent Entries Sidebar

Posted: Thu Mar 04, 2010 1:35 pm
by garvinhicking
Hi!
Don Chambers wrote:Garvin - does your recent patch require the categorytemplates plugin?
Nope, it does not have that dependency.

Regards,
Garvin

Re: Recent Entries Sidebar

Posted: Thu Mar 04, 2010 2:58 pm
by Don Chambers
garvinhicking wrote:Nope, it does not have that dependency.
Cool - any chance of adding that same functionality to the HTML nugget plugin?

Re: Recent Entries Sidebar

Posted: Mon Mar 08, 2010 11:47 am
by garvinhicking
Hi Don!
Don Chambers wrote:
garvinhicking wrote:Nope, it does not have that dependency.
Cool - any chance of adding that same functionality to the HTML nugget plugin?

Uhm...what I patched was which category source the recent entries plugin pulls its data from. How can that be applied to the HTML nugget plugin?

Regards,
Garvin

Re: Recent Entries Sidebar

Posted: Mon Mar 08, 2010 3:14 pm
by Don Chambers
I think I misunderstood your patch when I initially read your message. Nevermind! :lol: :lol:

Re: Recent Entries Sidebar

Posted: Tue Mar 09, 2010 4:02 pm
by diroddi
Hi!

Thank you for your time, I appreciate your help. Sorry for the delay in getting back to test this.

The changes you made work as expected and show recent entries of the parent category when viewing a specific entry, although does not display any entries when selecting a category. In addition, the first install of the plugin that is set to show 'all' categories on the overview page does not show any entries.

Re: Recent Entries Sidebar

Posted: Wed Mar 10, 2010 3:23 pm
by garvinhicking
Hi!

Do you have an URL where to see that?

You could edit the seredipity_plugin_recentries.php file and search for this line around line 159:

Code: Select all

        if ($category != 'none' && !empty($category)) {
and change that to:

Code: Select all

echo "Showing entries for category: " . print_r($category, true) . "<br />\n";
        if ($category != 'none' && !empty($category)) {
And then check what the plugin outputs; I assume that the contents might not be correct?!

Regards,
Garvin

Re: Recent Entries Sidebar

Posted: Wed Mar 10, 2010 7:09 pm
by diroddi
Hi

I just sent a PM to a QA test environment URL.

I did as you suggested and it shows 'none' when landing on the overview page or navigating to a category. When navigating to a specific entry it shows the category id.

Re: Recent Entries Sidebar

Posted: Thu Mar 11, 2010 10:27 am
by garvinhicking
Hi!

Hm, "none" should only actually appear when in the plugin configuration you set the dropdown to "no category", so that seems about right. What other configuration options did you set for the plugin?

Maybe you can also edit the file again, and after

Code: Select all

$entries = serendipity_db_query($entries_query);
add:

Code: Select all

echo "Query: " . $entries_query . "<br />\n";
print_r($entries);
That should give me a clue what the query contains to see why it does not return any entries.

Regards,
Garvin

Re: Recent Entries Sidebar

Posted: Fri Mar 12, 2010 3:11 pm
by diroddi
Hi

I added the code snippet. MySQL returns: Not unique table/alias: 'ec'

Configuration for the 1st install of the plugin:
Title: Plugin 1-All
Number of entries: 5
Skip front page entries: Show all
Dateformatting: %A, %B %e %Y
Category: All categories
Show Random Articles: No
Where should the item be displayed: Overview page only

Configuration for the 2nd install of the plugin:
Title: Plugin 2-Category
Number of entries: 5
Skip front page entries: Show all
Dateformatting: %A, %B %e %Y
Category: Parent category
Show Random Articles: No
Where should the item be displayed: Extended entry only

Re: Recent Entries Sidebar

Posted: Fri Mar 12, 2010 9:46 pm
by garvinhicking
Hi!

That's only one part, the SQL query itself should also show up?!

Regards,
Garvin