Direct link to file or external link

Started by library_addict, 12 June 2014, 13:14:46

Previous topic - Next topic
A financial contribution is greatly appreciated as a support, to help us to keep live the project.
If you like this project you can donate some piece of BitCoin to this address: bc1qy5tgq6tvrckac2a57unxvqcnxamrvhduve9sj9

library_addict

Hello!

So I can already directly link a book to its file as stated here:
http://forum.voxpopulix.org/supporto-%28support%29/direct-link-to-a-book/msg1984/#msg1984

But what I need is: if a book has a file, clicking on its name will direct me to the file. if it doesn't have a file but has a link, clicking on the book's name will direct me to the link. if it does not have both, there will be no link.

A financial contribution is greatly appreciated as a support, to help us to keep live the project.
If you like this project you can donate some piece of BitCoin to this address: bc1qy5tgq6tvrckac2a57unxvqcnxamrvhduve9sj9

federica

Hi library_addict,
I understand. Would you like this behavior in the category view?
Al mondo ci sono 10 tipi di persone, quelli che hanno capito il codice binario e quelli che non l'hanno capito.
Informatizzati [url="https://informatizzati.org"]https://informatizzati.org[/url]
Stacca la spina [url="https://disconnessi.org"]https://disconnessi.org[/url]

library_addict

yes. also in the search results. thank you!

federica

You have to modify two files:

your_site/components/com_abook/views/category/tmpl/default_items.php line 87
from:
<?php $linkbook=JRoute::_(AbookHelperRoute::getBookRoute($item->slug$item->slugcat));?>

to:
<?php $linkbook=$item->image;?>


your_site/components/com_abook/views/search/tmpl/default_items.php line 40
from:
<?php $linkbook=JRoute::_(AbookHelperRoute::getBookRoute($item->slug$item->slugcat));?>
to:
<?php $linkbook=$item->image;?>
Al mondo ci sono 10 tipi di persone, quelli che hanno capito il codice binario e quelli che non l'hanno capito.
Informatizzati [url="https://informatizzati.org"]https://informatizzati.org[/url]
Stacca la spina [url="https://disconnessi.org"]https://disconnessi.org[/url]

A financial contribution is greatly appreciated as a support, to help us to keep live the project.
If you like this project you can donate some piece of BitCoin to this address: bc1qy5tgq6tvrckac2a57unxvqcnxamrvhduve9sj9