Page Modifications

A place to discuss and receive support for the Web Auction application.

Page Modifications

Postby indiejones » Thu Sep 15, 2011 8:15 pm

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.
indiejones
 
Posts: 2
Joined: Thu Sep 15, 2011 8:05 pm

Re: Page Modifications

Postby shannah » Fri Sep 16, 2011 10:17 am

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.

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


-Steve
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Page Modifications

Postby indiejones » Fri Sep 16, 2011 11:10 am

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.
indiejones
 
Posts: 2
Joined: Thu Sep 15, 2011 8:05 pm

Re: Page Modifications

Postby shannah » Fri Sep 16, 2011 11:38 am

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.

-Steve
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm


Return to Web Auction Discussion

Who is online

Users browsing this forum: No registered users and 20 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved