Page 1 of 2
Building Web Page

Posted:
Thu Jan 28, 2010 2:56 pm
by butchseaman
Is there some kind of documentation about how to build a web page using Xataface?
I mean putting the index and other pages in xataface/database and managing things through xataface.
Thanks
Butch
Re: Building Web Page

Posted:
Thu Jan 28, 2010 3:08 pm
by shannah
I don't think I have created any specific documentation on this, but you might want to check out the webpage module.
http://weblite.ca/svn/dataface/modules/ ... readme.txtI have been working on a new CMS that accomplishes a similar thing but is more refined and powerful, but this module should give you some good pointers.
Re: Building Web Page

Posted:
Fri Jan 29, 2010 10:39 am
by butchseaman
I think I understand... but maybe do you have a demo of this module in operation. The portion I am wrestling with is point 2 in the installation:
2. Copy the n1_pages directory into your application's tables directory.
Thanks
Butch
Re: Building Web Page

Posted:
Fri Jan 29, 2010 10:42 am
by shannah
Basically this module just includes a single table definition for a table named "n1_pages". It also includes the configuration directory for this table. This directory is named "n1_pages" after the table name, and like all table configuration directories, it goes inside the 'tables' directory of your application. It is just as if you created a table yourself for your application and set up the configuration for it in a fields.ini file etc....
-Steve
Re: Building Web Page

Posted:
Fri Jan 29, 2010 11:22 am
by butchseaman
ok... maybe it the browsing portion I am having the problem with.
if my page is located at
http://localhost/ipsg/test_pagehow would that relate to
index.php?-table=n1_pages&-action=page&page_path=%%page_path%%
Re: Building Web Page

Posted:
Fri Jan 29, 2010 11:27 am
by shannah
index.php?-table=n1_pages&-action=page&page_path=/ipsg/test_page
if your app was located a
http://localhost/or
index.php?-table=n1_pages&-action=page&page_path=/test_page
if your app was located at
http://localhost/ipsgYou see the page_path parameter is just specifying a find on the page_path field of the n1_pages table. So it matches whatever you put in the "path" field of your record.
I would use this module as a learning tool only. Once you see how it's done (there really isn't much to it), it isn't hard to set up your own thing that fits into how you want your app to work. Essentially you just need an htmlarea field and a custom template. The rest is all book-keeping.
Re: Building Web Page

Posted:
Fri Jan 29, 2010 11:57 am
by butchseaman
ok... well then i was navigating to the correct place...
this is the error
Fatal error: No template found for action 'page'.On line 48 of file F:\PortableApps\xampp\htdocs\xataface\actions\default.php in function printStackTrace()
On line 1114 of file F:\PortableApps\xampp\htdocs\xataface\Dataface\Application.php in function handle(array(array(page,page)))
On line 1594 of file F:\PortableApps\xampp\htdocs\xataface\Dataface\Application.php in function handleRequest()
On line 5 of file F:\PortableApps\xampp\htdocs\ipsg\index.php in function display()
in F:\PortableApps\xampp\htdocs\xataface\actions\default.php on line 48
Re: Building Web Page

Posted:
Fri Jan 29, 2010 12:02 pm
by shannah
What URL produced that error?
Re: Building Web Page

Posted:
Fri Jan 29, 2010 12:13 pm
by butchseaman
Re: Building Web Page

Posted:
Fri Jan 29, 2010 12:16 pm
by shannah
The page action should be defined in the n1_pages directory. Did you add the n1_pages directory into the tables directory of your application?
(i.e. you should have tables/n1_pages/actions/page.php)
Re: Building Web Page

Posted:
Fri Jan 29, 2010 12:23 pm
by butchseaman
ok... this is what I am not understanding for some reason...
I have:
tables > n1_pages > fields.ini
I am not understanding the syntax of what it would look like
(i.e. you should have tables/n1_pages/actions/page.php)
is this in a file called n1_pages or an entry into the ini and if so can you give me idea of what the syntax would be
Re: Building Web Page

Posted:
Fri Jan 29, 2010 12:44 pm
by shannah
You need this entire directory.
http://weblite.ca/svn/dataface/modules/ ... /n1_pages/Not just the fields.ini file.
Copy this directory so you'll have:
tables/n1_pages/
in your application.
This directory includes the fields.ini file, actions, templates, and all the other stuff that is used.
Re: Building Web Page

Posted:
Fri Jan 29, 2010 1:25 pm
by butchseaman
ok... I got them working.. thank you for your patience. I am not sure what i missed or how i missed it... but with out you sending the directory structure I don't think I would have ever figured this out.
Now just so I am clear... this same directory structure and content would be used for each page if I understand correctly... with the different names for the pages of course
Butch
Re: Building Web Page

Posted:
Fri Jan 29, 2010 1:46 pm
by shannah
I'm not sure I understand the question. You can store unlimited webpages with this setup. Each webpage is a record of this table.
(Note that the .htaccess portion is very helpful for making the URLs look nice).
This module is a good sample for learning as it demonstrates such concepts as custom actions, templates, .htaccess (mod_rewrite), and delegate classes. If you understand how and why everything works in this, it will be quite easy to roll your own CMS that works exactly the way you like.
Re: Building Web Page

Posted:
Fri Jan 29, 2010 2:36 pm
by butchseaman
Yes... I see what you are talking about. I think I just need to spend a little time working with this... but you did a great job once again...