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

Labels have not the correct markup #4

Open
couellet opened this issue May 1, 2012 · 4 comments
Open

Labels have not the correct markup #4

couellet opened this issue May 1, 2012 · 4 comments

Comments

@couellet
Copy link

couellet commented May 1, 2012

In a form, labels must have the CSS class control-label.

Currently, the scaffolding generates them like this:

@Html.LabelFor(model => model.PropertyName)

The output is:

<label for="PropertyName">PropertyName</label>

The output should be:

<label for="PropertyName" class="control-label">PropertyName</label>
@andrewtobin
Copy link
Owner

Thanks @couellet - it's actually something I brought up on their version 2.0 - because they were using that in their website (which acts as the documentation) but they didn't actually have a matching class property in their CSS at the time.

I should be paying closer attention to what they've done.

I'm happy if you want to add it in otherwise when I get home I will try to find the time to add it in myself.

Appreciated.

@couellet
Copy link
Author

couellet commented May 2, 2012

Do you prefer having a HtmlHelper extensions for label or straight HTML markup?

@gazk
Copy link

gazk commented May 8, 2012

I have added some Bootstrap HtmlHelper extensions to my fork of this project. One of them adds the control-label class to labels.

@Html.BootstrapLabelFor(model => model.PropertyName)

I ended up creating a separate assembly for the extensions as it was easier to call them from the T4 templates. If you are interested I can send a pull request.

@andrewtobin
Copy link
Owner

@couellet at the moment I've been adjusting the templates as required, so there's that, and the base changes so when people do an install there's a rewrite of the basic install to be bootstrap compat.

@gazk more than happy! that'd be awesome.

I haven't had enough time lately to get back into this, but I'm more than happy if you guys want to contribute to bring them in and credit you guys on the nuget package!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants