Announcement

Collapse
No announcement yet.

Newbie question about developing extensions

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Newbie question about developing extensions

    Hey there,

    I've been trying to create extensions for EspoCRM and I've hit a little snag. I'm following the instructions to a tee. When I try to go to my extension in UI, EspoCRM starts looking for my controller in transpiled/src/controllers. But my controller is over at client/custom/mymodule/src/controllers/mycontroller.js.

    Is there any step that I'm missing , do I have to transpile my extension, I'm not using ES6

    Thanks a bunch!

  • #2
    Hi,

    Did you run:

    Code:
    node build --copy
    Template repository for EspoCRM extensions. Contribute to espocrm/ext-template development by creating an account on GitHub.


    You can also configure a file watcher in the IDE so that changed files are automatically copied and transpiled whenever you save. https://github.com/espocrm/ext-templ...e#file-watcher

    Comment


    • #3
      Oh, I didn't use ext-template, I'm doing it the old way but in the latest version, I have a local instance that I built from source, I did grunt offline
      How can I do it without ext-template?

      Comment


      • #4
        You don't need to transpile then. Maybe you have jsTranspiled​ enabled in custom/Espo/Modules/YourModuleName/Resources/module.json

        All our extensions don't use ES6 yet, and work fine. For example, ext-real-estate.

        Comment


        • #5
          That did the trick 😍

          ​If I were to use ES6 does grunt offline do the trick or do I have to transpile another way

          Comment


          • #6
            If you want to use ES6, better to use ext-template as it has all needed tools.

            Comment


            • #7
              What does this section do ?

              Code:
              {
              "scriptList": [
              "__APPEND__",
              "client/custom/modules/{@nameHyphen}/lib/init.js"
              ]
              }
              Do I have to create /lib/init.js? What should i put inside of it ?​

              I did create using ext-template, I see this file Resources/metadata/app/client.json has been created but there is no lib folder or init.js anywhere

              Comment


              • #8
                Originally posted by goodwill View Post
                What does this section do ?

                Code:
                {
                "scriptList": [
                "__APPEND__",
                "client/custom/modules/{@nameHyphen}/lib/init.js"
                ]
                }
                Do I have to create /lib/init.js? What should i put inside of it ?​

                I did create using ext-template, I see this file Resources/metadata/app/client.json has been created but there is no lib folder or init.js anywhere
                I think i did figure it out using schema file

                JS files to include on the HTML page. Use __APPEND__ to append custom values w/o removing existing.

                Comment


                • #9
                  Sorry to bother again
                  But i have no luck using ES6 😔​ when I try to access my view it's looking for this file

                  Code:
                  site/client/custom/modules/learn-espo/lib/transpiled/src/views/learnespo.js
                  when I check the site/client/custom/modules/learn-espo/lib/ there is just init.js which is empty ( i created an empty file init.js in lib )

                  Comment


                  • #10
                    I just wanted to create a View and Template and Access it using
                    Code:
                    http://127.0.0.1/espo/site/#LearnEspo
                    I could do it using the old way but using ES6 seems I'm missing something

                    Comment


                    • #11
                      I'm not sure I understand. If you want to use ES6, I can only recommend to start from scratch with the ext-template. It's too complicated w/o it.

                      Comment

                      Working...
                      X