[Pro] Freeway Side Includes

Hi all,

I’m not sure this is the right forum - so bear with me while I try in my way to explain myself.

I’ve been trying to work with Server Side Includes, and I’m not having any problem with the technology. However, it has given me some ideas that you all might find ways to make practical.

SSI starts out by taking a FWP page and stripping it down to essential content, like with PHP Make Insert Page.

BUT instead of depending on the server to include the html contents of that page output when viewed, would it be possible to get Freeway Pro to merge the content during the act of publishing? Then there would be no need to ask the server to do it.

It would be a two step process I suppose, (1) the making of insert content and (2) the tagging of a specific location to insert content – like a div or markup item.

Does this make sense? Is there a way to do something like this now, or can Freeway be extended this way?


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

Tim Plumb beat you to that, at least 4 years ago, with Simple Include Pro. Have a look at http://freewayactions.com – I believe it’s a free one.

Walter

On Jan 20, 2013, at 11:35 AM, The Big Erns wrote:

Hi all,

I’m not sure this is the right forum - so bear with me while I try in my way to explain myself.

I’ve been trying to work with Server Side Includes, and I’m not having any problem with the technology. However, it has given me some ideas that you all might find ways to make practical.

SSI starts out by taking a FWP page and stripping it down to essential content, like with PHP Make Insert Page.

BUT instead of depending on the server to include the html contents of that page output when viewed, would it be possible to get Freeway Pro to merge the content during the act of publishing? Then there would be no need to ask the server to do it.

It would be a two step process I suppose, (1) the making of insert content and (2) the tagging of a specific location to insert content – like a div or markup item.

Does this make sense? Is there a way to do something like this now, or can Freeway be extended this way?


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


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

On Sun, Jan 20, 2013 at 1:04 PM, Walter Lee Davis email@hiddenwrote:

Tim Plumb beat you to that, at least 4 years ago, with Simple Include Pro.
Have a look at http://freewayactions.com – I believe it’s a free one.

I’m afraid I’ve not explained this well.

I’m not suggesting an SSI solution, but a completely Freeway Pro one…

Ist it possible to get Freeway to include the html fragments at the moment
of publishing instead of getting the server to include them at the moment
of serving?

SSI is like the old “mail merge” except performed at the server level. I’m
wondering if Freeway can “merge” at the moment of code generation?


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

SIP does that – merging in Freeway – as well as creating the elements for a server-based solution. It can do either one equally well.

Walter

On Jan 20, 2013, at 1:18 PM, Ernie Simpson wrote:

On Sun, Jan 20, 2013 at 1:04 PM, Walter Lee Davis email@hiddenwrote:

Tim Plumb beat you to that, at least 4 years ago, with Simple Include Pro.
Have a look at http://freewayactions.com – I believe it’s a free one.

I’m afraid I’ve not explained this well.

I’m not suggesting an SSI solution, but a completely Freeway Pro one…

Ist it possible to get Freeway to include the html fragments at the moment
of publishing instead of getting the server to include them at the moment
of serving?

SSI is like the old “mail merge” except performed at the server level. I’m
wondering if Freeway can “merge” at the moment of code generation?


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


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

SIP is an interesting prototype, but it does not work with inline
construction. Frankly, I could not get it to work with any other kind of
construction.

Me, I will stick with SSI. I was looking for a way to solve the issue for
the less adept.

Thanks.


Ernie Simpson

On Sun, Jan 20, 2013 at 1:22 PM, Walter Lee Davis email@hiddenwrote:

SIP does that – merging in Freeway – as well as creating the elements
for a server-based solution. It can do either one equally well.

Walter

On Jan 20, 2013, at 1:18 PM, Ernie Simpson wrote:

On Sun, Jan 20, 2013 at 1:04 PM, Walter Lee Davis <email@hidden
wrote:

Tim Plumb beat you to that, at least 4 years ago, with Simple Include
Pro.
Have a look at http://freewayactions.com – I believe it’s a free one.

I’m afraid I’ve not explained this well.

I’m not suggesting an SSI solution, but a completely Freeway Pro one…

Ist it possible to get Freeway to include the html fragments at the
moment
of publishing instead of getting the server to include them at the moment
of serving?

SSI is like the old “mail merge” except performed at the server level.
I’m
wondering if Freeway can “merge” at the moment of code generation?


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


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


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

Okay, now I have to eat some crow. Mmmm… crow… (munch, munch, munch)

Going back and trying different ways of applying the instructions, I
finally could get it to do what I wanted - regardless of layout.

Many thanks to Tim Plumb, creator of this action – Tim, this is now one of
my favorite “must have”, “why doesn’t Freeway just do this” actions. :slight_smile:

Thanks also to Walter Davis for patiently schooling me on the obvious :slight_smile:


Ernie Simpson

On Sun, Jan 20, 2013 at 2:20 PM, Ernie Simpson email@hidden wrote:

SIP is an interesting prototype, but it does not work with inline
construction. Frankly, I could not get it to work with any other kind of
construction.


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

No problem Ernie. I’m glad you got it working OK.

I should really spend some time looking at these Actions again as they were originally written when the majority of the code for an item (other than the images maybe) were self contained in the HTML. Font styles were defined by and tags and the whole item was a lot easier to move around a site. Hopefully I can update the Actions so that you can still define items as you would normally using external style sheets and images and leave the Action to extract this from the site and bundle it up so you can use it again later in the site.

Unfortunately collating all of these assets, managing their links and then seamlessly writing them back into another part of the site is a little tricky. I’d better get some coffee on!
Regards,
Tim.

On 20 Jan 2013, at 19:54, Ernie Simpson wrote:

Many thanks to Tim Plumb, creator of this action – Tim, this is now one of
my favorite “must have”, “why doesn’t Freeway just do this” actions. :slight_smile:


FreewayActions.com - Freeware and commercial Actions for Freeway Express & Pro - http://www.freewayactions.com


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

What befuddled me most was trying to think the same way I was with actions
like the PHP Include, where a page include is treated a certain way. For
items, it was different enough to confuse how I was trying to apply. Now
that I can see exactly how it works and the fact that it plays nicely with
inline construction and Walter’s HTML5 actions, I think the possibilities
for edit once / publish in many places will make site maintenance much
easier. Especially with larger sites that don’t use a CMS or other
data-driven system to manage such repeating items.


Ernie Simpson

On Sun, Jan 20, 2013 at 5:13 PM, Tim Plumb email@hidden wrote:

No problem Ernie. I’m glad you got it working OK.


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

Ernie Simpson (20/1/13, 18:18) said:

I’m not suggesting an SSI solution, but a completely Freeway Pro one…

Ist it possible to get Freeway to include the html fragments at the moment
of publishing instead of getting the server to include them at the moment
of serving?

You can import an HTML fragment into an HTML box, and Freeway will include it at publish time.

Select the box so that it doesn’t have a text selection (as if you are importing a graphic or other content) and choose Import from the File menu.

I think Freeway expects the file to have a .htm or .html extension.

Jeremy


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

You can also use files with a .inc file extension which may work out better if you are embedding anything other than html in your includes. Any of these extensions will work just as well as each other in terms of the include but (for me at least) the .inc extension doesn’t infer the include contents.
Regards,
Tim.

On 21 Jan 2013, at 11:02, Jeremy Hughes wrote:

I think Freeway expects the file to have a .htm or .html extension.


FreewayActions.com - Freeware and commercial Actions for Freeway Express & Pro - http://www.freewayactions.com


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

Thanks guys, I’ve worked it out… made the paradigm shift… crossed over to
the light… got it cracking on a site where I couldn’t be 100% sure that SSI
would work, and am very happy to have discovered this. Works beautifully
with inline and flexible size boxes, very easy once the process is
understood.


Ernie Simpson

On Mon, Jan 21, 2013 at 6:41 AM, Tim Plumb email@hidden wrote:

You can also use files with a .inc file extension which may work out
better if you are embedding anything other than html in your includes. Any
of these extensions will work just as well as each other in terms of the
include but (for me at least) the .inc extension doesn’t infer the include
contents.
Regards,
Tim.

On 21 Jan 2013, at 11:02, Jeremy Hughes wrote:

I think Freeway expects the file to have a .htm or .html extension.


FreewayActions.com - Freeware and commercial Actions for Freeway Express &
Pro - http://www.freewayactions.com


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


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

Unicode failure: Unfortunately, both Tim’s action as well as Freeway’s built in option suffers from inability to cope with anything but MacRoman or perhaps Windows Latin1 characters.

Well, Tim’s option most certainly works if you use SSI files.

But for local import, then both the action and the Freeway functionality do not work for - for instance - Cyrillic text.


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

Tim, any chance you could update the Simple Include Pro action to support UTF-8 encoded Freeway documents/Web pages?


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

Unicode failure: Unfortunately, both Tim’s action as well as Freeway’s
built in option suffers from inability to cope with anything but MacRoman
or perhaps Windows Latin1 characters.

Well, Tim’s option most certainly works if you use SSI files.

But for local import, then both the action and the Freeway functionality
do not work for - for instance - Cyrillic text.

I don’t understand… I’m using SIP for local import (merge when published)
on this site with UTF-8 and no problems - Industrial Marketing – QUALITY NEW AND USED DRILL RIGS

UTF-8 is a page-level setting, how is it not working for merged content?


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

On 30 Nov 2014, at 3:38, Ernie Simpson wrote:

inability to cope with anything but MacRoman
or perhaps Windows Latin1 characters.

[ snip ]

I don’t understand… I’m using SIP for local import (merge when
published)
on this site with UTF-8 and no problems - http://tinyurl.com/ksmzgeg

UTF-8 as such is not a problem. The problem is related to characters:
Except via workaround (see below) neither the SIP action nor Freeway
handles Not-Mac-Roman content.

For instance, if the page is served as UTF-8, but the included file only
contains ASCII characters, then the SIP action (as well as Freeway
import) will work fine. The same is the case even if the characters
inside the include belong to the Mac Roman charset and/or [at least most
of] Windows Latin 1. So the issue is not related to how you serve your
page (UTF-8 or otherwise) - the problem is related to the very content
of the include file.

Workaround: For Freeway import, the problem can be worked around by
converting the include to ASCII (or Windows Latin 1). That is, if you
convert all non-ASCII (or non-Windows Latin 1) characters to character
references/entities before import, then it will work. The same
workaround could have worked the case for SIP includes, that is: one
way to fix the SIP action would be to have it create include files where
every non-ASCII (or non-Windows Latin 1) is represented as a character
entity/reference.

UTF-8 is a page-level setting, how is it not working for merged
content?

Hope the above was clarifying.

Leif Halvard Silli


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

Hope the above was clarifying.

Well, I do appreciate the effort you’ve made to educate me. :slight_smile:

Clearly this is beyond my area of experience. It sounds like a language
thing, like there are characters you are using not supported by UTF-8(?)
Here I was so impressed how it handled anything I could type with my
American English Keyboard.

Best of luck to you!


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

On 30 Nov 2014, at 12:52, Ernie Simpson wrote:

Hope the above was clarifying.

Well, I do appreciate the effort you’ve made to educate me. :slight_smile:

Well, it was helpful for myself - and hopefully to Softpress and Tim -
that I had to lay out the problem more accurately.

Clearly this is beyond my area of experience. It sounds like a
language
thing, like there are characters you are using not supported by
UTF-8(?)

UTF-8 supports all Unicode characters. Thus your assumption is wrong
(since our computers basically only permit us to enter Unicode
characters). This is a bug in Freeway - nothing more or less. The issue
is that while Freeway ‘itself’ has implemented Unicode/UTF-8, its
import function suffers from a Mac OS Roman hangover
(Mac OS Roman - Wikipedia). (I use checked, and
Freeway’s import function only supports Mac OS Roman - thus, it does
not support Windows 1252 (Windows Latin1) files.)

It is not a surprising bug, however, in the sense that in the transition
to UTF-8 (which is something every developer worth his/her salt strives
for these days - though many seems to think the job is done …), there
are always certain corners that developers forget. These corners seem
especially easy to forget for developers that, on a day to day basis,
only need to handle (to put it simply) texts in English. (Part of the
reason being that the ASCII character set/encoding is a 100% valid
subset of UTF-8.)

It is really a pretty simple thing … but getting developers to get it
… is not always so simple.

Leif Halvard Silli


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

This reminds me of a bug I have seen, encountered while developing the TemplateHelper Action. The issue seems to be related to any Action that generates a file – unless you tell it explicitly, it will skip the encoding step. Here’s the extra effort I had to take in TH:

function makePartial(myName,textStream){
  textStream.fwConvertLineEndings = true;
  textStream = fwEncode(textStream);
  outFile = new FWFile;
  outFile.fwSetEncoding('UTF-8');
  if (outFile.fwOpenWrite('_' + myName + '.' + fwParameters['extension'],true,"TEXT","R*ch")){
    fwParameters['partial'].fwClear();
    outFile.fwWrite(textStream);
    outFile.fwClose();
    fwParameters["partial"].fwSpecify(outFile);
    var partial = fwParameters["partial"].toString();
    fwParameters['partial'].fwClear();
    return partial.substring(1,partial.indexOf('.'));
  }
  fwParameters['partial'].fwClear();
  return null;
}

You may want to look inside the Simple Include Pro Action and see if similar steps have been taken on the file streams that it imports.

Walter

On Nov 30, 2014, at 7:20 AM, Leif Halvard Silli (russisk.no) email@hidden wrote:

On 30 Nov 2014, at 12:52, Ernie Simpson wrote:

Hope the above was clarifying.

Well, I do appreciate the effort you’ve made to educate me. :slight_smile:

Well, it was helpful for myself - and hopefully to Softpress and Tim - that I had to lay out the problem more accurately.

Clearly this is beyond my area of experience. It sounds like a language
thing, like there are characters you are using not supported by UTF-8(?)

UTF-8 supports all Unicode characters. Thus your assumption is wrong (since our computers basically only permit us to enter Unicode characters). This is a bug in Freeway - nothing more or less. The issue is that while Freeway ‘itself’ has implemented Unicode/UTF-8, its import function suffers from a Mac OS Roman hangover (Mac OS Roman - Wikipedia). (I use checked, and Freeway’s import function only supports Mac OS Roman - thus, it does not support Windows 1252 (Windows Latin1) files.)

It is not a surprising bug, however, in the sense that in the transition to UTF-8 (which is something every developer worth his/her salt strives for these days - though many seems to think the job is done …), there are always certain corners that developers forget. These corners seem especially easy to forget for developers that, on a day to day basis, only need to handle (to put it simply) texts in English. (Part of the reason being that the ASCII character set/encoding is a 100% valid subset of UTF-8.)

It is really a pretty simple thing … but getting developers to get it … is not always so simple.

Leif Halvard Silli


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


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

Thanks for the tip. Unfortunately, I am not very ”actionable”.
However, the most important issue would be to fix SIP’s ability to
(locally) import UTF-8 (read: non-English text). Is that doable?

Leif

On 30 Nov 2014, at 14:49, Walter Lee Davis wrote:

This reminds me of a bug I have seen, encountered while developing the
TemplateHelper Action. The issue seems to be related to any Action
that generates a file – unless you tell it explicitly, it will skip
the encoding step. Here’s the extra effort I had to take in TH:

function makePartial(myName,textStream){
textStream.fwConvertLineEndings = true;
textStream = fwEncode(textStream);
outFile = new FWFile;
outFile.fwSetEncoding(‘UTF-8’);
if (outFile.fwOpenWrite(‘_’ + myName + ‘.’ +
fwParameters[‘extension’],true,“TEXT”,“R*ch”)){
fwParameters[‘partial’].fwClear();
outFile.fwWrite(textStream);
outFile.fwClose();
fwParameters[“partial”].fwSpecify(outFile);
var partial = fwParameters[“partial”].toString();
fwParameters[‘partial’].fwClear();
return partial.substring(1,partial.indexOf(‘.’));
}
fwParameters[‘partial’].fwClear();
return null;
}

You may want to look inside the Simple Include Pro Action and see if
similar steps have been taken on the file streams that it imports.

Walter

On Nov 30, 2014, at 7:20 AM, Leif Halvard Silli (russisk.no)
email@hidden wrote:

On 30 Nov 2014, at 12:52, Ernie Simpson wrote:

Hope the above was clarifying.

Well, I do appreciate the effort you’ve made to educate me. :slight_smile:

Well, it was helpful for myself - and hopefully to Softpress and Tim

  • that I had to lay out the problem more accurately.

Clearly this is beyond my area of experience. It sounds like a
language
thing, like there are characters you are using not supported by
UTF-8(?)

UTF-8 supports all Unicode characters. Thus your assumption is wrong
(since our computers basically only permit us to enter Unicode
characters). This is a bug in Freeway - nothing more or less. The
issue is that while Freeway ‘itself’ has implemented
Unicode/UTF-8, its import function suffers from a Mac OS Roman
hangover (Mac OS Roman - Wikipedia). (I use checked,
and Freeway’s import function only supports Mac OS Roman - thus, it
does not support Windows 1252 (Windows Latin1) files.)

It is not a surprising bug, however, in the sense that in the
transition to UTF-8 (which is something every developer worth his/her
salt strives for these days - though many seems to think the job is
done …), there are always certain corners that developers forget.
These corners seem especially easy to forget for developers that, on
a day to day basis, only need to handle (to put it simply) texts in
English. (Part of the reason being that the ASCII character
set/encoding is a 100% valid subset of UTF-8.)

It is really a pretty simple thing … but getting developers to get
it … is not always so simple.

Leif Halvard Silli


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


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


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

On 30 Nov 2014, at 14:49, Walter Lee Davis wrote:

You may want to look inside the Simple Include Pro Action and see if
similar steps have been taken on the file streams that it imports.

A simple question: The Simple Include Pro action is somehow
«scrambled»/minified – how do I look into it?

Leif Halvard Silli


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