We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34293
    • 3 Posts
    Hi There this a newbe to MODX

    I started doing new component (Extra) yesterday and basically I did the following:

    - Creating the default page for the extra, so when the user clicks on the menu item inside the components menu tab for that extra, it will take them to the default page which contains the grid to show the data stored in the database.
    - In top of the grid, there is a button which says "Create new item", and basically by clicking on it, it will open a window containing a form to submit new item.
    - The form contains two fields to upload files, but then I realized that the form submission is done via AJAX :’(, which then you can not use to upload a file.
    - So now I’m thinking about creating a new page that after clicking the button "Create new item", a new page will show up and the form will show up (Pure HTML).

    So here some issues I’m having

    - In terms of setting up the Actions and menus, what is the best to do, so if I have a page with pure HTML (Nothing to do with AJAX or EXT.JS), how do I set the action and menu for that page?

    So far I created an action inside the action to the default page and I put "controllers/add_edit_items", and then I created a sub-menu item inside my component menu item, and I gave it the action I created before (controllers/add_edit_items).

    - Another thing, that page has a form, what is the value for the action in the form tag.

    - Finally, lets say that I managed to solve all the issues above, how can I redirect to the home page (Default page of my component), basically I can get the id for the action, but I don’t want to hardcode the id.

    I hope someone can answer some of the questions above, and if you need more info please let me know, and I will post more information

    Thanks in advance
      • 4172
      • 5,888 Posts
      its possible to use the filemanager for uploading files in your CMP.
      If you would try xdbedit to create your CMP you could use a image or file-TV as a form-field.
      you can get xdbedit on github (see my signature) if you want to try it.

      you can also have a look to the gallery-extra how image-upload is done there.

      Simple pure html-CMPs I do with quickCMP, where you only have to create snippets in a given category to get your CMPs.
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 36420
        • 9 Posts
        Hi Bruno17

        Thanks for the reply

        Your suggestion kinda gave me an idea on how to rework my solution for uploading the images.

        Basically I stored the item without the images, and then on the grid I showed a link to upload an image, so when the user clicks on the link, a window will show up with two Dataview and the bottom Dataview will get all the images from the assets and the user will drag the image to the top panel and the image path will be saved against the item.

        So far so good, I started working on the dragging the image