in
Forums
Blogs
Files
Devexpress.Com
Client Center
Support Center
DevExpress Channel

Nesting HTML Elements Question

Last post 8/2/2007 3:50 PM by Mark Miller (Developer Express). 7 replies.
Page 1 of 1 (8 items)
Sort Posts:
Previous Next
  • 8/1/2007 6:02 PM

    Nesting HTML Elements Question

    Hello all,

    this is probably a total neewbie question so i appologize if the answer is
    straight forward.

    i am trying to create some templates that will alleiviate the need for
    repetative typing. i use CSS for all positioing and have developed a set of
    CSSClasses that handle the layouts of forms. for instance i have a formRow
    class and a formCol class. that are used like this:
    <div class=formRow>
        <div class=formCol>
             'content here
        </div>
        <div class=formRow>
            'more stuff
        </div>
    </div>

    so heres my question: is there a way i can create a set of templates that
    works together to handle this output. i can create a simple fr template that
    expands the form row and a sperate one for the column, but is there a way to
    call the column from within the row that way it is nested inside the row.
    for example i could have another template that is frc that would expand both
    the fr and the fc but make the fc nested?

    is this making sence, i hope it is.

    along those same lines, is there a way that i could pass in a number
    variable and have something expand a template that many times. in the
    context of the form rows and column it would be nice if i could do something
    like frc3 where the 3 is the veriable and have that many columns nested in
    the row.

    Thanks in advance for any help, i very much appreciate it.

    Micah

    Filed under:
  • 8/1/2007 6:14 PM In reply to

    Re: Nesting HTML Elements Question

    > so heres my question: is there a way i can create a set of templates
    > that works together to handle this output. i can create a simple fr
    > template that expands the form row and a sperate one for the column,
    > but is there a way to call the column from within the row that way it
    > is nested inside the row. for example i could have another template
    > that is frc that would expand both the fr and the fc but make the fc
    > nested?

    A template can be expanded/called from within another template by referencing
    it thus.

    -------------------------------------------------------------
    frc template
    -------------------------------------------------------------

    �:fc�
    �:fr�

    -------------------------------------------------------------

    -------------------------------------------------------------
    fc template
    -------------------------------------------------------------

    'content here

    -------------------------------------------------------------

    -------------------------------------------------------------
    fr template
    -------------------------------------------------------------

    'more stuff

    -------------------------------------------------------------

    Does this do what you're after?

    I'm guessing that the forum will poorly encode some of the above so I will
    say that :fc and :fr are each supposed to be surrounded by chevrons. That
    is to say a symbol which resembles the c# bit shift operators <>

    > along those same lines, is there a way that i could pass in a number
    > variable and have something expand a template that many times. in the
    > context of the form rows and column it would be nice if i could do
    > something like frc3 where the 3 is the veriable and have that many
    > columns nested in the row.

    Sorry, I don't think I've seen this second idea implemented anywhere.
    Rory Becker - DX-Squad
    Blog, DXCore Community Plugins
    (Follow me @ http://twitter.com/RoryBecker)
  • 8/1/2007 6:18 PM In reply to

    Re: Nesting HTML Elements Question

    Wow did that ever get mangled

    Ok forget the worked example.

    basically you can reference another template by using the chevron symbols
    in the following way

    <>

    Thus you can create templates for "fc" and "fr" and reference then from a
    template called "frc"

    Please let me know if this isn't very clear.
    Rory Becker - DX-Squad
    Blog, DXCore Community Plugins
    (Follow me @ http://twitter.com/RoryBecker)
  • 8/1/2007 6:23 PM In reply to

    Re: Nesting HTML Elements Question

    Thanks for your response. i have thought of this, but it doesnt work properly let me explain why.

     in the fr template there is

    <div class=fr>

    </div>

    in the fc template there is

    <div class=fc>

    </div>

    so reference them as you suggested would produce this

    <div class=fr></div><div class=fc></div>

    where as i need them to be

    <div class=fr>

      <div class=fc>

      </div>

    </div

    The nesting is where i am getting hung at.

    Did that make sense?

     

  • 8/1/2007 6:23 PM In reply to

    Re: Nesting HTML Elements Question

    Ok this is Way out of hand now

    Syntax = &gt;&gt;:SomeTemplate&lt;&lt;

    The double symbols are supposed to represent chevrons.

    Fingers crossed. This might even be viewable
    Rory Becker - DX-Squad
    Blog, DXCore Community Plugins
    (Follow me @ http://twitter.com/RoryBecker)
  • 8/1/2007 6:51 PM In reply to

    Re: Nesting HTML Elements Question

    AFAIK: Templates do not have much in the way of conditional logic.
    Therefore you cannot have a template that both contains a nested reference and also does not contain this nested reference.

    Perhaps the best and most flexible way of doing this would be to just use "fr" and "fc" templates.
    -------------------------------------------------------------
    <div class=fr>
       «Caret»
    </div>«Marker»
    -------------------------------------------------------------

    -------------------------------------------------------------
    <div class=fc>
       «Caret»
    </div>«Marker»
    -------------------------------------------------------------

     I can then create what you are after with a little more typing but not much

    fr<space>fr<space><esc><enter>fc<space>

    In this manner you will have built the tools you need to produce any combination you need.

    If this is not sufficient then I think you will have to build additional templates to represent frec ( fr with embedded c) and possibly fcer (fc with embedded r)

    I hope this helps. (and I hope it prints too)
     

     

     


     

    Rory Becker - DX-Squad
    Blog, DXCore Community Plugins
    (Follow me @ http://twitter.com/RoryBecker)
  • 8/1/2007 7:22 PM In reply to

    Re: Nesting HTML Elements Question

    >> Wow did that ever get mangled
    This is a side note to DevExpress: is the formatting of posts ever going to be fixed? Ever since the forum upgrade, many, many posts get their text mangled. Clearly, each newsreader, web-browser, etc. is dependent on their respective encoding. It is driving me nuts that the encoding is getting mangled - often.
     
     
    Trevor Westerdahl - DX Squad
    BLOG: http://trevorunlocked.blogspot.com/
  • 8/2/2007 3:50 PM In reply to

    Re: Nesting HTML Elements Question

    > It is driving me nuts that the encoding
    > is getting mangled - often.
     
    Yeah, me too. Look for the right ass to kick as we speak....

    Best regards,
     
    Mark Miller - Developer Express
    C# MVP
    "Trevor Westerdahl" wrote in message news:190184@community.devexpress.com...
    >> Wow did that ever get mangled
    This is a side note to DevExpress: is the formatting of posts ever going to be fixed? Ever since the forum upgrade, many, many posts get their text mangled. Clearly, each newsreader, web-browser, etc. is dependent on their respective encoding. It is driving me nuts that the encoding is getting mangled - often.
     
     

    Trevor Westerdahl - DX Squad

    http://community.devexpress.com//forums/p/56422/190184.aspx#190184

Page 1 of 1 (8 items)
Copyright © 1998-2008 Developer Express Inc.
ALL RIGHTS RESERVED