Making a web page the home page

A place for users and developers of the Xataface to discuss and receive support.

Making a web page the home page

Postby njw » Wed Aug 06, 2008 7:42 am

I have set up a simple web page to act as a Home page for a project. This displays fine if I enter the URL. I would like to have a menu tab for the Home page, so I thought that I could add a function to ApplicationDelegate.php to replace the tables menu head block in Dataface_Nav_Menu.html.

I have tried to add a "Home" tab to the beginning of the code, but am getting an error when I try to access the project:

Parse error: syntax error, unexpected '<' in /home/archomai/public_html/alcreg/conf/ApplicationDelegate.php on line 25

Apologies for my lack of php, but can anyone see what I've got wrong?

Code: Select all
function block__tables_menu_head(){
        <li><a href="qwerty.co.uk/asdfg/HomePage"
                           accesskey="accesskeys-navigation"
                           class="table-selection-tab"
                           title="Home"
                           id="TableLink_Home">
                           
                           
                                  Home
                           
                        </a></li>
   {foreach from=$ENV.APPLICATION._tables item=label key=table}
   <li {if $ENV.table==$table}class="selected"{/if}><a href="{$ENV.DATAFACE_SITE_HREF}?-table={$table}"
                           accesskey="accesskeys-navigation"
                           class="table-selection-tab {if $ENV.table==$table}selected{/if}"
                           title="{$label}"
                           id="TableLink_{$table}">
                           
                           
                                  {$label}
                           
                        </a></li>
   {/foreach}
    }


Many thanks

Neil
njw
 
Posts: 280
Joined: Wed Dec 31, 1969 5:00 pm

Postby shannah » Thu Aug 07, 2008 9:30 am

Try putting your html inside an echo call.
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

No success. I'm afraid

Postby njw » Fri Aug 08, 2008 3:21 am

I also tried copying just the code from the Template file (the bit between the {slot} {/slot} and that also fails to work.

As an alternative, is there any other way I can easily use a URL in place of a table name in the conf.ini?
njw
 
Posts: 280
Joined: Wed Dec 31, 1969 5:00 pm

Postby shannah » Fri Aug 08, 2008 9:32 am

Code: Select all
function block__tables_menu_head(){
        echo '  <li><a href="http://qwerty.co.uk/asdfg/HomePage"
                           accesskey="accesskeys-navigation"
                           class="table-selection-tab"
                           title="Home"
                           id="TableLink_Home">
                           
                           
                                  Home
                           
                        </a></li> ';
}
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Thanks Steve

Postby njw » Sat Aug 09, 2008 3:36 am

yet again. I was a bit slow understanding how this would work!

The only issue I now have is that if you are not already logged in, you get a NO ACCESS error page, rather than a login page. Can I force the login page to display - in the same way that it does if you use Xataface without the Home page?

Many thanks

Neil
njw
 
Posts: 280
Joined: Wed Dec 31, 1969 5:00 pm

Postby shannah » Sat Aug 09, 2008 7:42 am

Yes. Add an enry to your actions.ini file for the page action, assigning a permission to it.

e.g.
Code: Select all
[page]
    permission=view
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Getting to the home page after login in

Postby njw » Mon Aug 18, 2008 7:45 am

All working well now, except that after logging in the first table is displayed, not the home page, even though the original access URL was to the home page.

Any thoughts on how I can force the login screen to go to the home page?

Many thanks

Neil
njw
 
Posts: 280
Joined: Wed Dec 31, 1969 5:00 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 25 guests

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