Page 1 of 1

Ajax implementation

PostPosted: Fri May 16, 2008 8:21 am
by innocuous
Hi,
How difficult or easy will it be to add Ajax features to the Webauction script?
I would also like to add scrolling clickable category list on bottom, a "HOT ITEMS" tab, best Sellers tab etc.

Can these features be added to the script? Can anyone help me?

I want a look similar to this commercial auction script
http://www.ajauctionpro.com/auction_web2.0/index.php

Is it easily possible or will it require major mod?
Thanks

PostPosted: Fri May 16, 2008 8:49 am
by shannah
This stuff is not hard to add. And adding ajax/javascript is not hard. The script that you refer to probably doesn't use AJAX. Just javascript, to do the scrolling - but no ajax.

The key to adding content to web auction is by implementing blocks in the delegate class.

See http://xataface.com/documentation/tutor ... ustomizing

for information about blocks and how they can be implemented.
Note that you can implement them in the application delegate class or the table delegate class. For this app you'll probably just stick to the application delegate class.

Let me know if you want more clarification.

-Steve

further clarification

PostPosted: Sat May 17, 2008 9:51 am
by innocuous
Hi Steve,
Can you please further clarify on the blocks part. I am getting an idea but need help with it.
For example, how can I add a HOT ITEMS tab or block to be displayed on the home page? This will further require a mod when adding new products we need a checkbox "add to hot items"
How do I go about this? If you can guide me on this, it will give me a good idea.
Thanks

PostPosted: Mon May 19, 2008 11:54 am
by shannah
Can you please further clarify on the blocks part.


The application delegate class is located at conf/ApplicationDelegate.php . You can implement methods of the form:

block__%blockname%

where %blockname% is a prescribed name of a block that you wish to fill
such that anything printed in these methods will be displayed in place of the block in the template.

For example there is a block named 'after_result_list' that is located immediately following the list of products. You could place your own content here (like a featured items section) by implementing the block__after_result_list() method:

Code: Select all
function block__after_result_list(){

    echo 'This is only a test';
}



Now if you load your auction you should see the text 'This is only a test' directly after the list of products.

Now if you want to see what blocks are available to be filled, you can enable debug mode by adding the following to the beginning of the conf.ini file:

Code: Select all
debug=1


Then if you reload the auction page you'll see a whole bunch of extra text on the screen. These are the names of the available blocks and their locations.

Hopefully this is enough to get you started.

-Steve

Thanks

PostPosted: Tue May 20, 2008 12:33 am
by innocuous
Thanks Steve,
I'll try it out!