jmohler1970 / BS-4-CF

Bootstrap tags for Adobe ColdFusion
MIT License
2 stars 2 forks source link

bootstrap column struct #63

Closed jmohler1970 closed 8 years ago

jmohler1970 commented 8 years ago

The sizing on b:column needs to be able to accept structs.

<b:column span = "{ lg = 3, md = 4, sm = 3, xs =6 }">Content</b:column>

It also needs to evaluate. Right now this is a string

jmohler1970 commented 8 years ago

During a fit of insanity, you considered

// cfml
string function tag (required string tag_name, struct attr = {}, any innerHTML = [])        {

    if(!isArray(arguments.innerHTML))   arguments.innerHTML = [arguments.innerHTML];

    writeOutput("<" & arguments.tag);

    for (local.myAttr in arguments.attr)    {
        writeOutput(" " & lcase(local.myAttr) & '="' & arguments.attr(local.myAttr) & '"';
        }
    writeOutput(">");

    for(local.myInnerHTML in arguments.innerHTML)   {
        writeOutput(local.myInnerHTML);
        }

    writeOutput("</" & arguments.tag & ">");
    }

tag("p", { class = "help-block" }, 
    tag("input", {class = "help-button", value = "Help"})
    );
jmohler1970 commented 8 years ago

Or more particular

tag("column", "{ lg = 3, md = 4, sm = 3, xs =6 }", content);

jmohler1970 commented 8 years ago

Support for Bootstrap 4 xl will also be added

jmohler1970 commented 8 years ago

http://stackoverflow.com/questions/35218598/passing-json-to-custom-coldfusion-tag

jmohler1970 commented 8 years ago

Maybe you need to be able to run it in function mode or in tag mode. Maybe this gets a huge

 switch(arguments.tag) {}

statement.

column("lg = 3, md = 4, sm = 3, xs =6", content);
jmohler1970 commented 8 years ago

I don't like all this string manipulation. How about just straight JSON?