Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 02-18-2021, 07: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, 07:44 AM   #2
capink
Addict
capink knows more than wikipediacapink knows more than wikipediacapink knows more than wikipediacapink knows more than wikipediacapink knows more than wikipediacapink knows more than wikipediacapink knows more than wikipediacapink knows more than wikipediacapink knows more than wikipediacapink knows more than wikipediacapink knows more than wikipedia
 
Posts: 348
Karma: 47240
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, 08: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, 12:54 PM   #4
capink
Addict
capink knows more than wikipediacapink knows more than wikipediacapink knows more than wikipediacapink knows more than wikipediacapink knows more than wikipediacapink knows more than wikipediacapink knows more than wikipediacapink knows more than wikipediacapink knows more than wikipediacapink knows more than wikipediacapink knows more than wikipedia
 
Posts: 348
Karma: 47240
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, 01: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, 02: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: 11,595
Karma: 54270429
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Forma, Clara HD, Nexus 7 HD, iPad Pro, 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, 03: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: 26,052
Karma: 39102633
Join Date: Aug 2009
Location: The Central Coast of California
Device: K4NT(Fixed,New Bat.), Galaxy Tab A, Kobo Aura2
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:	37
Size:	48.1 KB
ID:	185454  
theducks is offline   Reply With Quote
Old 02-18-2021, 05:56 PM   #8
BetterRed
null operator
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: 17,000
Karma: 19750012
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, 04: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, 05:05 AM   #10
BetterRed
null operator
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: 17,000
Karma: 19750012
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, 04:26 AM   #11
capink
Addict
capink knows more than wikipediacapink knows more than wikipediacapink knows more than wikipediacapink knows more than wikipediacapink knows more than wikipediacapink knows more than wikipediacapink knows more than wikipediacapink knows more than wikipediacapink knows more than wikipediacapink knows more than wikipediacapink knows more than wikipedia
 
Posts: 348
Karma: 47240
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, 05:45 AM   #12
BetterRed
null operator
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: 17,000
Karma: 19750012
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, 07: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, 08:03 AM   #14
capink
Addict
capink knows more than wikipediacapink knows more than wikipediacapink knows more than wikipediacapink knows more than wikipediacapink knows more than wikipediacapink knows more than wikipediacapink knows more than wikipediacapink knows more than wikipediacapink knows more than wikipediacapink knows more than wikipediacapink knows more than wikipedia
 
Posts: 348
Karma: 47240
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, 08: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

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 04:50 PM
Sigil not displaying book view carimbombin2020 Sigil 1 04-22-2020 09:33 PM
Genres - How do I assign a book to 2 genres? RPL Library Management 3 03-08-2018 07:37 PM
replace in book view changes view to code view cybmole Sigil 4 10-28-2012 02:20 PM
Sigil highlight Book View No Longer Shows in Code View Themus Sigil 4 10-04-2012 08:54 PM


All times are GMT -4. The time now is 09:23 AM.


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