[Pro] How to add code (HTML, CSS, Javascript) to Freeway ???

I guess that some here will take me for a green idiot - but I am a film director, not a web coder (which is why I have been using Freeway). So I am not shy and ask the question I haven’t found a comprehensive answer for.

Freeway says in its manual that you can “Easily add custom code”, specifying that if you got some code you want to add to your site, there is “no problem, you can add any code you want, whether it’s PHP, JavaScript, CSS or just straight markup.”

Now, one of the things I would like to do on my website is to create a responsive Google map. I found this page here: https://codepen.io/hubpork/pen/xriIz#presentation
which seems to do exactly that.
But now there are those three sections: HTML, CSS and JS (which I assume stands for Javascript).
Now here it comes, the stupid question: HOW DO I PUT THESE THREE PARTS INTO FREEWAY???

I would greatly appreciate the help and I swear - I have looked everywhere but most of you seem to know this and therefore NEVER explain the steps one by one…

Thank you!
Dirk


freewaytalk mailing list
email@hidden
Update your subscriptions at:

Sprechen Sie deutsch?


freewaytalk mailing list
email@hidden
Update your subscriptions at:

I’ll give this a shot, but it will take some experimentation on your part, for which you will need the proper tools. I recommend BBEdit from http://barebones.com (paid, with a free use option) as a great general-purpose code editing tool. If all goes well, you will only need this for reading, not writing, but the benefit of using a professional editor (rather than a general purpose text editing tool like TextEdit or a word-processing application like Pages) is that you will see your code in a color-coded monospaced layout, where it stands a chance of being slightly more understandable.

Make sure that your document preferences in Freeway include “Output / HTML code: More Readable”. That will put the output HTML that Freeway writes into a “pretty” format, rather than mashing everything together on as few lines as possible (More Efficient).

Let’s start with the CSS. If you have a block of CSS code that you want to put into the page, and it’s all written for you and ready to go, the very simplest way to do this is with the Page / HTML Markup dialog in Freeway. Opening that dialog will show you a code editor window with a picking list below it, indicating where the entered code is to be inserted into the page tree. Choose “Before ” as your option, and paste in the code. If you are coming from CodePen, you won’t have the start and end blocks (since CodePen works in a different manner, with separate CSS files, rather than putting the code into the page head). You will need to add those. The result should look like this:

<style type="text/css">
[PASTE
CODE
HERE]
</style>

Next the JavaScript. We can use the same sort of trick as the CSS, in fact, you can keep that same window open and add your script there. In CodePen, there are options to add library code to the page before the script block shown in the interface is run. In the case of your example, there are three libraries: jQuery, Google Maps, and Noisy (which is a plug-in to jQuery). Those can be found in the Settings / JavaScript part of CodePen.

A word about jQuery here: If you have used any of my “Scripty” Actions on the page, or even used any of the built-in Freeway Actions like Rollover with any of their Effects options enabled, you will have added Prototype.js to the resulting page. Prototype and jQuery don’t get along well, and in any case, do exactly the same thing (so you only would want to use one of them, never both). The code you found in CodePen is based on jQuery, and won’t work without it. So you have (unbeknownst to you) chosen a fork in the road that has large consequences. When you use jQuery in Freeway, you are effectively on your own, and you can’t use Actions (this is not strictly true, but the Actions you CAN use are quite geeky – I would argue almost as geeky as writing the code long-hand the way we are here).

To insert the three libraries into your page, you will need to add “scriptsrc” blocks to the Before block of Page / HTML Markup. Your Before code will seem to disappear when you choose the Before option, but it is still there, and you can navigate between a number of different ordinal points in the page tree in this manner.

<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js" type="text/javascript"></script>
<script src="//maps.googleapis.com/maps/api/js?v=3.exp&sensor=false" type="text/javascript"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/noisy/1.2/jquery.noisy.min.js" type="text/javascript"></script>

Next, add another script block below those to contain the code from the JavaScript portion of the Pen:

<script type="text/javascript">
[PASTE
CODE
HERE]
</script>

Now you can close the HTML Markup dialog, and publish the page. If you set up BBEdit as one of your browsers (File / Preview in Browser / Browser Setup) in Freeway, you will be able to choose BBEdit as the “browser” and preview from Freeway directly into your code editor, where you can see that the code you pasted is properly output in both the page head and at the bottom of the page.

Next, you will need to duplicate the HTML portion of the Pen. This Pen is based on a very simplified HTML structure, and Freeway won’t usually make that for you without some coaching. You will need one Action to suppress Freeway’s usual behavior when using inline Markup Items (it wraps them in a paragraph tag for some reason). CrowBar - ActionsForge

In your layout, choose or create your 100%-width element where you want the map to appear. Double-click it so that you have a blinking text cursor inside it. (There should be no other content in this box.) From the Insert menu, choose Action Item / Crowbar. Click once on the Crowbar item (little box with a gear on it) and look in the Actions palette. You should see a highlighted tab for Crowbar, with a button on it labeled Code. Click that, and paste in the code from the Pen:

<div id="map_container"></div>
<div id="map"></div>

Note that I didn’t choose all of the HTML from the Pen to paste. That’s because Freeway is going to take over the building of the “container” element and the headline (if you want one). The only parts you need, therefore, are the map+container and map elements. Because these are being added “behind Freeway’s back”, it is incumbent on you that you don’t name anything else on the page the same – so don’t draw a box on the page and make its name (in the Inspector) “map” or “map_container”. That will end badly.

Publish and upload your page (the scriptsrc tags we added initially cannot be previewed locally, because they begin with // rather than http://). Visit the finished page in your browser, and see what you see. If you made the outer element (where you inserted the Crowbar) flexible width, and the page also flexible width, you should see a nice stretchy map.

Now you’ll need to tumble further down the rabbit hole, finding the latitude/longitude for the center of your map, and updating the JS code you put in the Page /HTML Markup dialog, and making any other adjustments to the description etc. You’ll also need to figure out how to make the map adjust its height (Height: Flexible on the outer HTML item in Freeway). If you want it to have a different aspect ratio, you’ll need to adjust the CSS you added, making the padding-bottom value for #map a different percentage. None of this will work without a page that is designed in the “Inline” layout style. Just drawing boxes on the page will not work well for flexible items.

Previewing into BBEdit will show you a nice view of the code you’ve created in Freeway, but learning to read that is a lifetime’s pursuit. Any journey begins with the first steps, and if you follow these (and follow up with us here, posting links in progress), you will be able to carry this as far as you like.

Walter

On Apr 21, 2017, at 10:39 PM, Dirk van den Berg email@hidden wrote:

I guess that some here will take me for a green idiot - but I am a film director, not a web coder (which is why I have been using Freeway). So I am not shy and ask the question I haven’t found a comprehensive answer for.

Freeway says in its manual that you can “Easily add custom code”, specifying that if you got some code you want to add to your site, there is “no problem, you can add any code you want, whether it’s PHP, JavaScript, CSS or just straight markup.”

Now, one of the things I would like to do on my website is to create a responsive Google map. I found this page here: https://codepen.io/hubpork/pen/xriIz#presentation
which seems to do exactly that.
But now there are those three sections: HTML, CSS and JS (which I assume stands for Javascript).
Now here it comes, the stupid question: HOW DO I PUT THESE THREE PARTS INTO FREEWAY???

I would greatly appreciate the help and I swear - I have looked everywhere but most of you seem to know this and therefore NEVER explain the steps one by one…

Thank you!
Dirk


freewaytalk mailing list
email@hidden
Update your subscriptions at:
Information for existing FreewayTalk / Groups.io users - Site Feedback - Softpress Talk


freewaytalk mailing list
email@hidden
Update your subscriptions at:
https://freewaytalk.softpress.com/person/options

Dear Walter, thank you very much for taking the time to write this fantastically clear explanation. Yes, this is definitely a start, and I like experimenting.

Am I correct that the "Scripty” Actions you refer to are: Protaculous 2, ScriptyAccordion, ScriptyFader, ScriptyInfiniteSlider, ScriptyLazyLoad, ScriptyLightbox, ScriptyLightbox2, ScriptyLightbox3, and ZipTastic? I use neither of them. Page extensions in use on all my pages are: BackgroundSupersizer (fundamental for the overall look and feel of the website), BetterMeta and GoogleAnalytics, plus a Markup Item for Statcounter’s services. As single item extensions I use WebFonts and Responsive CSS Menus.

BTW I am using Macromates’ TextMate for some time now instead of BBEdit, ie to write my email html signatures…

And last but not least, I am on FW 7.1.4.

Again, Walter, thank you very much indeed for your guide! I will most definitely try it out and get back here with my progress.

@Romano: Ja, ich spreche Deutsch, but have been using English systems forever since the Mac’s system and most software is written in English.

Dirk


freewaytalk mailing list
email@hidden
Update your subscriptions at:

Since Walter explains the possible “conflict” between Prototype and jQuery, I searched and found another way to create a responsive Google Map on the website:

To my “untrained” eye it seems that this is cleaner and straightforward than the CodePen solution… or is it?

Feels great to be doing this, finally starting to UNDERSTAND what I am doing, and to even more appreciate Freeway’s potential.

Dirk


freewaytalk mailing list
email@hidden
Update your subscriptions at:

Dear Walter, I have followed your instructions to the letter and this is the result:
http://www.outremer.film/contact.html

Not sure if this happens also to you, but on my machine, it shows a Google map for a split second but then vanishes, and the grey area with the Java error message comes up.

So my guess is that you were probably with the “Prototype and jQuery” conflict. I’ll have to find a different way how to get a responsive map on my website, without jQuery. Happy if you (or someone else) could point me to the right direction.

Cheers, Dirk


freewaytalk mailing list
email@hidden
Update your subscriptions at:

Dag Dirk,
in the iFrame of GoogleMaps; change: width: “600px” in width : “100%”, see below.

For the Prototype and jQuery conflict:

Paste: Before the


freewaytalk mailing list
email@hidden
Update your subscriptions at:

Hello Sjef and thank you for the advice - are you referring to the iFrame of the second option I found, or to something in relation to the Pen that Walter had discussed?
Thank you!!!


freewaytalk mailing list
email@hidden
Update your subscriptions at:

Hi, Dirk, the iframe-script is copied from GoogleMaps.


freewaytalk mailing list
email@hidden
Update your subscriptions at:

You don’t seem to have any reference to Prototype in the page, but you do have a reference to the NoConflict script in the head of your page, so look through the Actions applied to the page as well as the Page / HTML Markup dialog (look through After and Before in that dialog) for any reference to this bit:

<script id="noconflict" type="text/javascript">
$.noConflict();
</script>

And remove it. You don’t need it.

The other error you are getting refers to a missing Google Maps API key. I didn’t see one in the CodePen example, so I’m not sure what to advise you on that – but you will need one I guess.

Walter

On Apr 22, 2017, at 10:17 PM, Dirk van den Berg email@hidden wrote:

Dear Walter, I have followed your instructions to the letter and this is the result:
http://www.outremer.film/contact.html

Not sure if this happens also to you, but on my machine, it shows a Google map for a split second but then vanishes, and the grey area with the Java error message comes up.

So my guess is that you were probably with the “Prototype and jQuery” conflict. I’ll have to find a different way how to get a responsive map on my website, without jQuery. Happy if you (or someone else) could point me to the right direction.

Cheers, Dirk


freewaytalk mailing list
email@hidden
Update your subscriptions at:
Information for existing FreewayTalk / Groups.io users - Site Feedback - Softpress Talk


freewaytalk mailing list
email@hidden
Update your subscriptions at:
https://freewaytalk.softpress.com/person/options

But now there are those three sections: HTML, CSS and JS (which I assume stands for Javascript).
Now here it comes, the stupid question: HOW DO I PUT THESE THREE PARTS INTO FREEWAY???

###HTML

Pretty easy! It’s what you do by placing items into your workspace. Just a word to it: It highly depends on how you place them. Drop and drag is out!!!

##css

It’s mostly what the inspector stands for. So if you want to have a pretty red background of an item? I guess you’d do it in inspector - right?

###JS (which stands for JavaScript, indeed)

Well - there are (mostly) actions for. It requires a basic library which extends the basic browser inbuilt functions. Furthermore it requires (mostly) a kind of chinese ping-pong player like set of script language and sometimes some init-function.

So in your case:

Start to learn HTML and its positioning items relative. BACKDRAFT can solve this for you for sure (cause you elsewhere said it wouldn’t ). It’s exactly built for it. Once done, apply to each instance the gm-action. Create the required API Code (helpful: https://secure.sparkle.cx/support/maps/maps-en.html ).

So the very first step to learn is inflow-construction (aka Inline-Construction, inline elements, Box-in-Box-Model, Box-Model (only in Freeway!)

Cheers

Thomas

It helps to start with ONE map. Once properly established this - it’s one click creating the second. I recently did it - using FreewayPro. So I’m pretty convinced that the above operation at the opened heart is simply redundant!!!


freewaytalk mailing list
email@hidden
Update your subscriptions at:
https://freewaytalk.softpress.com/person/options

I give up.

Thank you Walter, Sjef, Romano and Thomas. If I resign from this it has nothing to do with you, on the contrary: I very much admire your generosity to help me out (as you did with countless others) writing hundreds of words and loosing precious lifetime on my questions.

You wouldn’t have needed to if Freeway had a proper manual in the first place, where these things are explained. A manual updated to the present and not stuck ten years in the past. Yes I know they had problems and the company closed and the program was almost gone and now finally someone has taken over and had it resuscitate… but that happened in the last 6 to 8 months. The inherent problems Freeway has, not the least regarding the somewhat “hermetic” way that many of its higher functions seem to be hidden behind, are from way before that period.

I spent 75% of this weekend trying to do what Walter and others have suggested - without being successful at it. I neglected my projects, my wife, my life… I can’t afford to waste anymore of my time trying to make this work.

Personally, I find it ridiculous how many of the things Freeway does NOT do in the WYSIWYG mode that once upon a time made me buy this program, have become essential today where responsive websites have become omnipresent.

And no Thomas, I won’t “learn HTML”, to be more precise: I won’t learn HTML to the extent that seems to be necessary to add a bloody responsive Google map on my contact page. Imagine the time it would take you to learn how to write screenplays, make 22 page production budgets, film a truck with ISIS fighters at 16.000 ISO from a car running at 60 mp/h or edit an 18 track timeline and in 5 languages with 4K material…?

I need to stop now.
Thank you again, Walter, Sjef, Thomas, ciao Romano. Or I will have someone do this FOR me or I find a software that does what I want without me becoming a different person.

Ciao and cheers!
Dirk


freewaytalk mailing list
email@hidden
Update your subscriptions at:

… just for the protocol:

When I say:

Start to learn HTML and its positioning items relative

… it’s certainly wrong formulated (my bad) and should be read as:

In Freeway, you have two possibilities placing items. The one is “Insert → HTML-item” from the context menu. This is drop and drag (the one you’re used to do - and unfortunately deprecated if it comes to create a page-structure). The other one is double-click into your workspace (or any other item already placed) so you see the flashing cursor!!! and chose then “Insert → HTML-item”. This makes a huge difference cause you now CAN’T move this item anymore. Unfortunately the second one is the method ensuring successful responsive design - PERIOD.

So in fact it is not learning HTML - it is reviewing your strategies within your app. This has been billions of time discussed here. The key is within Freeway. And I have to admit, that SP failed. SP missed the trend starting to adapt their “static approach” into a “dynamic workspace”.

The bad on this:

A turning-point (with no return) with the result of being two handful people left, still having the skills of using it. Not enough to ensure SP healthiness, I guess. They preferred the way protecting its current audience. Bad bet - as history showed.

The good news:

I’m a man respecting crafts!!! I never have or had the claim, being the smartass to pretend having skills that I do not have. WebDesign is a skill. It is profession, it is craft.

And if you think, your free-time is more valuable, it’s a damn fair attitude. But then, I’d prefer to “value” free (or extra) time, turning this into a number. Money - to be precise. The result can be called budget. So you see - probably those 22 pages could be something to manage. In real life I’m a clerk - WebDesign is just a hobby (and Design was my dream job 30 years ago)

Cheers

Thomas


freewaytalk mailing list
email@hidden
Update your subscriptions at:
https://freewaytalk.softpress.com/person/options