6 Replies Latest reply on May 13, 2016 8:56 AM by mumu38

    Merge fields formatting

    mumu38

      Hi everybody,

       

      I use merge fields in a text box with a specific text format for each field.

      All fields are separated by a ¶

       

      Here was my first try : I selected each line (double click) to apply the chosen text format

       

      <UPPERCASE><<Field 1>></UPPERCASE>

      <plain text><<Field 2>></plain text>

      <plain text><<Field 3>></plain text>

      <Bold><<Field 4>></Bold>

       

      And here is what I got, when no field was empty :

       

      FIELD 1

      FIELD 2

      Field 3

      Field 4

       

      Here is my second try : since the is not visible, I placed the pointer just after the field to extend the selection, including the ¶ :

      <<Field 1>>

       

      <UPPERCASE><<Field 1>></UPPERCASE><plain text>

      <<Field 2>></plain text>

      <<Field 3>></plain text><Bold>

      <<Field 4>></Bold>

       

      And here is what I got, when no field was empty :

       

      FIELD 1

      Field 2

      Field 3

      Field 4

       

      But here is what I got when field 3 was empty

       

      FIELD 1

      Field 2

      Field 4

       

      So, I got what I wanted, by formatting like this :

       

      <UPPERCASE><<Field 1>></UPPERCASE><Bold><plain text>

      <<Field 2>></plain text><Bold>

      <<Field 3>></plain text><Bold>

      <<Field 4>></Bold>


      And now I finally get what I expected :

       

      FIELD 1

      Field 2

      Field 4

       

      It works properly if Field 2 and 3 are both empty.

       

      It took me no small amount of time to figure it out.

      Since the   is not visible, I had to place the pointer just after the field to add a format :

      <<Field 1>>┃, but, when it’s saved, it looks like the format is placed at the beginning of the next line (as it should be). Thus, if something is wrong you must do it again from the beginning.

       

      Is it a specific malfunction on my Mac or a peculiarity of merge fields ?

      I’ve not found any information on this bizarre formatting technique, neither in the FMP documentation nor in this forum discussions. But maybe I was not looking well enough.

        • 1. Re: Merge fields formatting
          beverly

          merge field formatting actually holds the format in the first "<" of the field! So you can have the format at 18pt on this character and the rest of the 'string' set to 9pt and the entire phrase (of the merge objects) will be 18pt.

           

          Given that the return is an object, it can have it's own formatting, if desired. As with regular text in a layout object with a combination of text and merge fields and merge symbols ({{RecordCount}}, for example) and tab, return and spaces, each of these "objects" can have different text formatting.

           

          beverly

          • 2. Re: Merge fields formatting
            mumu38

            Thank you for your reply.

            I do use the first "<" and last ">" just as you suggest, with the text inside set to 6pt. My first example shows that the first "<" of the second line was included in the "plain text" formatting, but like I said, it didn't work till I made the formatting include the return object.

             

            Maybe I should precise that the model that contains the text box is used to edit a PDF document. But anyway, the preview gives the same results.

             

            Éric

            • 3. Re: Merge fields formatting
              beverly

              OK, by screen shot:

              Here is the layout mode. I have formatted ONLY the first "<" of the merge fields (not the rest of the text.

              layout_formatting.jpg

              here is the same in browse mode. note that empty fields are blank as Merge Fields, too. objects slide.

              layout_browse.jpg

              (Field1 merge field has Uppercase applied to the first "<", but is empty, so the merge field is empty.)

              HTH,

              beverly

              • 4. Re: Merge fields formatting
                mumu38

                I tried it : unformatting all, then formatting the first "<" of each line only, and it works well.

                 

                Thank you very much.

                 

                But still, I think it's not very well explained in the FMP documentation (which I usually find clearer after several days of hard thinking and trial and errors).

                 

                Éric

                • 5. Re: Merge fields formatting
                  beverly

                  right! this does not explain that you can format just the first "<":

                  Placing merge fields on a layout

                  But it does explain that blank merge fields will slide left and up.

                   

                  Also note, that if you format a field (as a field) on the layout or format the contents of the field (in the field in browse mode), that formatting appears in the Merge Field (unless over-ridden by formatting the "<" or the entire merge field object).

                  beverly

                  • 6. Re: Merge fields formatting
                    mumu38

                    Always precise and concise in your answers

                     

                    The sliding of the merge fields was the reason why I used them. It was my wrong formatting that was disturbing.

                    Your solution is pretty much cleaner and faster than my convoluted workaround.

                    Thanks again

                    Éric