Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 01-15-2017, 03:32 PM   #1
julegner
Junior Member
julegner began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Jan 2017
Device: Sony Reader
Calibre Content Server: change summary.html (downloadlinks)

Hi all,

I want to change the summary.html of the calibre Content Server, wich displays the list of books.

I replaced the "get" Button with
Code:
<a href="{get_url}" title="{fmt}">{fmt}</a>
        <div class="formats">{other_formats}</div>
This displays:

Code:
epub
        Other formats: MOBI, PDF
I would like to have the downloadlinks like this:

Code:
EPUB, MOBI, PDF
How can I change the html page to get this?

I found this Site:
https://manual.calibre-ebook.com/template_lang.html
but a simple {fmt:uppercase()} does not work.

Looks like I got something wrong.
julegner is offline   Reply With Quote
Old 01-15-2017, 10:10 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,342
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You cannot web page templates dont support the calibre template language.
kovidgoyal is offline   Reply With Quote
Advert
Old 01-16-2017, 05:43 PM   #3
julegner
Junior Member
julegner began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Jan 2017
Device: Sony Reader
Kovid, thank you very much. That helped a lot - I was running in a totally wrong direction.

Finally, I found an other way and have a working solution.
This Solution is not good for everyone, because it does not work for all possible formats.

I added three custom columns (calculation from other columns):
Code:
epublinktext {formats:contains(EPUB,EPUB,)}
mobilinktext {formats:contains(MOBI,MOBI,)}
pdflinktext {formats:contains(PDF,PDF,)}
These column show the formatname, but only if the format is available.

Then I put this code into the summary.html instead of the "get"-button:
Code:
<a href="/get/epub/{title} - {authors}_{id}.epub">{#epublinktext}</a>
<a href="/get/mobi/{title} - {authors}_{id}.mobi">{#mobilinktext}</a>
<a href="/get/pdf/{title} - {authors}_{id}.pdf">{#pdflinktext}</a>
There are the downloadlinks for EPUB, MOBI and PDF. Because the "linktext"-fields ae only filled when the format is available, the links are only clickable if the format is available. Otherwise the links are in the html code, but not viewable in the browser.

This is working from the local network and from the internet per reverse proxy.

complete summary.html:
Code:
<div id="summary_{id}" class="summary">
    <div class="left">
        <a href="{get_url}" class="summary_thumb" title="Click to read {title} in $
        <img alt="Cover of {title}" src="{prefix}/get/thumb_90_120/{id}" /></a>
<div>
<a href="/get/epub/{title} - {authors}_{id}.epub">{#epublinktext}</a>
<a href="/get/mobi/{title} - {authors}_{id}.mobi">{#mobilinktext}</a>
<a href="/get/pdf/{title} - {authors}_{id}.pdf">{#pdflinktext}</a>
</div>
    </div>
    <div class="right">
        <div class="stars">
            <strong>{id}</strong>
            <span class="rating_container">{stars}</span>
            <span class="series">{series}</span>
            <a href="#" onclick="show_details(this); return false;" title="{detail$
            <a href="{prefix}/browse/book/{id}" title="{permalink_tt}">{permalink}$
        </div>
        <div class="title"><strong>{title}</strong></div>
        <div class="authors">{authors}</div>
        <strong>Languages:</strong> {languages}
        <div class="tags">{tags}</div>
        <div class="comments">{comments}</div>
    </div>
    <div class="details-href" title="{details_href}" style="display:none"></div>
</div>
julegner is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
A little change in functionality (content server) windigo Development 2 03-11-2015 04:02 PM
Calibre Content Server - change port - Windows Firewall Settings rl77 Calibre 2 02-19-2014 02:15 PM
Change Browsing by: Series display for calibre content server lynncal Calibre 2 04-22-2013 01:56 AM
500 Internal Server Error accessing content server Calibre 0.8.8 DaddyO57 Calibre 1 07-20-2012 06:08 PM
Calibre Recipe HTML content differs from raw html of index.html. krunk Calibre 4 09-20-2010 09:48 PM


All times are GMT -4. The time now is 10:04 PM.


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