Page 1 of 1

Newbie question: it works but why is there no formatting?

PostPosted: Fri Aug 14, 2009 6:40 am
by dgoadby
I installed V1.1.4, checked the installation with dataface_info ok. I then created a small application which has one table in it.

I ran the app and it works except it is just plain text, no colours, no logos etc which I had expected. It appears that the default template is not being used for some reason.

I am using WampServer2.0i under windows and other php apps such as serendipity and sugar are working ok.

conf.ini file looks like this:
Code: Select all
[_database]
host = "localhost"
user = "root"
password = ""
name = "aqh"

[_tables]
Prices = "Prices"


And the bits that matter in index.php look like this:

Code: Select all
require_once 'C:\wamp\www\xataface-1.1.4\dataface-public-api.php';
df_init(__FILE__, 'http://localhost/aqh-demo');
$app =& Dataface_Application::getInstance();
$app->display();


The whole of the Xataface folder is untouched ie as unzipped.

As I am sure it works fine, what have I not done?

PostPosted: Fri Aug 14, 2009 7:15 am
by shannah
The problem is the 2nd parameter to your df_init() call. This should be an accessible URL to the Xataface directory. It can be absolute or relative. (i.e. this is not a file path - it is a URL).

PostPosted: Fri Aug 14, 2009 9:47 am
by dgoadby
Hi Shannah,

My PHP was not displayed correctly so I have now corrected it.

When I access the app then http://localhost/aqh-demo is the URL I use so I assume it works. Since the application works ie I can view and edit the table then I also assume that Xataface is working too. It's just not using the template (that's my guess anyway) for some reason.

David

PostPosted: Fri Aug 14, 2009 10:16 am
by shannah
OK... There are 2 different URLs to be concerned with here:
1. The URL to your application likely http://localhost/aqh-demo
2. The URL to the xataface directory. Maybe you have it in a subfolder of aqu-demo? This might be something like http://localhost/aqh-demo/xataface .

PostPosted: Fri Aug 14, 2009 10:27 am
by shannah
i.e.
Code: Select all
df_init(__FILE__, 'http://localhost/aqh-demo');


should be something like
Code: Select all
df_init(__FILE__, 'http://localhost/aqh-demo/xataface');

Sorted!

PostPosted: Fri Aug 14, 2009 12:16 pm
by dgoadby
Thanks Shannah

I changed the parm as below and voila!

df_init(__FILE__, 'http://localhost/xataface-1.1.4');

I reread the documentation more slowly and it describes it quite clearly. A DOH moment for me :?

Thanks again.

David