We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 46886
    • 1,154 Posts
    Ok good I am glad its clear, its not that you didn't write clearly, just being absolutely sure. Sometimes the terminology can be weird.

    Ok so the tpl issue is really, really weird, if the code is the same then the output should be the same.

    But, you can edit the default tpl anyway. Still, that is strange.

    Let me try an break up the issues

    1. Split output

    To split up the output you could make a new selector system with [[+title1]] or another name, and then the outputs would be distinct it could look like one thing to the customer, but would be saving in a different place. That's the tv.

    Then in the output could put one bit of output on top, something else in the middle, and the other output on the bottom.

    Does that make sense to you? I mean you copy everything that works and change the important bits...hmm its a little complicated.

    To see your tvs, could you go to the resource which is the page that the selector form is on, and scroll down to see if you have some sort of list down there, with a title for it, and some lines. It should be there.

    We can talk about that tv, I just implemented one recently, they are a little tricky but not that bad.


    2. Styling email

    If the email is arriving with the right info, then you just need to style that tpl with the html you want around the data output.

    Try putting this html around the output in the tpl, put the output code where I wrote 'Replace this line with the output code'.

    If the email has a blue background after you do this then you are on your way.

    <!DOCTYPE html>
    <html>
    <head>
    	<title>My Website</title>
    	<meta charset="UTF-8" />
    	
    	<style type="text/css">
    		* { font-family: Verdana, Arial, sans-serif; }
    		body { background-color: #99ffff; cursor: default; }
    		h1 { font-size: 15pt; }
    		p { font-size: 10pt; }
    	</style>
    </head>
    
    <body>
    
    
    Replace this line with the output code
    
    
    
    </body>
    </html>
      • 54524
      • 34 Posts
      Good, yeah I think it's very wierd, but the main problem will be that I type the wrong things.

      1. What do you mean with selector system? I totally don't understand what you're trying to say. I just want to do it the way it should be done. There must be a way.
      2. I've used styling, this always works fine. I copied it and indeed it is visible. Never had problems with the styling.
      3. I think there must be something wrong with my calls: [[+title]]:[[!FormItIsSelected?]] is just not working. But what's wrong with it?

      Is there anyone who can tell me how I should do this? I really want to have a good solution.
        • 46886
        • 1,154 Posts
        Ok good we have narrowed things down. Good that the styling is working at least.

        3. I think there must be something wrong with my calls: [[+title]]:[[!FormItIsSelected?]] is just not working. But what's wrong with it?


        You are trying to put this code in the email, isn't that right? Or are you trying to change the checkboxes to selectors?

        I thought we decided that the email is working with the data, you said the email has all the right information? The default template email you said provided all the data from the form, isn't that right?

        We can definitely work on that part of your system.

        When I wrote 'selector system', sorry I was unclear. I mean this part of your system

        <ul>[[getImageList? &tvname=`Bestellijst` ]]
        [[+numbers[[+MIGX_id]]:notempty=`
        <li>[[+title]]:[[+numbers:FormItIsSelected[[+MIGX_id]]]]</li>
        `]]
        </ul>


        Is this the part that isn't working?
          • 54524
          • 34 Posts
          Indeed.
          Yes I did, but the thing is: I have no idea what I need to put in the email tpl. That is like my main question. Which seems to be difficult because of the use of migx and selecting the numbers. I don't want to use a checkbox, I want to keep the select options as I have right now.

          I know that the data in the form get saved in Formit but I want to know how I can get these information in my own created email tpl.

          The 2 codes you copied above are 2 things I tried in the email tpl. But it doesn't seem to work. So my question is, how should this look like?

          I have no idea because I couldn't find any examples for this case. So I'm just doing what seems logic for me.
          So what do you think when you see the codes? Should it work?

          Sorry for the confusion.

          But I need to get it work quick, already spend so many hours on this.
          I really hope anybody can help me.

            • 54524
            • 34 Posts
            Most frustrating this is that there is this page: https://docs.modx.com/extras/revo/formit/formit.tutorials-and-examples/formit.examples.simple-contact-page. A great example which helps me with selecting the numbers. But then (for me the hardest part) creating the MyEmailChunk (Tpl Chunk):

            This is the Formit Email Chunk.
             
            <br />[[+name]] ([[+email]]) Wrote: <br />
             
            [[+text]]


            Doesn't say anyting about these select options.

            How should I now what to type in the Email Chunk?
              • 17301
              • 932 Posts
              This is a long thread to read and process so forgive my ignorance (as I've not read it all) but from what I can tell you're just trying to output the select value into your chunk? And options for the select box are being populated by a MIGXTV?

              If your select has the name of 'mySelectBox':

              <select name="mySelectBox">
                <option value="1" selected>1</option>
                <option value="2" selected>2</option>
              </select>


              Then in your chunk you just need to call [[+mySelectBox]] not the MIGX call
                ■ email: [email protected] | ■ website: https://alienbuild.uk

                The greatest compliment you can give back to us, is to spend a few seconds leaving a rating at our trustpilot: https://uk.trustpilot.com/review/alienbuild.uk about the service we provided. We always drop mention of services offered by businesses we've worked with in the past to those of interest.
                • 46886
                • 1,154 Posts
                Ok good, the email styling isn't too bad. I know it does take time, especially when you are learning how all the parts work.

                Here is a jazzed up version of the basic code I posted before https://gist.github.com/Nuan8/b182846c81e0312f245267ec2a3efeaa

                I've got a light background style and a special area with white background, then the tool output goes below.

                You can paste it into this website to see what it looks like and play with it http://htmlsandbox.com/, and you can validate any changes you make from that page as well, the middle part of the validator is all that matters, there are three and only the middle is useful.

                With that site you can get it looking just how you like, then validate the code, then copy paste it into your tpl file!

                What else do you want in there? A picture perhaps?
                  • 46886
                  • 1,154 Posts
                  Good one LK, I think that's in there with [[+title]]. Your info makes that clearer. But wait, the output she is getting seems to be with the code [[+fields]]

                  One bizarre thing is that the default tpl works but a custom tpl doesn't, it processes differently it seems.

                  We want to break up the output of MIGX in the email, but I feel that's pretty tough. Like if it has 5 values, to insert something between the output of values 3 and 4 seems tough to me.

                  So I said to copy the MIGX tv and make a second one makes more sense but I could be wrong. Then the first can be outputted in the email, then the second one, with something between. But, that process isn't so easy either. [ed. note: nuan88 last edited this post 5 years, 8 months ago.]
                    • 46886
                    • 1,154 Posts
                    @marielvdoever

                    The gist I posted should have everything you need for the email tpl, at least to get started. Its got name, email, and the [[+fields]] code which gives you the order information.

                    Do you have a place for the customer to provide a comment or message? That would be the [[+text]] in the bottom of the form, if there is no output then you should see nothing there
                      • 54524
                      • 34 Posts
                      Thanks for your reactions!

                      LK: I just tried exactly what you said. It works in a way that I get an output, I get one value in my mail! Which is great, but now is the next question, how can I get all the values? I have got a whole list of products and values. The select box are not being populated by a MIGXTV, I want these just zero till 10 for every item. What is created by the MIGXTV are the titles (names of my products).

                      I was thinking that this would work:
                      <select name="mySelectBox[[+MIGX_id]]">
                      		<option value="0" selected>0</option>
                      		<option value="1" selected>1</option>
                      		<option value="2" selected>2</option>
                      		<option value="3" selected>3</option>
                      </select>


                      With in the email tpl:
                      [[+mySelectBox[[+MIGX_id]]]]


                      But it doesn't.
                      How can I make this work?

                      Another question will be, how can I get the list op products (MIGXTV) in the email template?
                      I would like to show only the products with a higher value then zero selected.
                      The list should for example look like this:
                      Product name: 1
                      Product name: 4
                      Product name: 3