1

I want to move up & down the text & description field in experience editor mode via custom Experience buttons in a particular rendering ? Also how to move up & down multiple components on a page in experience editor mode via custom Experience buttons ?

enter image description here

2
  • Why would you want to move component with custom buttons? The experience editor was made to do this with drag&drop... – Gatogordo Jun 18 '20 at 15:36
  • @Gatogordo : we have requirement for this to enhance the experience of cm user via button we would want to move the component up & down on the whole page in exp editor mode. – Mohit Rajpal Jun 20 '20 at 12:18
1

I don't think this is something your going to be able to achieve with custom experience buttons. Generally the order of the display of fields in a component is fairly fixed so this would be a bit of an odd approach / concept for Content Editors.

You have 3 options here I think:

Option 1 - Create a new instance of a component where the text is above the title field. Configure compatible renderings on both rendering and so it's easy to switch between the two. The added benefit here is you can configure a preview thumbnail for each rendering of how it looks which is nice for content editors to see when placing components on the page. The page will auto-refresh also when choosing a different rendering, which is nice.

Option 2 - Create a rendering parameter to choose the order of the fields. Then in your view read the rendering param and order the fields as required. This would require the page to be saved after content editors change the rendering parameter in order for experience editor to show the update.

Option 3 - Split this component into two separate components. of Title and Text. Then they can be re-ordered as needed. The standard move component button in experience editor can be used here.

I'd suggest 1 and 3 are the most conventional options.

Re moving multiple components. will the standard move button not work for you? enter image description here

If not please explain what your trying to achieve.

2
  • Not sure why the default item:moveup & item:movedown command on rendering doesn't work. It should work as sitecore packages it. Basically I want to have an experience in exp editor like we get in tree list on the selected items you can click up & down to move the selected items. – Mohit Rajpal Jun 18 '20 at 12:57
  • Moving only works between multiple placeholders on the page that have been configured to allow your component. So it depends how your page and placeholders have been set up. So is it actually a list of items of items you want to support/re-order in here, e.g item1: with title and text, item2: with title and text, item3: with title and text. And re order these? – Adam Seabridge Jun 18 '20 at 13:15
0

The default WebEdit buttons "Move Up" and "Move Down" under /sitecore/content/Applications/WebEdit/Custom Experience Buttons are actually meant for moving the item up and down respectively. It doesn't move the field values of the same item.

So, instead of trying to explore how to move fields using those custom experience buttons (which might also be complex to implement), I would rather suggest to try achieving it using some other methods such as Sitecore rendering parameters.

Answer to Question 2 : Not sure if you aware of this. You can move components anywhere in a page using the default button called "Move component" in Sitecore as follows :

enter image description here

2
  • I am aware about the option that sitecore provide "Move component" feature in exp editor which would not resolve my requirement. As I want to have an experience in exp editor like we get in tree list on the selected items you can click up & down to move the selected items. I want to create custom experience editor button & then want to move fields in a component up or down. Even whole component to move up or down on the click of custom button. – Mohit Rajpal Jun 18 '20 at 13:03
  • Hi @MohitRajpal, please see my last comment on my answer. I don't think your approaching this in the right way. If you want to re-order fields then an button in experience editor is not what you want. There is nowhere in Sitecore that a field order on an item is stored. if you want to re-order items then thats different as items do have an order field which you could update. You need to provide more info I think. – Adam Seabridge Jun 19 '20 at 9:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.