enonic / xp

Enonic XP
https://enonic.com
GNU General Public License v3.0
201 stars 34 forks source link

<content-display-name-script> not working #5919

Closed Bellfalasch closed 6 years ago

Bellfalasch commented 6 years ago

Content Types support something called content display name scripts. It's not commonly used, but it is used here and there (for instance in the Superhero Theme, lib-urlredirect, and other apps done by Enonic). It's also been in the documentation for some time.

Try this Content Type in XP 6.13 and you will get $ is not a function errors in the console. Perhaps also there in 6.12.

<?xml version="1.0" encoding="UTF-8"?>
<content-type>
  <display-name>URL</display-name>
  <content-display-name-script>$('url')</content-display-name-script>
  <super-type>base:structured</super-type>
  <form>
    <input type="TextLine" name="url">
      <label>URL</label>
      <occurrences minimum="1" maximum="1"/>
      <help-text>Include the protocol name ("https://") for the URL.</help-text>
    </input>
  </form>
</content-type>

Expected behavior is that when typing anything into the field url a DisplayName would be generated out of it. The docs also have an example of how concatenating fields works.

screen shot 2018-01-03 at 11 55 47

alansemenov commented 6 years ago

Issue moved to enonic/xp-apps #478 via ZenHub