6 Replies Latest reply on Jun 10, 2016 10:05 AM by Zxurian

    How to create repeating frame layout based on xml

    Zxurian Level 1

      So i've been researching for a while now, but haven't yet found a solution to this question separate

       

      I have a layout that will include an image and a captions, like so:

      e9m2aEj.png

      An image frame, with a text frame just below it.

       

      My XML is comprised of the following:

      <root>
          <field1>...</field1>
          <field2>...</field2>
          <field3>...</field3>
          <photos>
              <photo>
                  <image href="..."/>
                  <caption>Alpha</caption>
              </photo>
             <photo>
                 <image href="..."/>
                 <caption>Alpha</caption>
             </photo>
             <photo>
                 <image href="..."/>
                 <caption>Alpha</caption>
             </photo>
          </photos>
      </root>
      

       

      The question is how to repeat the photo elements, horizontally wrapping to next row, at the spacing and placement notated in the layout picture. I know I have to start with one, but everything I've found on the internet so far deals with a repeating text element, which I don't want (or can't see how it'd help me given the specific placement).

       

      Does this involve scripting the placement with wrappers for height after index % 4 = 0, or is there a way to do it natively within InDesign?

        • 1. Re: How to create repeating frame layout based on xml
          Michael Witherell Adobe Community Professional

          DataMerge won't help you here?

          • 2. Re: How to create repeating frame layout based on xml
            Cari Jansen Adobe Community Professional

            Michael is right that is probably easier to do using Data Merge, as you can step and repeat multiple records onto a single page and then generate more pages as needed.

             

            If you are looking at doing this with XML run-in, what I'd do is set up a master page that has 5 text frames (one for each row), each text frame is set up with four columns (Object > Text Frame Options). Then ensure that the images are exact size and you'd run in a sequence of images followed by paragraph text.

             

            You'd then just run-in image and caption and won't need the photo and photos tags.

             

            Another thing to consider is to use Live Captions, if the captions are XMP/Metadata associated with the images you could automatically get the caption text below the images.

             

            Hoping this helps.

             

            Cari

            • 3. Re: How to create repeating frame layout based on xml
              Zxurian Level 1

              Data merge won't work as this is complex data that cannot be represented by a single row.

               

              I've created the text frame like so: http://i.imgur.com/pfkypDv.png

              Can you clarify what you mean by "ensure the images are the exact size" ? I previously had image frames that were sized exactly how I wanted them, with the text frame below just the same.

              if I'm just running a flow of content, how would I control placement / layout?

              • 4. Re: How to create repeating frame layout based on xml
                Cari Jansen Adobe Community Professional

                That looks OK.  Did you place them on the Master Page, and also ensure they are all threaded, and make them a Master Primary text frame? (see screenshot below).

                 

                You need to process the images in Photoshop to ensure they are the exact width, height and resolution you need to have them in the layout.

                master-primary-text.png

                • 5. Re: How to create repeating frame layout based on xml
                  Cari Jansen Adobe Community Professional

                  The change you are making from your original idea is that using this workflow, you can enable Smart Text Reflow and automatically generate more pages, you won't need to tag anything but the Story frame in the InDesign template really (OK, Root > Story is enough), then map your caption tag to relevant InDesign paragraph style, and ensure that your image is wrapped in a paragraph tag that is a paragraph style that has leading set to Auto, and it should work beautifully.

                  • 6. Re: How to create repeating frame layout based on xml
                    Zxurian Level 1

                    so I must have missed that on the first lap around

                    I've got 1000+ images that will make it onto different sets of pages. Are you saying I'd have to go manually crop all of them to the exact size needed to flow?

                     

                    How would this text reflow handle multline captions? Ie, some captions are only 1 line, but some are 2, and regardless each image needs to start at the top of the row.