We map the imported XML file by dragging and dropping elements from the Structure panel into the document or assigning tags to the document from the Tags panel.
Start by assigning the car’s root element with a specific object within the document. Do this by selecting a car from the Structure panel and dragging it over the main text frame on the first page. The frame will then be populated with all of the values and images that are contained within the car’s structure.
All fields are marked with square brackets and labeled with colors that match the Tags panel.
Be aware that some unwanted characters may have been inserted alongside the imported fields (e.g. tab and paragraph return characters). A useful tool for removing these characters can be found by selecting the text and choosing Edit -> Edit in Story Editor.
Reveal hidden characters by choosing Type -> Show Hidden Characters. Then proceed to delete any that are unnecessary.
Note: making text changes directly within the text frame offers the same results as edits made in the Story Editor, but using the Story Editor shows XML fields’ full names (vs. only simple brackets). This extended form can drastically simplify the editing process.
We can now customize our fields with InDesign’s graphic tools (paragraph styles, character styles, frame options etc.). In our example we’ve added labels before each field and given these labels a bold character style.
We can also make changes to the fields found above our main image – BRAND, CAR_MODEL and TYPE. We start this process by creating paragraph styles called ‘Brand’ and ‘Model’.
Next click on the top-right menu in the Tags panel and click on ‘Map Tags to Styles’. This will display a dialog box in which we can assign one of our paragraph styles to each tag – so in our case the ‘Brand’ paragraph style to the BRAND tag and the ‘Model’ paragraph style to the CAR_MODEL and TYPE tags.
Clicking ‘OK’ should reveal the following result:
Our final customization step involves adjusting the image frame. Start by selecting the frame and reducing the width. Then right click inside the frame, select Fitting -> Frame Fitting Options and selecting ‘Auto-Fit’ and ‘Fit Content Proportionally’. Ensure that all ‘Crop Amount’ values are set to 0. All newly imported images will now be fitted to the same frame size.
We’ve now completed the graphical customization. The following screenshot compares the preview and standard versions of our car style:
Save the document as an InDesign template (.indt format) and then close and reopen it.
The close and reopen step is important as we’re now opening an unnamed template instead of a named document. We can therefore reuse the template across numerous projects, which is especially useful if you’re creating huge catalogs, e.g. to have different, custom-named documents for each category.
How did you add the line border in the template? No matter where I add a dotted line or use Shift+hyphen to get a continuous line, the paragraph styles and tags of the imported xml gets messed up
I have a question about images import
I have to produce pages that include
and a photo of the athlete
Is there a way to have the xml look into subfolders to find images
Also the only common attribute for the athlete is there last name
However sometimes the image file will be named
So is there a way to have the xml look for just a part of the athletes name as a variable since the image file names are all over the place.