9 Replies Latest reply on Nov 7, 2014 7:15 AM by MW Design

    Paragraph styles forced line break

    Comms Mike

      Hi,

       

      I currently have a product list that displays product code, description and price. I'm having an issue with the next product not dropping to the next line and keeping the correct formatting. I setup the story mode originally with the first product to have the correct formatting but once I import the updated xml file the new data doesn't format correctly.

       

      I have attached images of how I want the formatting to look and how it is currently working. As you can see the price follows the next product...any idea where I'm going wrong?

      incorrect formatting.pngcorrect formatting.png

       

      As this is going to be an automated list within indesign with a lot of entries I can't manually force a line break each time. Hopefully I've made myself clear but if you have any questions I'll try my best to answer them.

       

       

        • 1. Re: Paragraph styles forced line break
          Doc Maik Level 4

          Is this just text or a table with invisible frames?

          Are you using spaces to fill the gaps or tabs? The screenshot is so tiny.

          • 2. Re: Paragraph styles forced line break
            Comms Mike Level 1

            Sorry I didn't make myself clear with the original message...the product code, description and price are all separate tags within an XML document. Once they are bought into indesign they are separated by tabs using paragraph styles. I haven't used any tables for the screenshots attached. Within story mode I set a paragraph return after the first price before importing the remaining records. Unfortunately when the remaining records from the XML is imported it drops the price down onto the next line (so it doesn't separate the individual records)

            • 3. Re: Paragraph styles forced line break
              MW Design Level 4

              Turn on being able to view your tabs and returns (Type menu, show hidden characters). My first thought is those are not returns causing the prices to drop but rather the decimal or right aligned tab stops not allowing the price to remain on their appropriate lines. You may only need to move the price tab stop a little to the left.

               

              It can also be an issue in the XML, but I would inspect the above first. If the above isn't it, please post the XML for your info in the screen shot.

               

              Mike

              • 4. Re: Paragraph styles forced line break
                Comms Mike Level 1

                Thanks for the reply, I have attached a screenshot which shows the structure with hidden characters. The first screenshot shows the structure before importing all the data, the 2nd shows how the structure changes after importing all the xml file. The paragraph drops to the bottom line of the structure and leaves no space between the price tag and the next product.

                 

                before complete xml file (story mode).png

                after complete xml file (story mode).png

                 

                I have attempted to move the tab for the price and it drags the next line up with it. I have also attached a screenshot of the import options, it is currently setup to ignore white spaces within the xml document.

                 

                xml file.png

                import xml settings.png

                Hopefully I've given you enough detail here on the structure but if you need anything else give me a shout

                • 5. Re: Paragraph styles forced line break
                  MW Design Level 4

                  A couple things...one, it would have been good for the actual XML, not a screen shot. But your screen shots might be OK.

                   

                  It looks like you have tabs in the XML itself...or a bunch of spaces. Don't know which. And you are electing to strip them in the import options. Which all might be why in the story editor all the returns are being stripped (except the first one after the headings). Have you tried without stripping the whitespace?

                  • 6. Re: Paragraph styles forced line break
                    Comms Mike Level 1

                    <subcategory><subcategory_product_pricelist>

                         <product>     <product_id>TEST1</product_id>     <product_description>Description 1</product_description>     <product_price>17.99</product_price></product>

                         <product>     <product_id>TEST2</product_id>     <product_description>Description 2</product_description>     <product_price>35.98</product_price></product>

                         <product>     <product_id>TEST3</product_id>     <product_description>Description 3</product_description>     <product_price>28.00</product_price></product>

                         <product>     <product_id>TEST4</product_id>     <product_description>Description 4</product_description>     <product_price>29.50</product_price></product>

                    </subcategory_product_pricelist></subcategory>

                    You're correct I had put tabs between each tag, only reason I had done that was to make it easier for me to go back and edit. For some reason I thought that indesign would still interpret a new line even if I turnt off importing white space.

                     

                    Going by what you've just said I have sorted out the tabbing within my xml file and since imported it into my document. The product list now displays perfect.

                     

                    Thanks for your help with that, though I do have one question relating to this...

                     

                    If for example my xml file didn't contain tabs but I wanted to force a new line break after each price tag, how would this be achieved?

                     

                    Thanks again for your help with this

                    • 7. Re: Paragraph styles forced line break
                      MW Design Level 4

                      Hi CM,

                      If for example my xml file didn't contain tabs but I wanted to force a new line break after each price tag, how would this be achieved?

                      It really depends on the way the XML file is formatted, but just the line breaks in the XML at the end of the price tag should work fine. But, especially for what I ascertain from your job, I always add tabs into the XML when it is the same/similar task. I just don't strip out whitespace when I do it that way.


                      One reason I put the tabs in is if in the process of laying it out I need some or all of the data in a table, I use the text to table and apply the table style. Depending on the job, this is usually a faster/easier process than writing/changing an XSLT to group the data into either ID's own table format or CALS tables (but I also do that once in a while).


                      Mike


                      • 8. Re: Paragraph styles forced line break
                        Comms Mike Level 1

                        That is brilliant, thanks for taking the time to go through it. Will help for the future that's for sure

                        • 9. Re: Paragraph styles forced line break
                          MW Design Level 4

                          You're very welcome, CM.

                           

                          Best regards, Mike