Giter VIP home page Giter VIP logo

aem-code-templates's Introduction

Code Templates

Goal

Boost AEM components development

Touch UI templates demo

Code Templates

What is it and how to use it

Code templates are list of reusable and parameterized code snippets. The feature is well-known for all developers. You use it every time when you create loops/conditions in Java classes.

Template types

  1. Touch UI templates

Provide templates for Touch UI dialogs and widgets which could be used inside the dialog.

  1. Component Files templates

Provide basic definition of the AEM component files like: .content.xml, _cq_template.xml, _cq_editConfig.xml.

  1. HTL templates

Provide templates for HTML Template Language (HTL)

How to install

IntelliJ

  1. Automatic Import

  2. Download the liveTemplates.jar file

  3. Open your IDE

  4. Go to File > Import Settings

  5. Choose the file downloaded in the fist step and click OK

  6. Manual Import

  7. Go to the following directory where code templates are stored on you computer

* Windows: `<your home directory>\.<product name><version number>\config\templates`

* Linux: `~/.<product name><version number>/config/templates`

* OS: `~/Library/Preferences/<product name><version number>/templates`
  1. Download the *.xml containing templates definition file from the repository

  2. Put the downloaded file to the directory from the first point

  3. Restart your IDE if it is running

Eclipse

  1. Download the *.xml containing templates definition file from the repository

  2. Open your IDE

  3. Go to Window > Preferences > XML > XML Files > Editor > Templates

  4. Click Import button and select the downloaded file

Change log

  1. Version 2.0.0 Date 16.01.2017

HTL templates provided

  1. Version: 1.0.0 Date: 29.09.2016

Touch UI and Component Files templates provided

aem-code-templates's People

Contributors

devzbysiu avatar toniedzwiedz avatar twiernik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aem-code-templates's Issues

Touch UI Image Template missing a property

When used, the aem_image Touch UI template generates the following code (example with properties already filled in):

<nodeName
    jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/foundation/form/fileupload"
    autoStart="{Boolean}false"
    class="cq-droptarget"
    fieldLabel="Field Label"
    fileNameParameter="./nodeName/fileName"
    mimeTypes="[image]"
    multiple="{Boolean}false"
    name="./nodeName/file"
    title="Field Label"
    useHTML5="{Boolean}true" />

When uploaded to AEM, such a field is greyed out by default and it cannot be used.

Adding an uploadUrl property seems to enable the input, as seen in the screenshot below:

Field with and without the uploadUrl property

Perhaps the field should be added to the template? I'm not sure what the value should be. I had a look at foundation/components/image for reference and it uses ${suffix.path}... which I assume is HTL code that's somehow executed later?

Consider not generating fieldDescription by default

Hi,

I've been using the IntelliJ templates for Touch UI dialogs for a while and I find myself removing the fieldDescription attribute from automatically generated fields more often than not.

Perhaps we could drop this bit by default?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.