Page 1 of 1

Page Modifications

PostPosted: Thu Sep 15, 2011 8:15 pm
by indiejones
This may be a little idiotic, however I am new to this and need help with a simple question.
I have noticed that the product page uses a title beginning with "Current Record:" then the product_name.
in the templates/view_Product.html I was able to successfully find a rem-ed out line for this.

My question is, where the heck is the actual code line with the "Current Record:" in it??
I have looked in Dataface_main_template.html, and most every other html page in the site.

I will be adding a Lot number to the database and want to include it in the items title line. that I can do, provided you can help me with what file and path it is located in.

thx in advance.

Re: Page Modifications

PostPosted: Fri Sep 16, 2011 10:17 am
by shannah
Best way is to implement the getTitle() method of the products delegate class to return whatever title you want it to have. I don't think a getTitle() method is defined in webauction by default so Xataface just uses the first varchar field in the products table currently. You can implement it to do whatever you like though.

Code: Select all
function getTitle($record){
    return $record->display('product_name').' Lot# '.$record->display('lot_number');


Re: Page Modifications

PostPosted: Fri Sep 16, 2011 11:10 am
by indiejones
Thx Steve... your answer led me to exactly where I needed to go.

For others who may be looking to do so the title line is in dataface\Dataface\templates\Dataface_Record_Template.html.

Here is where I can change the header size, class, and the call to getTitle.

Re: Page Modifications

PostPosted: Fri Sep 16, 2011 11:38 am
by shannah
I don't recommend making too many (or any) changes to the Xataface (i.e. anything inside the dataface directory) templates themselves. Xataface is designed to allow you do override most things in your own code or delegate classes. If you want to override a Xataface template, it is a good idea to first copy it into the application's (i.e. webauction's) templates directory and make changes from there. (Templates of the same name in Web Auction will override the one in Xataface). That will allow for updates to Xataface much more easily -without losing any of your customizations.

This particular change could have been achieved likely with a couple of CSS rules and by implementing the getTitle() method in the products delegate class.