Vox Populi(x) forum

Alexandria Book Library => Supporto (Support) => Topic started by: miguelcorreia on 21 June 2016, 18:20:48

Title: Book image thumbnail with URL on item page view
Post by: miguelcorreia 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,


Title: Re: Book image thumbnail with URL on item page view
Post by: federica 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?
Title: Re: Book image thumbnail with URL on item page view
Post by: miguelcorreia 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)
Title: Re: Book image thumbnail with URL on item page view
Post by: federica 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:
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>';

Title: Re: Book image thumbnail with URL on item page view
Post by: miguelcorreia on 01 August 2016, 18:02:06
Thanks Federica. Works like a charm :)