Author Topic: Book image thumbnail with URL on item page view  (Read 957 times)

Offline miguelcorreia

  • Coccinella
  • *
  • Posts: 23
  • Karma: +0/-0
Book image thumbnail with URL on item page view
« on: 21 June 2016, 18:20:48 »
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,



Offline federica

  • Amministratore
  • Delfino
  • *****
  • Posts: 1.033
  • Karma: +1/-0
Re: Book image thumbnail with URL on item page view
« Reply #1 on: 25 June 2016, 16:03:20 »
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.
http://www.antivirushelp.it
stacca la spina!

Offline miguelcorreia

  • Coccinella
  • *
  • Posts: 23
  • Karma: +0/-0
Re: Book image thumbnail with URL on item page view
« Reply #2 on: 25 June 2016, 16:12:40 »
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)

Offline federica

  • Amministratore
  • Delfino
  • *****
  • Posts: 1.033
  • Karma: +1/-0
Re: Book image thumbnail with URL on item page view
« Reply #3 on: 14 July 2016, 10:17:54 »
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:
Code: [Select]
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:
Code: [Select]
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.
http://www.antivirushelp.it
stacca la spina!

Offline miguelcorreia

  • Coccinella
  • *
  • Posts: 23
  • Karma: +0/-0
Re: Book image thumbnail with URL on item page view
« Reply #4 on: 01 August 2016, 18:02:06 »
Thanks Federica. Works like a charm :)