1)
- tag-name -> call tag of name 'tag-name'
- tag-name: -> parameter tag, contents/attributes passed to the
parameter 'tag-name' (if defined) of the parent tag.
- tag-name:something -> this is a regular tag call with a context
change. set 'this' to whatever is returned by executing 'something' on
'this' (whatever the context is before the tag.
<parent-tag> # this = context1 here
<tag-call:something /> # this = context1.something inside this
tag-call, this_parent = context1, this_field = :something
</parent-tag> # this = context1
2) I think of the parameters as a hash of info passed to the parent tag
method. just like ruby, invalid option names often get silently dropped.
This may or not be the case behind the scenes but think it's a nice simple
way of remembering.
3) When you have non-parameter tags in a tag call, you're basically giving
the parent a bunch of info in an ordered fashion, a single blob of text as
an example. parameter tags, are more like a hash with the parameter name
being the key, and the content wrapped being the value. putting the two
together provides 1) a problem of figuring out how to order things, what
goes where etc. and 2) a whole slew of potential for cryptic bugs when the
rules run across something unexpected. If you must, use the default
parameter for the stuff you'd want in non-parameter tags with a word of
warning - this can cause weird behavior as sometimes the default tag wraps
other parameters.
On Wednesday, March 7, 2012 8:15:04 PM UTC-7, Bryan Larsen wrote:
>
> As I mentioned off-hand in an answer to Bob's question, it would be
> nice to have a document called "frequently asked questions and
> misunderstandings". Let's use this thread to suggest questions and
> solicit volunteers to answer them.
>
> 1) What's the difference between a tag invocation without a colon,
> with a colon on the end of the tag name and with a colon in the middle
> of the tag name.
>
> 2) Why doesn't Hobo throw an error for an undefined parameter?
>
> 3) How come I can't mix parameter and non-parameter tags?
>
> other questions? Anybody want to volunteer to answer some of these?
>
> cheers,
> Bryan
>
>
--
You received this message because you are subscribed to the Google Groups "Hobo
Users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/hobousers/-/G4ic3ipbAlcJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/hobousers?hl=en.