Tetrakern / fictioneer

A web fiction theme for WordPress.
https://fictioneer-theme.com
GNU General Public License v3.0
104 stars 16 forks source link

Append or Display other_title after title in chapterlist for mobile and desktop chapter navigation #31

Closed ZachDoom00 closed 5 months ago

ZachDoom00 commented 5 months ago

Current chapterlist navigation dropdown only displays title in the chapter navigation.

By convention, one would think that;

Title as Chapter number Other_title as Chapter Title

Eg:

Chapter 1 Prologue

This is based on what I've seen normally on other Wordpress novel sites.

So, I guess you could improve the chapterlist navigation dropdown displaying one, or either both?

Chapter 1: Prologue Chapter 2: XXXXX

Other improvement could be made includes, if the chapters have groupings, you could display that in the dropdowns eg:

Arc 1 (non-clickable but expandable?) Chapter 1: Prologue Chapter 2: XXXX


Arc 2 Chapter 3: XXXX Chapter 4: XXXX

Tetrakern commented 5 months ago

Hello again!

I'm not using the title as chapter number, that would be highly problematic since WP only stores the main title in the Posts database table, which is relevant for queries and search queries. Meta fields are slow. Wasting the title for "Chapter X", which is not even unique? Yeah, no.

But let's take a step back, because I still need to fully understand what you need. We are talking about this here, right? That is internally called the chapter index (because I got too many lists).

image

You got me a bit confused because there is no "other_title" meta field. So you either mean the Chapter Prefix, which is not rendered anywhere but inside the story chapter list, the List Title only used on small cards and also in the chapter index as shown above, this custom snippet with a similar issue, or something you added yourself (in which case you are on your own).

The fictioneer_get_chapter_list_items() function is due for an update, and I may be willing to add some things, perhaps a filter for customization. I'm not going to show the chapter groups, though. I'm also not changing the global chapter naming scheme and force that upon everyone else. You may want that, others do not.

I understand that everyone wants to do their own thing, but I cannot accommodate everyone. Especially not for free. But if you just want to modify the title in the index popup (and by extend mobile menu), this can be done.

For clarity:

ZachDoom00 commented 5 months ago

I meant like what the picture you gave as an example.

Alright. I will wait for next update.

Tetrakern commented 5 months ago

I meant like what the picture you gave as an example.

Alright. I will wait for next update.

I added a new filter to modify the chapter index list items and an example on how to prepend the chapter prefix. This will only work after the 5.16.0 update and not affect anything but the index (mobile menu too). You can add filters in a child theme. Modify the code if you need to, I assumed you want to use the chapter prefix (enable Advanced Meta Fields in the settings if you do not see the field).