Page 1 of 1

Making a web page the home page

PostPosted: Wed Aug 06, 2008 7:42 am
by njw
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

PostPosted: Thu Aug 07, 2008 9:30 am
by shannah
Try putting your html inside an echo call.

No success. I'm afraid

PostPosted: Fri Aug 08, 2008 3:21 am
by njw
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?

PostPosted: Fri Aug 08, 2008 9:32 am
by shannah
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> ';
}

Thanks Steve

PostPosted: Sat Aug 09, 2008 3:36 am
by njw
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

PostPosted: Sat Aug 09, 2008 7:42 am
by shannah
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

Getting to the home page after login in

PostPosted: Mon Aug 18, 2008 7:45 am
by njw
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