Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 02-18-2021, 06:08 AM   #1
norolim
Member
norolim began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Feb 2021
Device: none
Question Displaying genres and subgenres in manin view

Hi. I'm a new user here, so hello everyone.

I've searched the internet for an answer, but failed to find anything, so here is my problem. I used this guide, to create a Genre column with hierarchical genre structure. This worked fine, bu I also wanted to display the genres and subgenres in the Genre column in the main view. Unfortunately, since the hierarchy is created using the A.B.C syntax, Calibre displays the genres in the column as exactly that: A.B.C.

Is there a way to force Calibre to display genres and subgenres separately? I'm using Calibre 3.48, as I'm on Win7.
norolim is offline   Reply With Quote
Old 02-18-2021, 06:44 AM   #2
capink
Wizard
capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.
 
Posts: 1,190
Karma: 1988646
Join Date: Aug 2015
Device: Kindle
Here is a note from the link you provided:

Quote:
Note:

Hierarchical display only works if the Tag browser is set to sort items by name. This is the default and can be checked by clicking the Configure button at the bottom of the Tag browser.
That was my stumbling block when I first attempted to do it. You configure this by clicking the configure button at the bottom of the tag browser.
capink is offline   Reply With Quote
Advert
Old 02-18-2021, 07:07 AM   #3
norolim
Member
norolim began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Feb 2021
Device: none
Quote:
Originally Posted by capink View Post
Here is a note from the link you provided:



That was my stumbling block when I first attempted to do it. You configure this by clicking the configure button at the bottom of the tag browser.
Could you please elaborate? I don't seem to have any settings for that under that particular button. Please mind, I'm trying to change the display of subgenres in the main window, not the tab browser.
norolim is offline   Reply With Quote
Old 02-18-2021, 11:54 AM   #4
capink
Wizard
capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.
 
Posts: 1,190
Karma: 1988646
Join Date: Aug 2015
Device: Kindle
Tag browser not tab browser. Right at the bottom. This is the only place you can show hierarchies.
capink is offline   Reply With Quote
Old 02-18-2021, 12:12 PM   #5
norolim
Member
norolim began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Feb 2021
Device: none
Yeah, that was a typo, I couldn't correct, 'cause I can't edit posts.

Let me explain, what I mean in more detail. Following the guide, I created a custom Genre column and added it to Categories with hierarchical items. Then I populated metadata with genres and subgenres, such as:
  • Speculative fiction.Sci-fi.Steampunk
  • Speculative fiction.Sci-fi.Cyberpunk
  • etc.
This created a nice hierarchical tree in the tag browser, but since I created a column called Genre, I also wanted to display it in the main view of Calibre (where the books are listed). I was hoping Calibre would be able to separate the various genres and subgenres as it does in the tag browser. Instead it just listed the items the way, I typed them into metadata. So a steampunk book, would have Speculative fiction.Sci-fi.Steampunk as its genre. My question is, whether it is possible to display the hierarchical item separated in the column.
norolim is offline   Reply With Quote
Advert
Old 02-18-2021, 01:06 PM   #6
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 45,338
Karma: 168808725
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by norolim View Post
Yeah, that was a typo, I couldn't correct, 'cause I can't edit posts.

Let me explain, what I mean in more detail. Following the guide, I created a custom Genre column and added it to Categories with hierarchical items. Then I populated metadata with genres and subgenres, such as:
  • Speculative fiction.Sci-fi.Steampunk
  • Speculative fiction.Sci-fi.Cyberpunk
  • etc.
This created a nice hierarchical tree in the tag browser, but since I created a column called Genre, I also wanted to display it in the main view of Calibre (where the books are listed). I was hoping Calibre would be able to separate the various genres and subgenres as it does in the tag browser. Instead it just listed the items the way, I typed them into metadata. So a steampunk book, would have Speculative fiction.Sci-fi.Steampunk as its genre. My question is, whether it is possible to display the hierarchical item separated in the column.
AFAIK, the answer is no. The tag browser is the only place to see hierarchies.
DNSB is offline   Reply With Quote
Old 02-18-2021, 02:13 PM   #7
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 30,939
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by DNSB View Post
AFAIK, the answer is no. The tag browser is the only place to see hierarchies.
Series (and others) also as main.sub
Attached Thumbnails
Click image for larger version

Name:	Heirarchial.JPG
Views:	130
Size:	48.1 KB
ID:	185454  
theducks is offline   Reply With Quote
Old 02-18-2021, 04:56 PM   #8
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,660
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
The dotted representation of a hierarchical column can be shown in the Book List as A.B.C

The elements of such a column can be extracted in a template via the subitems function and loaded into a composite custom column. See Using functions in templates - Single Function Mode

BR
BetterRed is offline   Reply With Quote
Old 02-19-2021, 03:44 AM   #9
norolim
Member
norolim began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Feb 2021
Device: none
Thanks for all the help. Unfortunately, I don't really have time to learn the templates language, so this will not help me. I guess I'll have do, what I need, using tags.
norolim is offline   Reply With Quote
Old 02-19-2021, 04:05 AM   #10
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,660
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by norolim View Post
Thanks for all the help. Unfortunately, I don't really have time to learn the templates language, so this will not help me. I guess I'll have do, what I need, using tags.
Wait a bit and one of the detail guys should chime in and provide the step-by-step details.

If they don't I'll give 'em a nudge in the morning (my time).

BR
BetterRed is offline   Reply With Quote
Old 02-20-2021, 03:26 AM   #11
capink
Wizard
capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.
 
Posts: 1,190
Karma: 1988646
Join Date: Aug 2015
Device: Kindle
It is not clear what wanted here. Hierarchies cannot be displayed in list view.

If all you want is to separate or unpack the hierarchical genres into separate items, the solution would be a custom column with a template to replace the dot with ', '. You can use the following template to achieve this:

Code:
{#genre:'re($,'\.',', ')'}
capink is offline   Reply With Quote
Old 02-20-2021, 04:45 AM   #12
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,660
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
@norolim - I seem to have misunderstood what you want.

I thought you wanted a separate column named Genre containing the first subitem of your hierarchical Tags in the book list - probably because the dotted strings Speculative Fiction.Sci-fi.Steampunk etc take up too much horizontal space.

capink is right, you cannot a show a taxonomy as a hierarchical tree in the book list.

BR
BetterRed is offline   Reply With Quote
Old 02-20-2021, 06:13 AM   #13
norolim
Member
norolim began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Feb 2021
Device: none
Quote:
Originally Posted by capink View Post
It is not clear what wanted here. Hierarchies cannot be displayed in list view.

If all you want is to separate or unpack the hierarchical genres into separate items, the solution would be a custom column with a template to replace the dot with ', '. You can use the following template to achieve this:

Code:
{#genre:'re($,'\.',', ')'}
That is, what I needed. No tree, just items separated by comas. Thank you very much.

Now, would it be possible to get rid of duplicates in some way? If a book has the following metadata:

Code:
Speculative fiction.Science fiction.Steampunk, Speculative fiction.Fantasy
Your template will return:
Code:
Speculative fiction, Science fiction, Steampunk, Speculative fiction, Fantasy
Is there a way to remove duplicates in such situations?
norolim is offline   Reply With Quote
Old 02-20-2021, 07:03 AM   #14
capink
Wizard
capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.
 
Posts: 1,190
Karma: 1988646
Join Date: Aug 2015
Device: Kindle
Code:
program:
    genre = '';
    for item in '#genre':
        l = re(item, '\.', ',');
        for subitem in l:
            res = str_in_list(genre, ', ', subitem, subitem, '');
            if res == '' then
                genre = strcat(genre, ', ', subitem)
            fi
        rof
    rof;
    re(genre, '^[, ]+', '')
capink is offline   Reply With Quote
Old 02-20-2021, 07:39 AM   #15
norolim
Member
norolim began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Feb 2021
Device: none
Quote:
Originally Posted by capink View Post
Code:
program:
Thank you @capink. Unfortunately, I have now idea how to use this code.
norolim is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a tweak for genres and tags to view all child items by default? Whallup Library Management 0 07-16-2020 03:50 PM
Sigil not displaying book view carimbombin2020 Sigil 1 04-22-2020 08:33 PM
Genres - How do I assign a book to 2 genres? RPL Library Management 3 03-08-2018 06:37 PM
replace in book view changes view to code view cybmole Sigil 4 10-28-2012 01:20 PM
Sigil highlight Book View No Longer Shows in Code View Themus Sigil 4 10-04-2012 07:54 PM


All times are GMT -4. The time now is 05:30 AM.


MobileRead.com is a privately owned, operated and funded community.