0

Just getting to grips with this cool framework and interested in adding in an extra feature into the default toolbar. I assume the toolbar is from the following:

@Edit.Toolbar(Content)

And the functions from which each item is defined is in the 'inpage.js' file which houses all the menu item actions (add, new, replace). But when I try the following (inside in 'image max 3.cshtml'):

@Edit.Toolbar(Content, actions: "edit,replace,color");

and have a new colour action created in 'inpage.js':

'color': {
                title: "Toolbar.Sort",
                iclass: "icon-sxc-table",
                showOn: "edit",
                addCondition: function (settings, modConfig) { return modConfig.isList && settings.useModuleList && settings.sortOrder !== -1; }
            },

This however is not presenting anything to the screen for me. I assume I am missing something but my aim was to replicate the reorder feature action but instead have a modal popup colour palette in order to change the colour of the background of each indivudal 'Image(s) max 3. in a row' content type views.

Appreciate any and all help!

Thx

denisjoconnor
  • 115
  • 1
  • 9

1 Answers1

1

2sxc 08.06 is out, and allows this now. Check out the 2sxc-wiki https://github.com/2sic/2sxc/wiki/Html-Js-Command-Custom-Code

iJungleBoy
  • 5,325
  • 1
  • 9
  • 21
  • Thx for this release, much appreciated! Question: Is it best to duplicate an existing template and insert a custom toolbar and if so what would be the best way to approach creating a custom toolbar? I have read over the Wiki pages (great amount there!) but just would like a little direction as to where to start. Will I edit inpage.js actions to include a new action? I read about including 'more' for advanced actions like actions: "develop,more". Thx again, Denis – denisjoconnor Nov 15 '16 at 14:35
  • 1
    To create custom buttons, DONT edit the inpage js. Create a toolbar with custom-button code. The inpage.js should stay unmodified so you can continue to install upgrades. Then if you need it often, create a script which generates the toolbar (there are some examples in the wiki using jQuery) – iJungleBoy Nov 15 '16 at 20:41