prepare for a long discussion
On one level, FWP generates html, css and javascript - so technically it is
ready for someone else to pickup.
Except that it often generates this code in an unintelligent, machine-like
way. This is the hard part for code novices - learning how to make FWP
generate more human-friendly code⌠is there such a thing?
Yes, absolutely.
SEMANTIC HTML â start first with your html structures⌠these are tags like
div and in html5, header, footer, article, and so on. Itâs also text tags
like h1, h2, p, block quote and so on. If youâre still not sure what is
html and what is not, find a way to cure that. HTML is the organized
structure of the page in the absence of style or decoration⌠by itself, it
means something.
In FWP, we are used to focusing on looks â you need to get away from that
for a bit. Learning to apply tags that are structural or semantic only,
forgoing images to convey your ideas, you end up with a page that reads
more like an outline but is structurally more powerful. Also, avoid using
div upon div in brick-like fashion to create a layout - simplicity is not
always simple, but should be your new design mantra.
RATIONAL CSS â FWP automatically makes styles for us⌠and the result is
often a sort of code âsoupâ. It works, but is often too complicated for
ordinary people to decipher. The best indicator of code bloat are a
proliferation of class styles like âp.styleâ, âp.style32â, âh1.style47â,
etc. Try to aim for just âpâ or âh1â if possible. Watch the Style palette
when you are working and try to quash FWPâs endless attempts to sneak these
illegitimate styles in.
Thatâs not to say you shouldnât have any class styles, just that YOU decide
when one is needed. This is what I mean by Rational CSS - as opposed to
âautomaticâ CSS. Try to use the semantic tags to your advantage, so that
their natural use achieves the effect you desire instead of needing to
slather style code into your page.
FWP also writes loads of redundant CSS, so learn how to be more deliberate
with the code that is written â for example, using combinations like
h1, h2, h3, h4, h5 { font-weight:bold; }
instead of writing it five separate times. Or target styles by their
associate and descendent selectors, like âaside pâ or â#mydivitem h1â. FWP
wonât know how to deal with these styles in the workspace, but the browser
will. This break from the WYSIWYG approach is hard for a lot of folk,
probably the biggest test of all. Let it go, trust what you know in your
mind and have learned about browser behavior and you can do this⌠many have
and still do.
SCRIPT CONSOLIDATION â most of the scripts Freewayers use are generated by
actions, and can result in acres of javascript littering your page code.
This is consistent with a machine-like aesthetic. A more human approach
would be to ask âDo I really need to embed the Library of Congress in my
page code?â In other words, can some of this code be consolidated and
off-loaded from the page and linked to instead? In my own work, I will ask
if my use of an action is even necessary - some actions, like the CSS Menu
action, generate much more code than I am comfortable with in my page code,
so I write them myself*⌠It becomes a matter of personal judgement how
scripting is applied.
Of course, all this requires that you become more familiar with how FWP
does its thing. This is hard, but not much different than riding a horse.
Learning how it interprets what you are trying to tell it may just require
you spend time tinkering then looking at the code and seeing "oh, if I do
THAT, this is the code it writes. And if I do something else, THIS is how
it writes that. Soon, you learn from observation that you can exercise a
different level of control and make FWP write itâs code in a more directed
way. Because you ARE directing it⌠to a large degree anyway.
*for the record, I love and appreciate the action writers for making life
easier. I want to be clear that whatever my personal opinions, my goal is
not to denigrate what they do.
â
Ernie Simpson, aka The Big Erns
offtopic mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options