Linking Categories & Sub Categories

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
DavidC
Regular
Posts: 75
Joined: Wed May 14, 2025 7:16 pm

Linking Categories & Sub Categories

Post by DavidC »

OK, so I have a Sunday message.
(Then there's a Small Group Guide and six Daily Devotionals associated with that message.)

I've created these Categories:
Sunday Message
... then as Sub-Categories
Small Group
Daily Devotionals (six of them)

Do I need a new Parent Category for every week, and new Sub Categories for every week - so that the Subs are correctly associated with the Parent?

Thanks.
onli
Regular
Posts: 3044
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: Linking Categories & Sub Categories

Post by onli »

Why for every week? Wouldn't it be easier to have one (sub) category for each of these articles, and to re-use them in the following weeks?
DavidC
Regular
Posts: 75
Joined: Wed May 14, 2025 7:16 pm

Re: Linking Categories & Sub Categories

Post by DavidC »

I may be misunderstanding things.
When I look at the Blog I see a mix of Categories (parent) and sub-categories in no apparent order.
I use the titles to associate things - but I don't see a way to force the sub-categories to only display as links attached to the parent category.
Is this possible?
onli
Regular
Posts: 3044
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: Linking Categories & Sub Categories

Post by onli »

That already should be the default - subcategories are shown under their parent category and have some margin to their right to show their status. As in my blog:
Screenshot 2025-05-18 at 19-58-22 onli blogging.png
Screenshot 2025-05-18 at 19-58-22 onli blogging.png (17.85 KiB) Viewed 26926 times
Notice how "Linux" is below "Technikzeugs" and has some empty space to its left. The effect could be less subtle, but that sub categories are below their parents should be set. And the order of the categories apart from that can be changed in the plugin settings.

This indentation is the default setting of the category sidebar plugin. Doesn't it work, or do you search for a different kind of display?
DavidC
Regular
Posts: 75
Joined: Wed May 14, 2025 7:16 pm

Re: Linking Categories & Sub Categories

Post by DavidC »

OK, yes, mine looks similar.

Problem: When a user clicks on Sunday Message - they see all of my posts.

When they click on Daily Devotional - they only see the latest Daily Devotional entry.

I think I'm using the Categories correctly e.g. the following. (Why would a Small Group Guide sub-category show up when the user chooses the Sunday Message category?

Title
Why does God care? (Week 1 of 4) - Small Group Guide
Categories Small Group Guide
onli
Regular
Posts: 3044
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: Linking Categories & Sub Categories

Post by onli »

It's supposed to work like that: If a parent category is shown, you get all articles from it plus the articles from all sub categories. Then the sub categories do not show articles from their parent category. So in my case, "Technikzeugs" (=technical stuff) also shows articles from the "Linux" category.

So in your case, "Daily Devotional" should be the parent category and "Sunday Message" a subcategory. It's already like that, but the parent category does not show articles from the subcategory?
DavidC
Regular
Posts: 75
Joined: Wed May 14, 2025 7:16 pm

Re: Linking Categories & Sub Categories

Post by DavidC »

When I click on Category - Sunday Message, everything shows - Sunday Messages, Small Group Guide, etc. (I would expect it to only show posts with the Category - Sunday Message associated with them.)
When I click on the specific Sunday Message I want - only it shows - but when I click on Daily Devotional on the right column it shows the Daily Devotional that matches it, plus the daily Devotional from the prior week's Sunday Message.
onli
Regular
Posts: 3044
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: Linking Categories & Sub Categories

Post by onli »

Could you show a screenshot of the category menu in the backend?
DavidC
Regular
Posts: 75
Joined: Wed May 14, 2025 7:16 pm

Re: Linking Categories & Sub Categories

Post by DavidC »

Is this the correct screenshot?
categories-1.jpg
categories-1.jpg (25.02 KiB) Viewed 26891 times
onli
Regular
Posts: 3044
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: Linking Categories & Sub Categories

Post by onli »

(Yes, it's the screenshot I needed, thanks :) )

Okay, then I think this works as expected. If you open "Sunday messages" you will see all entries, so Children's Messages, Daily Devotionals etc. If you open the archive overview of Daily Devotionals you should only see articles from that exact category.
DavidC wrote: Sun May 18, 2025 11:48 pm When I click on the specific Sunday Message I want - only it shows - but when I click on Daily Devotional on the right column it shows the Daily Devotional that matches it, plus the daily Devotional from the prior week's Sunday Message.
This is not further separated by date. You can't have a structure where you have categories for each week. Or you can, but you'd have to create new categories every week. The idea here is rather to see all articles in "Daily Devotional", ordered by date, from now to the beginning.

Everything can be changed of course, but the separation by week structure I think you want would need core modifications or at least a very clever plugin, I think.

Maybe the freetag plugin is a better approach here, with indeed a new tag for each week? But every structure growing indefinitely does not sound like a good solution to me.
DavidC
Regular
Posts: 75
Joined: Wed May 14, 2025 7:16 pm

Re: Linking Categories & Sub Categories

Post by DavidC »

OK. Hmmm.

Would it be possible to 'archive' each week's group of posts - making them accessible from the right column?

Late on Saturday, each week, I'd move the prior week's Sunday Message and all associated sub-categories to the 'archive' - then post the new week?

Users could then choose to select one of the grouped prior week's posts (separated by a date and/or title) but not be confused by everything all mixed together on the main blog page?
onli
Regular
Posts: 3044
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: Linking Categories & Sub Categories

Post by onli »

Do you post all entries at once? Then you could set the frontpage limit to the number of entries you need and only have one week visible.

For archiving: There is serendipity_event_outdate_entries which might go somewhat in the direction (archive everything older than a week?), but it would make the entries hidden completely I think.

I don't know of a plugin or core functionality that gets you the exact functionality you want here. I assume it would have to be written :/
DavidC
Regular
Posts: 75
Joined: Wed May 14, 2025 7:16 pm

Re: Linking Categories & Sub Categories

Post by DavidC »

For archiving: There is serendipity_event_outdate_entries which might go somewhat in the direction (archive everything older than a week?), but it would make the entries hidden completely I think.
How does one view the archives, please?

Perhaps a small edit to place an Archives button in the right column, along with a little text to explain what's there (e.g. "Click here to view previous posts")?
DavidC
Regular
Posts: 75
Joined: Wed May 14, 2025 7:16 pm

Re: Linking Categories & Sub Categories

Post by DavidC »

I just did this ...
archives-1.jpg
archives-1.jpg (32.04 KiB) Viewed 26864 times
QUESTION: Why did it jump out so far ahead, rather than defaulting to the most recent, please?
DavidC
Regular
Posts: 75
Joined: Wed May 14, 2025 7:16 pm

Re: Linking Categories & Sub Categories

Post by DavidC »

Here are my Archives settings ...
archives-2.jpg
archives-2.jpg (35.37 KiB) Viewed 26862 times
Post Reply