Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'Inner' support for forms #19

Closed
ghost opened this issue Oct 4, 2014 · 11 comments
Closed

'Inner' support for forms #19

ghost opened this issue Oct 4, 2014 · 11 comments

Comments

@ghost
Copy link

ghost commented Oct 4, 2014

From mark.ericson on July 12, 2009 22:58:25

Today I was working on a new textpattern-based website and realized it
would be very powerful if I could effectively parameterize a form. I
would use this in several places in my site design to create consistent
wrapping of content, but with different content for different scenarios.

Effectively I would call a form which would provide the outer wrapping
tags, but I could pass some inner (x)html content.

This is a super oversimplification, doesn't adequately document the use
cases, but I was thinking of something like this:

Page contains:

<txp:output_form "myform">

  • list item1

  • list item2

  • </txp:output_form />

    Where form "myform" is defined as:

    Output would be:

    1. list item1
    2. list item2

    Original issue: http://code.google.com/p/textpattern/issues/detail?id=15

    @ghost
    Copy link
    Author

    ghost commented Oct 4, 2014

    From mani...@gmail.com on July 12, 2009 19:16:33

    Disclaimer: I'm not a TXP developer, just another TXP user.

    I've seen something similar in Django, where you can create that kind of wrapping
    estructures...
    IMHO, they are a little cumbersome, although they prove useful.

    This kind of idea could go in tandem with this proposal (also inspired in Django): http://forum.textpattern.com/viewtopic.php?pid=178734

    @ghost
    Copy link
    Author

    ghost commented Oct 4, 2014

    From r.wetzlmayr on July 12, 2009 22:58:59

    <txp:variable /> can be used to provide such functionality.

    Labels: Component-Core Priority-Low Type-Enhancement

    @ghost
    Copy link
    Author

    ghost commented Oct 4, 2014

    From artag...@gmail.com on July 12, 2009 23:48:36

    This is analogous to the <r:yield> tag in Radiant. I agree it would be a useful addition. Although <txp:variable
    /> can be used to achieve this result, it is more cumbersome and requires naming the variable (which requires
    awareness of potential name collisions). So, although <txp:variable /> is a more general solution, this idea has
    merit as a more targeted solution to the specific problem of parameterizing forms.

    @ghost
    Copy link
    Author

    ghost commented Oct 4, 2014

    From artag...@gmail.com on July 15, 2009 22:58:47

    Status: Confirmed
    Owner: artagesw

    @ghost
    Copy link
    Author

    ghost commented Oct 4, 2014

    From julian.l...@gmail.com on July 16, 2009 06:03:25

    hi artagesw,

    not sure what means the new status ("Confirmed").
    Will you be working on adding this as a new feature?

    Maybe we can do some little more brainstorming on this, although no doubt you
    probably grasped the whole concept (and how to implement it on a "textpatternish
    way") better and clearer than me.
    The "paremeterizing" concept is unfamiliar for me

    First, both wet and you says that <txp:variable /> can be used to provide such
    functionality.
    Could you, please, share how to do it?
    This will certainly make things clearer to understand (even if a solution using
    <txp:variable /> may be cumbersome).

    Seconda, there is also this post on TXP forum: http://forum.textpattern.com/viewtopic.php?id=31191 I think that FireFusion is suggesting some way to create variables directly from
    <txp:output_form /> attributes, so to avoid the hassle of writing <txp:variable />
    somewhere (one line above?) the <txp:output_form />, so when the "outputted" form is
    called, then the variable already exists and can be used as a switch inside the form.

    In other words:

    <txp:variable name="foo" value="1" />
    <txp:output_form form="my_form" />

    Form "my_form":

    <txp:if_variable name="foo" value="1">
    do this
    <txp:else />
    do that
    /txp:if_variable

    That may be seen as a little cumbersome, but at least, it currently works, and seems
    it's somehow inline with the "textpatternish" way of doing things.

    FireFusion may be suggesting something like

    <txp:output_form form="my_form" var="foo" value="1" />

    to create txp:variables "on the fly".
    That looks tidier... but then, it may open a can of worms and questions and
    suggestions ("let's add this to every TXP tag!").

    I don't like this last example too much.

    But, both examples could lead to another attempt to create a "One form to rule them
    all", where just one form with lot of conditionals have every chunk of code on it...

    Then, another idea: txp:output_form as a container tag, which may sound really
    silly, as txp:output_form calls a form, so why would anyone want to use it as a
    container tag?.
    Maybe, the contained stuff can only be one or some txp:variable and can act like
    parameters on functions (parameterizing?). But being wrapped by txp:output_form, this
    variables will only work inside the called form (and then, destroyed), so to avoid
    name collisions?.

    This can also lead to the "one form to rule them all" approach.

    Anyway, I'm just thinking loud. I'm not a programmer and I'm probably be talking of
    obvious things that you already considered.

    @ghost
    Copy link
    Author

    ghost commented Oct 4, 2014

    From robinpel...@gmail.com on July 16, 2009 08:28:17

    "FireFusion may be suggesting something like

    <txp:output_form form="my_form" var="foo" value="1" />"

    Actually it would be more like this.

    <txp:output_form form="my_form" var_name="value" />

    That way you could define many variables in one output form.

    <txp:output_form form="my_form" var_name="value" var_name2="value" var_name3="value" />

    @ghost
    Copy link
    Author

    ghost commented Oct 4, 2014

    From artag...@gmail.com on July 16, 2009 11:15:04

    @Julian: "Confirmed" status means the proposed feature has been recognized as having merit and has been
    accepted (though not necessarily scheduled) for future implementation.

    @ghost
    Copy link
    Author

    ghost commented Oct 4, 2014

    From artag...@gmail.com on July 18, 2009 01:16:01

    This issue was closed by r3251 .

    Status: Fixed

    @ghost
    Copy link
    Author

    ghost commented Oct 4, 2014

    From mani...@gmail.com on August 24, 2009 17:33:42

    Hi Sam,

    after doing some testing of this new feature (txp:output_form as container and
    txp:yield) I've some ideas and comments to share with you and the TXP team.
    Also, I've been already informed about a txp:scope thing on the pipeline ;) that may
    come in handy, although at a first glance (must admit I didn't go into the details of
    txp:scope and its usage) I ask if we really need another tag for managing the scope
    of TXP variables (something that is, without any doubt, desirable) or if we may come
    up with other alternative.

    But before going on, I would like to know if this is the place to discuss it, or
    should I do it on TXP forum, on a new issue or maybe joining a mailing list.

    Thanks.

    @ghost
    Copy link
    Author

    ghost commented Oct 4, 2014

    From artag...@gmail.com on August 24, 2009 17:53:23

    Well, since this issue has been closed, I think it would be better to discuss related ideas in a forum post or on
    the txp-dev mailing list.

    @ghost
    Copy link
    Author

    ghost commented Oct 4, 2014

    From r.wetzlmayr on March 09, 2010 03:32:24

    Status: Resolved

    @ghost ghost closed this as completed Oct 4, 2014
    This issue was closed.
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    No branches or pull requests

    0 participants