CategoryTemplate modifications

Discussion corner for Developers of Serendipity.
tpost
Regular
Posts: 77
Joined: Fri Sep 21, 2007 1:45 am

Post by tpost »

Hi judebert,

I tried upgrading to the newest version (0.26), but I experienced the same symptoms as bdconnolly.

I installed the event_advtypes plugin and then tried to configure event_categorytemplates with the new sequencing widget. Maybe I am missing something in this step? Do I have to configure event_advtypes differently?

FYI, I am using Serendipity 1.2.

I have downgraded back down to 0.24 for now.

Thanks for reading!
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

Hi, tpost. Sorry to hear you're having trouble. We can surely figure it out, but I'll need a little more information.

The advtypes plugin configuration is solely to indicate that the new configuration types are available. I assume that when you configure it, it shows you one "unused" text box, and two sequenced lists that you can drag around?

If that is the case, then the sequence widget is working. You should also see a sequenced list in the configuration for the "Properties/Templates of Categories" plugin; it controls the precedence of categories with custom templates. What order are the categories in?

Finally, a little more information on the problem itself: I assume you've got an entry with multiple categories, at least one of which is configured to use a custom template, but you're not getting the template you expect. Could you tell me what categories the entry belongs to, and what you were expecting? Does it work as expected for an entry with a single template?

We'll get to the bottom of this.
Judebert
---
Website | Wishlist | PayPal
tpost
Regular
Posts: 77
Joined: Fri Sep 21, 2007 1:45 am

Post by tpost »

Hi judebert,

Thanks for the quick response.

After installing the event_advtypes plugin, I went into event_categorytemplates and adjusted the categories in the order I wanted. So far, so good.

When I apply the changes, category pages render correctly.

Here's where things go awry:
Individual entries show the template I want, only the $category_info array information (category_name, category_description, etc) defaults to the site-wide information.

Some things I forgot to note in my initial entry:
- the entries do not belong to multiple categories
- i am also using the Start Page Category plugin as well (i don't know if this impacts your plugin, but I thought I would list that as well)
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

So the templates are working as expected, then. That's a relief!

It sounds like the problem is in the entry footer, where it says "Posted by <author> in <category> at <date-time>". What I'm hearing is that the <category> is always the one set in the Start Page Category plugin.

I don't think the Properties/Templates of Categories modifies that data; it only examines it. That makes this sound like a plugin order problem.

I'm betting the Start Page Category plugin comes after the custom template plugin. Unfortunately, I'll bet that if you move it before the custom template plugin, everything will have the start page category's template.

Give it a try, let me know. If order does change the behavior, I'll know where to start looking.
Judebert
---
Website | Wishlist | PayPal
tpost
Regular
Posts: 77
Joined: Fri Sep 21, 2007 1:45 am

Post by tpost »

Hi judebert,

Actually the entry footer is displaying the right information! :o

In my custom s9y template, I am using {$category_info.category_name} in index.tpl to display the name of the current category. Only when one is on an entry, does {$category_info} display the wrong information.

The funny thing is event_categorytemplates v0.24 works fine.

--------

I just tried moving the Start Page category plugin above event_categorytemplates and below it to see if it affects anything, and in both instances it doesn't.

Let me know what else I can do!

Thanks!
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

Ah, the .category_name bit is very informative! (There were a lot of changes from 0.24 to 0.26. This will help me narrow down the culprit!)

From that listing, I see that the place we get the appropriate category hasn't changed, so it must be in the changes to the way we picked the appropriate category.

You mentioned that it's showing the "site-wide information". What is that? Category #1's name?

You also mentioned that none of your entries were in multiple categories. I'm going to set up my sandbox to display the category_name, and see if I can duplicate your problem.
Judebert
---
Website | Wishlist | PayPal
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

Okay, I think I found it: the "Globally set entry's category" option was inadvertently removed. On attempting to re enable it, however, I see that it ONLY sets the category for entries with a custom template category.

I don't really know what it was doing; perhaps Garvin can provide some insight, and I can code it to function as expected.
Judebert
---
Website | Wishlist | PayPal
tpost
Regular
Posts: 77
Joined: Fri Sep 21, 2007 1:45 am

Post by tpost »

judebert wrote:You mentioned that it's showing the "site-wide information". What is that? Category #1's name?
Sorry judebert!

I guess I should have been more specific.
Remember I told you I was using the "Start Page Category" plugin?

Well the {$category_info} information was defaulting to the Start Page category's information.
judebert wrote:I think I found it: the "Globally set entry's category" option was inadvertently removed. On attempting to re enable it, however, I see that it ONLY sets the category for entries with a custom template category.
I'm glad I could help you pinpoint the problem a little bit!

Hopefully Garvin and yourself can figure out the last, remaining piece of the puzzle!

Thanks!
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

I think I've got it working as it used to. It's still not what I expect, but since Garvin hasn't commented here, I'll commit it as soon as I fix my other problem with it. Shouldn't be later than Wed next week.
Judebert
---
Website | Wishlist | PayPal
tpost
Regular
Posts: 77
Joined: Fri Sep 21, 2007 1:45 am

Post by tpost »

thanks judebert, you're a star!
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

As promised! I committed the changes today; they should be available immediately through CVS, or within 24 hours through SPARTACUS.
Judebert
---
Website | Wishlist | PayPal
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post by Don Chambers »

I downloaded the changes from CVS - the good news is it definitely hides the entries from rss for categories that have been defined to do that. The bad news is that the entries are NOT included again if the category is updated as no longer hidden from rss.

The value in the table does change (1 for yes, 0 for no), but it didn't seem to make a difference. I cleared the server cache (templates_c) as well as my local browser cache, so it does not appear to be a cache problem.
=Don=
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

I worked this problem with Don, and we showed that it functioned as expected on my server. He moved the plugin around in his list, which also didn't have much effect. Eventually it started working, as if by magic.

I suspect some cache somewhere.
Judebert
---
Website | Wishlist | PayPal
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post by Don Chambers »

Sorry - meant to update this yesterday. Yes, some combination of reordering event plugins or re-saving the plugins ultimately led to success. Thanks again Judebert!!!!!
=Don=
tpost
Regular
Posts: 77
Joined: Fri Sep 21, 2007 1:45 am

Post by tpost »

Hi judebert,

v0.27 works the same as v0.24 did!

Thanks for your work in fixing the error.
Post Reply