PDA

View Full Version : Moving the "add to the comparison table" next to the listing title



Riba
October 15, 2012, 09:48 AM
I am using the compare plugin and would like to move the "add to the comparison table" button from the listing details next to the listing title where it should be (along the "add to favorites" and RSS icons).

This means I had to move {rlHook name='listingDetailsPreFields'} from listing_details.tpl to content.tpl. However now I need to prevent it from displaying unless the listing detail is being displayed. I guess something like this should do the trick:

{if $pageInfo.Key == 'view_details'}
{rlHook name='listingDetailsPreFields'}
{/if}

...but this is not the right page key I need to use. Any hints or tips? Thanks!

Riba
October 15, 2012, 10:06 AM
It seems it is not that simple because the info is missing to identify the listing info if moved to content.tpl. More digging will be needed...

Riba
October 15, 2012, 10:10 AM
Just realized, the proper way would probably be to hook the compare button to pageNavIcons hook rather than listingDetailsPreFields one.

Mike
October 16, 2012, 06:46 AM
Hello,


Better not move any hooks to different places. Also it will not work with just changing name of hook as its different places and should be adapted.
Easiest way is to add entry to the navIcons array in php and disable existing compare icon

open includes/contollers/listing_details.inc.php

find code and do the same for the compare button



/* display add to favourite icon */
$navIcons[] = '<a title="'. $lang['add_to_favorites'] .'" id="fav_'. $listing_data['ID'] .'" class="icon add_favorite" href="javascript:void(0)"> <span></span> </a>';



then you have to deactivate listingDetailsPreFields hook

run following sql query or change status of hook to approval through the phpmyadmin



UPDATE `{sql_prefix}hooks` SET `Status` = 'approval' WHERE `Name` = 'listingDetailsPreFields' AND `Plugin` = 'compare'

Riba
October 16, 2012, 07:54 AM
Hello Mike and many thanks for getting me on the right track!

Riba
October 16, 2012, 11:39 AM
Huh, I have put everything as it was for the moment, but it looks like I #$%" something up. If I add the listing to the comparison table (from the listing details) the info is there except for the listing title which is "null". :( Works fine from other areas.

Riba
October 16, 2012, 11:32 PM
To answer myself, and it may be helpful for the others. As I was weeding out all the table based layouts, including the one from listing_details.tpl, i removed the td with class "content". The comparison plugin is expecting the div with the "content" class along with the td with the "content" class, and is looking for the string within h1 tags. As I removed the td, it was unable to find it. I modified the plugin javascript, so be warned when modifying the template. :)

Mike
October 17, 2012, 09:26 AM
Great that you sorted it out ). Yes there are lot of relations between html class names, ids and javascript code

Riba
October 17, 2012, 04:31 PM
Got that...thinking that there must be a better way to collect the needed info, this way one can break the javascript by modifying the template.

Abraham Adeyemi
May 7, 2015, 12:24 PM
How do I put it on a featured listings box on my homepage please?

Viktor
May 8, 2015, 03:26 AM
Hello Abraham,

You can try to use Listing Box plugin for it. Install and add new box through plugin.

Abraham Adeyemi
May 8, 2015, 03:31 AM
I already have it on the featured carousel but there are a few bugs with it that need fixing and I was wondering if you could help me with those...
Screenshots below should explain what I mean...

http://avidautos.info/13.png

http://avidautos.info/14.png[/QUOTE]

Viktor
May 8, 2015, 04:00 AM
Hello Abraham,

It happened because you changed structure in your template I think. If you want I can solve on your site. if you agree of course :)

Abraham Adeyemi
May 8, 2015, 04:02 AM
Yes no problem will you need ftp access?

Abraham Adeyemi
May 8, 2015, 04:03 AM
and will it take long to fix or is it an easy job to do?

Thanks by the way :)

Abraham Adeyemi
May 8, 2015, 08:08 AM
So do you need it?? :)

Viktor
May 8, 2015, 10:39 AM
Hello Abraham,

I have fixed it. Problem was in different structure of html. That's why javascript couldn't take listings. Please check it again.

Abraham Adeyemi
May 8, 2015, 11:28 AM
I can't begin to thank you enough man you are a life saver!! Thank you so much I really appreciate it! :D

Abraham Adeyemi
May 10, 2015, 01:33 AM
After all that I've now got an issue with the favorite ads button on my site :P

Would you be able to have a look at it when you get the chance please?

Thanks

Viktor
May 12, 2015, 03:54 AM
Hello Abraham,

I have changed styles and code for better view of listing carousel plugin. Please check it. Also clear your PM folder because I cannot send you PM because you exceed your limit.

Abraham Adeyemi
May 12, 2015, 04:58 AM
I see what you did there and you are a lifesaver my friend thank you! :D
How many PM's are you allowed to have? I will get rid of some now....and check your because I still have a few things I need to sort with you.

Thanks once again man :D

Abraham Adeyemi
May 12, 2015, 08:18 AM
Check your mail* :P