Crowbar is an Action that does exactly what a Markup Item does, but allows you greater control over the output code. (If you read this page, it describes it in a bit more detail: http://www.actionsforge.com/actions/view/13-crowbar-inline)
Normally, when you use a Markup Item inline (within a run of text), Freeway treats it like any other character of text, and wraps it with whatever text-level container tag is currently in use. Sometimes, that’s precisely what you want. Imagine this use-case:
<p>Today is [markup item: <?= date('l',time()) ?>].</p>
(that little blob of code prints out the day name in English).
That would make perfect sense: you want your code’s output to be combined with the rest of the text in the same paragraph. But let’s say you have a more ambitious piece of code, which outputs the recent bids on an auction item, and does so within a table. Even if you put a Markup Item all by itself alone on a line in an HTML box, Freeway will still wrap that in a
tag (or
, if you’re currently in a list). This makes sense, because Freeway can’t know what your code might output – it can’t execute the code and figure it out, either. So you would end up with this invalid mess:
<p><table> ... </table></p>
In addition to failing a syntax checker, it will also behave unpredictably layout-wise in different browsers, as they can choose their own way to auto-correct it.
So Crowbar adds the check for “am I all alone in this line?” to its output process, and if it detects that there’s nothing on either side of it within its parent container, it will erase the parent container. So your code would come out like this instead:
<table> ... </table>
Which is what you want.
In addition to this, it allows you to move your output code outside of the container tag. If you had code that needed to be set outside of a P tag, either at the beginning or the end, you would simply place it in a Crowbar inserted as either the very first or the very last character of that paragraph. The resulting code would look like this:
<your code here><p> ... </p>
or
<p> ... </p><your code here>
Hope this helps,
Walter
On Nov 2, 2013, at 8:48 AM, LauraB wrote:
I don’t see a description for Crowbar. What exactly does it do? The brief line about it isn’t very specific.
Thanks.
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