Book image thumbnail with URL on item page view

Started by miguelcorreia, 21 June 2016, 18:20:48

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

miguelcorreia

Hi,
I'm trying to figure out how to change the way the book thumbnail works.
Instead of opening a larger image of the book cover in a new window, I would like to open it in the assigned URL of the book item.

Is this possible? If so, what and where should I change in the code?

Thanks in advance,



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 miguelcorreia,
in category view, book covers already open the book page, instead in the book view the cover opens a pupup image
Didn't you see it so as I wrote?
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]

miguelcorreia

Hi, Federica, thanks for the reply.
I know what you mean. In the category list if I click the thumbnail it goes to the book item.
What I was looking for was a way to change the behaviour of the thumbnail in the item page, so instead of opening in a pop-up it would open in an external URL (the same as used in item description or book details)

federica

I understood. You could use the external url field. You have to change the link of the image replacing it with the field external url.
Open the file /components/com_abook/site/views/book/tmpl/default.php line 86 from:
echo '<a href="'.$this->book->image.'"
                        style="cursor: pointer;" class="modal" title="'.JText::_('COM_ABOOK_COVEROF').' '.$this->book->title.'">
                        <img itemprop="image" class="img-polaroid" src="'.$this->book->image.'" alt="'.JText::_('COM_ABOOK_COVEROF').' '.$this->book->title.'" />
                        </a>';

to:
echo '<a href="'.$this->book->url.'"
                        title="'.JText::_('COM_ABOOK_COVEROF').' '.$this->book->title.'">
                        <img itemprop="image" class="img-polaroid" src="'.$this->book->image.'" alt="'.JText::_('COM_ABOOK_COVEROF').' '.$this->book->title.'" />
                        </a>';

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

miguelcorreia