Hiding colors in uEdit - xmpie-users/uStore-js GitHub Wiki

The colors that are shown in uEdit are those that are defined and used in the InDesign Document used to create the XLIM document that is used by uStore.

To add additional colors to the panel, you simply:

  • edit the InDesign document,
  • create a new swatch,
  • add it to the document, (If needed it can be placed on the pasteboard next to the page, rather than on the actual page.)
  • save the XLIM document to the server, or export a XLIM document package and update the document in uProduce,
  • edit the product in uStore and update the local cache checkboxes,
  • save the uStore product.

Because InDesign has several "out of the box" colors already defined (eg registration, cyan, magenta, etc) it may be needed to remove one or more of these options from the uEdit color selector.

Alt

This is simple to achieve by adding a JavaScript snippet to the storefront.

First, identify the index of the swatch that you want to remove. In the example below, [5] will remove the magenta swatch from the above screenshot.

<script type="text/javascript">
  document.addEventListener("DOMContentLoaded", () => {
    setTimeout(function() {
      document.getElementsByClassName('btn color-button')[5].style.display='none'; 
    }, 4000); 
  });
</script>

For information on how to add JavaScript to your store: How to add JavaScript to a storefront.

⚠️ **GitHub.com Fallback** ⚠️