0

I'm setting up a carousel in Sitecore using Glass Mapper. In the foreach loop to generate each carousel item, I can get the items out easily enough and make them editable with the @Editable command. What this doesn't give, however, is finer control over the edit process. For example, I want to edit the background image using a custom button in the Experience Editor, but I need to set that up in a rendering.

If I was using straight Sitecore, it looks like I'd use Html.Sitecore().ItemRendering and pass in the carousel item as a regular Sitecore item. In this case, I have my strongly-type class from Glass Mapper, which can't be passed in that way.

Is there a comparable method in Glass Mapper for setting up an item rendering? Or is there another way to affect the Experience Editor buttons for the carousel items? I've also experimented with setting up a separate edit mode, which would work fine, but I wanted to put together a cleaner editing experience with a more WYSIWYG approach to the item.

Ken McAndrew
  • 203
  • 2
  • 10
  • What about Glass Mapper's in-line edit frame functionality? – Jim Noellsch Feb 10 '16 at 04:43
  • If you are using Glass V4 then as @JimNoellsch has said you [could use Edit Frames](http://glass.lu/Blog/GlassV4). Otherwise setting a separate edit mode for the image is usually an acceptable compromise. – jammykam Feb 10 '16 at 08:50
  • I'd seen the edit frame stuff but hadn't found that link. I tested it out and it does what I'm looking for. I was thinking I wish I could change the icons, but it looks like there's a version where you can put the path to the custom buttons in for finer control. I'd credit your comments as the most appropriate answer to my question (though Nikki's links were also useful) - can you give half-credit to each? – Ken McAndrew Feb 10 '16 at 12:13
  • If only Stack Exchange points could be converted to currency... – Jim Noellsch Feb 10 '16 at 13:29

2 Answers2

1

You'll have to use Custom User Experience Buttons which will allow you to edit in Page Editor Mode. I just googled and found couple of good article which might help you.

http://www.nishtechinc.com/Blog/2015/March/A%20Better%20Approach%20at%20Carousel%20Management

http://www.awareweb.com/awareblog/11-25-14-custombuttonspageeditor

Nikki Punjabi
  • 383
  • 2
  • 16
  • 1
    These links are very good resources - the first I'd found, the second I hadn't, but was very useful for the edit frame buttons. Jim Noellsch and JammyKam's comments to the question were answers specific to the Glass Mapper version of this, but yours can be merged with theirs for the optimum answer. So I don't know how to credit this! :) – Ken McAndrew Feb 10 '16 at 12:14
0

Try Html.Glass().BeginEditFrame() functionality built into Glass Mapper, wrapped in a @using block.

It allows you to specify the fields you wish to edit directly as params. Or if you're feeling adventurous, it can point to a full edit frame configuration in the core DB.

Jim Noellsch
  • 714
  • 4
  • 7