Making Bootstrap work with linkto()

177 views
Skip to first unread message

Tom Avey

unread,
Feb 18, 2012, 10:14:30 AM2/18/12
to ColdFusion on Wheels
I discovered Bootstrap from a post on this group (thankyou!) but was
wondering if there is a way to get linkto() to create a link like this
- <a class="btn" data-toggle="modal" href="#myModal" >Launch Modal</a>

It doesn't appear that the data- tags are passed through. Am I
missing something? Is there a solution?

Simon Allard

unread,
Feb 18, 2012, 10:25:47 AM2/18/12
to cfwh...@googlegroups.com

Right now CFWheels doesn't support the data attributes. There's been discussion on how it will be handle in future release though. For now you'll have to create the links by hand.

A+

Simon

On Feb 18, 2012 10:14 AM, "Tom Avey" <tomav...@gmail.com> wrote:

Per Djurner

unread,
Feb 18, 2012, 10:30:03 AM2/18/12
to cfwh...@googlegroups.com
You can get it to work by doing something like this:
<cfset args["data-toggle"] = "modal">
#linkTo(action="x", argumentCollection=args)#

/ Per

--
You received this message because you are subscribed to the Google Groups "ColdFusion on Wheels" group.
To post to this group, send email to cfwh...@googlegroups.com.
To unsubscribe from this group, send email to cfwheels+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cfwheels?hl=en.

Tom Avey

unread,
Feb 18, 2012, 10:45:44 AM2/18/12
to ColdFusion on Wheels
Thanks so much. I'll try this soon.

On Feb 18, 10:30 am, Per Djurner <per.djur...@gmail.com> wrote:
> You can get it to work by doing something like this:
> <cfset args["data-toggle"] = "modal">
> #linkTo(action="x", argumentCollection=args)#
>
> / Per
>
>
>
>
>
>
>
> On Sat, Feb 18, 2012 at 4:25 PM, Simon Allard <ellor1...@gmail.com> wrote:
> > Right now CFWheels doesn't support the data attributes. There's been
> > discussion on how it will be handle in future release though. For now
> > you'll have to create the links by hand.
>
> > A+
>
> > Simon

james.t...@gmail.com

unread,
Feb 18, 2012, 11:44:55 AM2/18/12
to ColdFusion on Wheels
You could also make a plugin to extend linkTo() to handle data
attributes. Maybe any attributes that starts with "data" would be
hyphenated automagically. We are gearing up to start using bootstrap
and pjax so if someone doesn't create this soon, you'll probably see
something from me.

James

Per Djurner

unread,
Feb 18, 2012, 12:09:34 PM2/18/12
to cfwh...@googlegroups.com
James, I have committed some code to handle this recently but it's not been released yet.

Here's one of the commits (can't remember if there was more):

Tom Avey

unread,
Feb 24, 2012, 6:41:02 PM2/24/12
to ColdFusion on Wheels
Ok - Per's solution works:

<cfset args["data-toggle"] = "dropdown">
<cfset args["text"] = "Files">
#linkTo(argumentCollection=args)#

produces

<a href="/dev/index.cfm/team-teams/list" data-toggle="dropdown">Files</
a>

Now I know I should not tinker with linkTo() inside wheels but can
someone give me some direction how to make this happen without the
cfset args coding?

I guess I can create a new helper inside helpers.cfm link
linkToWithData() but there must be a better way.

Can someone point me in the right direction?


On Feb 18, 10:30 am, Per Djurner <per.djur...@gmail.com> wrote:
> You can get it to work by doing something like this:
> <cfset args["data-toggle"] = "modal">
> #linkTo(action="x", argumentCollection=args)#
>
> / Per
>
>
>
>
>
>
>
> On Sat, Feb 18, 2012 at 4:25 PM, Simon Allard <ellor1...@gmail.com> wrote:
> > Right now CFWheels doesn't support the data attributes. There's been
> > discussion on how it will be handle in future release though. For now
> > you'll have to create the links by hand.
>
> > A+
>
> > Simon

Per Djurner

unread,
Feb 25, 2012, 10:23:25 AM2/25/12
to cfwh...@googlegroups.com
Tom, I have already fixed / improved this in our Git code, just not released yet.
You can go through my commits on Github to see how it was done.

/ Per

Tom Avey

unread,
Feb 26, 2012, 7:31:33 PM2/26/12
to ColdFusion on Wheels
Got it working by taking code from your commit.

Just need to camelCase the data attribute names (ie: "dataToggle =
dropdown").

Thanks!

I guess this means my wheels code is now modified. Will this feature
be incorporated in a new release soon?

tpet...@gmail.com

unread,
Feb 28, 2012, 7:56:14 AM2/28/12
to ColdFusion on Wheels
yes. i've been busy lately with other projects (see cfml-liquid on
git) and nighttime work that is wrapping up as we speak. i'm hoping
that i can get time this weekend to start backporting the changes and
get a release out soon. sorry for the delay everyone.

Tom Avey

unread,
Feb 28, 2012, 5:15:29 PM2/28/12
to ColdFusion on Wheels
Thanks so much for your work.

Btw... when I tried the data attribute on a Railo server in camelCase
it did not work. I needed to use underline in place of a dash. I need
to test this more but it looks like railo capitalizes agrument
collections.
Reply all
Reply to author
Forward
0 new messages