Include PHP in master pages

Is there a trick to insert PHP into the master page so that it appears at
the beginning of the HTML page?

Best wishes Peter

================================
Peter Tucker, Oxford UK email@hidden


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

When you say “beginning”, do you mean before any HTML is generated, or
at the top of the visible page? If the former, then use the Page >
HTML Markup on the Master Page, and insert your code in the Before
HTML slot. If the latter, then a Markup Item inserted in the page will
give you the most control.

Note that HTML Markup on Master Pages can be highly variable with
respect to already-designed pages. You may need to create new pages
based on your master before the code will magically insert into all
pages. If this is not practical, then you can edit the master and the
recalcitrant children, but you will need to keep track of which pages
you have manually overridden, and every time you make a code change
you will need to make it in both (or more) places.

Another approach is to always use external code libraries, and use
Paul Dunning’s PHP Use Include Pages Action to insert that code in the
head of your page. Once you set this up, you will be able to edit the
include page in a proper programming editor like TextMate or BBEdit
(with syntax highlighting and line numbers and tabs that work) and
every time you update that external file, your Freeway document will
be notified and upload a new copy. If you are using Markup Items, then
the equivalent would be to use Upload Stuff to upload that library,
and an include() or require() reference in your Markup Item to place
it somewhere on your page.

Walter

On Nov 28, 2008, at 11:19 AM, Peter Tucker wrote:

Is there a trick to insert PHP into the master page so that it
appears at
the beginning of the HTML page?

Best wishes Peter

================================
Peter Tucker, Oxford UK email@hidden


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

on 28/11/2008 16:38, Walter Lee Davis at email@hidden wrote:

When you say “beginning”, do you mean before any HTML is generated, or
at the top of the visible page? If the former, then use the Page >
HTML Markup on the Master Page, and insert your code in the Before
HTML slot. If the latter, then a Markup Item inserted in the page will
give you the most control.

Note that HTML Markup on Master Pages can be highly variable with
respect to already-designed pages. You may need to create new pages
based on your master before the code will magically insert into all
pages. If this is not practical, then you can edit the master and the
recalcitrant children, but you will need to keep track of which pages
you have manually overridden, and every time you make a code change
you will need to make it in both (or more) places.

Another approach is to always use external code libraries, and use
Paul Dunning’s PHP Use Include Pages Action to insert that code in the
head of your page. Once you set this up, you will be able to edit the
include page in a proper programming editor like TextMate or BBEdit
(with syntax highlighting and line numbers and tabs that work) and
every time you update that external file, your Freeway document will
be notified and upload a new copy. If you are using Markup Items, then
the equivalent would be to use Upload Stuff to upload that library,
and an include() or require() reference in your Markup Item to place
it somewhere on your page.

Many thanks Walter, easy when you know how!!

Best wishes Peter

================================
Peter Tucker, Oxford UK email@hidden


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options