Creating a Repeating Paragraph Using Drag and Drop

Top Previous Topic Next Topic  Print this topic

You can create Repeating Paragraphs easily by utilizing the drag and drop functionality directly from the Data Source Pane. In this section, we will use an example providing a list of offered books and a description of each all obtained from the data source from a repeating element called "Product".

 

1. Enable the Data Source Pane by selecting the Data Source button located in the Home Tab of the Ribbon.

 

2. You will need to determine which element in your data source that you want to generate a paragraph for every occurrence of this element. For our example, the information all resides in a repeating element called "Product".

 

reppar1

Figure 1: The Product element repeats in the data source containing the information to be displayed.

 

3. Once you have determined which element the paragraph will repeat for, select the element in the Data Source Pane and drag into the Design Surface. Release the mouse in the desired location and you will be presented with a contextual menu. Here you must select Repeating Paragraph.

 

reppar2

Figure 2: The contextual menu presents the option to add a Repeating Paragraph.

 

4. Notice in the Design Surface that a Repeating Paragraph is now inserted. You should be aware that you will have a visual indication of which element the paragraph repeats for and the paragraph will be highlighted in blue indicating that it is a Repeating Paragraph.

 

reppar3

Figure 3: The Design Surface provides visual indication of a Repeating Paragraph.

 

5. Next, you will need to replace the placeholder text with the content you wish to be displayed. Here you will simply highlight and delete the placeholder text and add the relevant content you wish to display for each occurrence. In our example, we will add the product "name" attribute as well as the "description" attribute with some static text "Product Description". When inserting Fields into the Repeating Paragraph, the Publisher will automatically take into consideration the repeating context of the paragraph. Additionally, we have added an additional space to separate the content when it is repeated.

 

reppar4

Figure 4: The content is added inside of the Repeating Paragraph.

 

6. When you have finished adding the content that you wish to be presented in each paragraph, you should preview your output to ensure that the content is retrieved from your data source and displayed properly. As you can see in Figure 5 a new paragraph is created for each "Product" element displaying the information relative to every occurrence of the "Product" element.

 

reppar5

Figure 5: The Repeating Paragraph displays information for every product appropriately.