Back

If your email is not recognized and you believe it should be, please contact us.

  • You must be logged in to reply to this topic.Login

Using XML to automatically create category headers at the top of each page

Return to Member Forum

  • Author
    Posts
    • #79117
      Anonymous
      Inactive

      Photo of what I am looking to do: https://i.imgur.com/z3fCE0q.png

      Hey I’m making a membership directory and I need to list each business in their own category (Also some businesses might show up in more than one category)

      At the top of the page you will see a quick design of how this would look that will change I just do not understand how to make the headers happen. I can get the data to follow just fine but Category 1 and Category 2, that part is blowing my mind away! I could just make multiple XML pages and have a different XML page for each category however for companies that fall into multiple category I would then have to make sure to edit their entry in each sheet.

      I’m using XML because our directory changes so regularly that it saves me a TON of time to enter their info in Microsoft Excel, export to XML and then to update the file in Indesign. However I think that this could be done with a data merge as well, so I am not 100% dead set on saying with XML data.

      Thanks!

      TL:DR I need to put categories into the tops of each page of a membership directory based off of XML data

    • #79202
      Anonymous
      Inactive

      Just going to give this a bump in hopes someone notices it

    • #79203
      David Blatner
      Keymaster

      Well, my rule is “if there’s any way to do it without touching XML, then do that.” There are exceptions, but if you can do it with data merge, I’d strongly suggest that. One problem with data merge is that you cannot have a field that contains more than a single paragraph. I can’t tell from this example if you need that.

      Is the challenge of changing the categories a matter of changing the text? Or changing the color? It might be easier to flow the whole thing and then do a quick find/change to find all “Category 2” and assign a paragraph style with a blue background, for example.

    • #79210
      Anonymous
      Inactive

      It is mostly the flow, the category colors are all things I can handle.

      I have attached my files here:

      https://drive.google.com/file/d/0B4JiC5fZtC4gSjJVb1h6QTZZT1U/view?usp=sharing

      More or less the flow I want is:

      Step 1) I import my XML into InDesign.
      Step 2) InDesign takes my data and lists all of the businesses that would be in Category #1 and puts them in Category #1.
      Step 3) InDesign makes a new page for items in Category #2.
      Step 4) InDesign takes my data and lists all of the businesses that would be in Category #2 and puts them in Category #2, as well as making sure any businesses that where listed in Category #1 is also listed in Category #2.
      Step 5) Step 3 and Step 4 repeat until the data is 100% flowed.

      This might be something InDesign can not do and I understand that, but I would like to know the best way I could recreate this effect

    • #79211
      David Blatner
      Keymaster

      It’s hard for me to know, but my guess is that if the company shows up in more than one category, you would likely need to either write a script to handle that (everyone I’ve talked to about XML seems to say “oh, yeah, you’d have to write a script or XSLT to handle…” such-and-such), or you would have to set up the data correctly (repeating the company, once for each category).

      But I’m really not an XML specialist. If you massage the data right, you might be able to pull it off with data merge, a script, and possibly anchored groups of frames.
      https://creativepro.com/data-merge-into-inline-anchored-objects-so-they-flow-in-a-story.php

    • #79218
      Anonymous
      Inactive

      Yeah I’ve only learned a tad bit about XSLT and I saw a video on Lynda about these not that you mentioned it:

      https://www.lynda.com/InDesign-tutorials/Importing-file-completed-layout/53705/69601-4.html

      Still it boggles my mind

    • #79240

      Richard,

      Looking at your XML, I see nothing that separates the category 1 from the category 2 entries. It’s all just one big XML file where each entry is simply BusinessData. I do see on Sheet1 (2) of the XSLX file there are categories, but those categories are not in the XML samples.

      Even with scripting, there would have to be something to delineate each category for a script to work. The same applies to an XSL/XSLT instruction. So the categories from the above sheet have to be in the output data that would some into ID.

      Another option would be to use EmData’s InData to parse a tab-delimited file and put the data where it belongs. Even so, it would need a properly written script in InData to loop through as it was building the presentation data to have entries where they belong. This can also be done with an XSLT by it physically copying entries to the succeeding categories. I find writing the script/instructions for InData easier than XSL/XSLT files.

      Likely all this could be obviated by building a proper Access database to manage these entries where one can pick and apply multiple categories to an individual entry. Then the XML or CSV output file from Access would simply have entries show up in their proper categories. Once that file is output properly, it would then be a matter of making the paragraph styles’ keep options to force a new page or column at the category change if desired. And a proper database has other advantages for long-term use too.

      This is simply all off the top of my head. Any which means you go it will be a hefty learning curve.

      Mike

Viewing 6 reply threads
  • The forum ‘General InDesign Topics (CLOSED)’ is closed to new topics and replies.
Forum Ads