This is a migrated thread and some comments may be shown as answers.

Image alignment and size

6 Answers 61 Views
Editor
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Roy Halvorsen
Top achievements
Rank 1
Roy Halvorsen asked on 07 Mar 2012, 01:34 PM
I am using the MVC Editor in several pages, but I can not find out how to set alignment, size, padding etc. on images that I insert. Mybe I am forgetting something in Filebrowser settings. Here's my code:
@( Html.Telerik().EditorFor(x => x.Article.Content)
                        .Name("rtxtEditor")
                        .Localizable("nb-NO")
                        .Tools(tools =>
                            tools.Clear()
                            .Bold()
                            .Italic()
                            .Underline()
                            .Separator()
                            .FontName()
                            .FontSize()
                            .Separator()
                            .JustifyLeft()
                            .JustifyCenter()
                            .JustifyRight()
                            .JustifyFull()
                            .Separator()
                            .InsertUnorderedList()
                            .InsertOrderedList()
                            .Separator()
                            .Outdent()
                            .Indent()
                            .Separator()
                            .CreateLink()
                            .Unlink()
                            .Separator()
                            .InsertImage())
                        .FileBrowser(settings => settings
                        .Browse("Browse", "ImageBrowser")
                        .Upload("Upload", "ImageBrowser")
                        .CreateDirectory("CreateDirectory", "ImageBrowser")))

6 Answers, 1 is accepted

Sort by
0
Accepted
Dimo
Telerik team
answered on 07 Mar 2012, 02:21 PM
Hello Roy,

I am afraid such functionality is not supported currently. You can try using a custom tool and the Editor's client API in order to apply the desired attributes after inserting the image inside the content area.

http://demos.telerik.com/aspnet-mvc/editor/customtools

http://www.telerik.com/help/aspnet-mvc/telerik-ui-components-editor-client-api-and-events.html

All the best,
Dimo
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now.
0
Roy Halvorsen
Top achievements
Rank 1
answered on 07 Mar 2012, 03:15 PM
That's far too complicated for such simple functionality. What's the reason with inserting a photo without being able to format it the way you want where you want. To me the editor is useless the way it is, so I'd better find one that I can use that meets my customer's criteria.
0
Dimo
Telerik team
answered on 07 Mar 2012, 04:30 PM
Hello Roy,

When we designed the Editor tools, we wanted to make them simple, without unnecessary customization options. Generally, margins can be set via external stylesheets, while using width or height (either inline or in external stylesheets) will make the images look ugly (blurred or pixelated), so this is rarely recommended.

What we can offer you is to add one field in the image dialog - "CSS class", which you can use to assign all styles that you could possibly need to that CSS class.

Regards,
Dimo
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now.
0
Roy Halvorsen
Top achievements
Rank 1
answered on 08 Mar 2012, 12:05 PM
Thanks for your reply.
Unfortunately just a CSS class is not good enough in the current project. My customer wants to be able to insert several pictures with different alignments and different paddings. Being able to attach documents and link to docs stored in a virtual directory is also a requirement, without knowing the path to the directory. Here we are talking about end users who is used to MS Word and nothing else.

Roy
0
Dimo
Telerik team
answered on 08 Mar 2012, 02:19 PM
Hello Roy,

I have added new items to our public issue tracking system, related to your requests. You can vote and follow their status there.

http://www.telerik.com/support/pits.aspx#/public/aspnet-mvc/10098

http://www.telerik.com/support/pits.aspx#/public/aspnet-mvc/10099

Regards,
Dimo
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now.
0
Roy Halvorsen
Top achievements
Rank 1
answered on 08 Mar 2012, 02:21 PM
Thanks a lot, Dimo.
Really appreciated.

Roy
Tags
Editor
Asked by
Roy Halvorsen
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Roy Halvorsen
Top achievements
Rank 1
Share this question
or