Is it possible to make the flag link a button?

Comments

quicksketch’s picture

A button needs to be placed in a <form> element in order to be valid HTML, so generally I'd say "no" this isn't really possible. I'd suggest using CSS to just make the link look like a button. With some significant theming you could probably make it a button through some JavaScript, but really CSS is the much easier approach to take here.

clashar’s picture

it's possible also to not use button, but an image as an item of list style, only by CSS, for example:

  /*to make Flag as "Add to .." styled as list for image injection*/
  /*START*/
div.node-cv ul.inline
  {  list-style-type: none;  }
div.node-cv ul.inline li
  {   list-style-type: circle;
 list-style-image:url("../images/star.png");  }
div.node-cv ul.inline li span.flag-favorites
   {  display:list-item;
 list-style-position:inherit;   }
   /*END*/

I use it for D7, I suppose for D6 should be approximately the same.

joachim’s picture

Version: 6.x-2.x-dev » 7.x-3.x-dev
Category: support » feature
Status: Active » Closed (won't fix)

I daresay you could define a new flag link type that outputs a form with just one button.

Probably one for a contrib module though -- and I've a vague feeling someone's already done it too.

giorgio79’s picture

Status: Closed (won't fix) » Active

Hello,

#1
Button does not need to be a part of a form as per HTML standards (http://stackoverflow.com/questions/14461658/are-button-html-tags-outside...)

#3
I have yet to find a Flag extension that provides a button output

It would be lovely to provide an output with a simple button markup like this
<button class="btn btn-default" type="submit">Button</button>
So, we can style it easily.
http://getbootstrap.com/css/#buttons-tags

Alternatively, if we could specify our own style, so it looks sg like this
<a class="btn btn-default" href="#">Link</a>

Would be just as good.

joachim’s picture

Status: Active » Closed (won't fix)

> I have yet to find a Flag extension that provides a button output

What I mean is that someone will have to code it, and release it as a contrib module.

daneshjoo’s picture

bassplaya’s picture

If you are using a View, you can add the "btn btn-primary" classes to the HTML element and then you'll have what you need.

a screen shot that shows a flag link with a Bootstrap button class to change it into a Bootstrap button
a screen shot that shows the Views interface to show you how and where to add the Bootstrap button classes