AutoDirector forum

The AutoDirector support and advice forum

vehicles show

Post Reply

Page: 1

Author Post
Member
Registered: Oct 2009
Posts: 23
At the moment I have the choice of showing 5 10 or 25 cars with 5 as the default. Can I change this?

many thanks
Administrator
Registered: Apr 2008
Posts: 324
Absolutely. You simply add a pagesizes argument to the end of the AutoDirector <script> line, e.g.

<div id="autodirector"></div>
<script type="text/javascript"
src="http://mysite.com/carlist.php?site=mysite&amp;style=blue&amp;pagesizes=2,8,16"></script>

Full instructions are available in the control panel. From the 'sites' screen, click the integration options icon, then choose "set the page sizes" under advanced integration.
_______________
AutoDirector administrator
Member
Registered: Oct 2009
Posts: 23
Thanks for that. Just one more thing, Is it possible to have the vehicles listed by date added so the latest additions are at the top?
Member
Registered: Apr 2008
Posts: 67
this may not be ideal, and it involves hacking the code in clients/carlist.js

look for the section like this -

  // sort by highest first
sortTypes[st++] = { name: "price, highest first", sort: function(a, b) { return SortCars(a.price, b.price, -1); } };
sortTypes[st++] = { name: "price, lowest first", sort: function(a, b) { return SortCars(a.price, b.price, 1); } };


I GUESS changing it to this would work

  // sort by highest first
sortTypes[st++] = { name: "newest first", sort: function(a, b) { return SortCars(a.lastupdate, b.lastupdate, -1); } };
sortTypes[st++] = { name: "oldest first", sort: function(a, b) { return SortCars(a.lastupdate, b.lastupdate, 1); } };
Administrator
Registered: Apr 2008
Posts: 324
Thanks Snizbit. That's almost correct, but ".lastupdate" should be ".id", e.g.

  // sort by highest first
sortTypes[st++] = { name: "newest first", sort: function(a, b) { return SortCars(a.id, b.id, -1); } };
sortTypes[st++] = { name: "oldest first", sort: function(a, b) { return SortCars(a.id, b.id, 1); } };

This will return the cars by date they were added. Editing a vehicle won't put it at the top of the list I'm afraid.
_______________
AutoDirector administrator
Member
Registered: Oct 2009
Posts: 23
It works! Thanks.

Post Reply

Page: 1