• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Yearbook panels sorted by grade/class - DataMerge , possible use of scripts

Explorer ,
Jan 26, 2023 Jan 26, 2023

Copy link to clipboard

Copied

I use DataMerge for about 3 years by now. But until today I'm not using any scripts to do my job.

All the thirdparties plugins are too expensive and now I want to make some things by myself.

Of Course if I can get some help with pros like you guys, will be more easy.

 

 

My true problem is to make yearbook pages. Today I make like this.

With DataMerge I create all pages with the data of the class. like

eg: High Schooll 2nd Grade - Noon Period ,

High Schooll 3nd Grade - Noon Period

High Schooll 4nd Grade - Noon Period

 

.. ...and so on.

Them one class by the time I populate the pictures of the students...With Captions

 

And I getting to work with the script inlineMerge , but that script populate all the data in one textBox.

I have to manually separate the classes.

 

My data is allways in .txt. 

Is possible to sort by class ?

I really need a script ? If I did , can you help ?

I"m learning the basics of scripts, but I dont known where to start.

TOPICS
Scripting

Views

502

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

People's Champ , Jan 27, 2023 Jan 27, 2023

Ok, I guess you can write code to do some datamerge, messing documents and so on. But, if I had to do this without any paid-for plugin, I would consider XML import.

 

I did a quick and dirty template into which I can inject data and get all the data imported in one pass. Feel free to drop an eye on attached file (remember it's a proof of concept, would probably need some adjustment).

 

Good thing is, you don't need scripting. Well theorically speaking given that your data is in Excel. So in your pos

...

Votes

Translate

Translate
People's Champ ,
Jan 26, 2023 Jan 26, 2023

Copy link to clipboard

Copied

We are always helping people who want to do efforts in order to accomplish their goals. The first question is how adequate data merge is for your project. I am having some issues understanding why it's a 2 step effort currently but I am probably missing a thing or two.

So my questions right now would be: 

1) Can you share screenshots at minimum about the end result?

1) Can you share screenshots at minimum about the initial layout?

2) Do you have control over data output (I mean the csv here)? Can it be xml if needed?

Once your project, I think we can discuss the best option and provide guidelines.

Loic

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 26, 2023 Jan 26, 2023

Copy link to clipboard

Copied

thanks in advance !

 

sure , this is a old layout . But its something like that . Some job we have the "group" shot , and the faces at side. 

I use datamerge with excell exporting in tab-delimited. (don't know , but I get some errors using .csv)

in the data we have:

group photo | individual photo | name | Grade | 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 26, 2023 Jan 26, 2023

Copy link to clipboard

Copied

Rafael_Oz_0-1674762567489.png

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Jan 27, 2023 Jan 27, 2023

Copy link to clipboard

Copied

Ok, I guess you can write code to do some datamerge, messing documents and so on. But, if I had to do this without any paid-for plugin, I would consider XML import.

 

I did a quick and dirty template into which I can inject data and get all the data imported in one pass. Feel free to drop an eye on attached file (remember it's a proof of concept, would probably need some adjustment).

 

Good thing is, you don't need scripting. Well theorically speaking given that your data is in Excel. So in your position, my challenge would be to turn my excel data into a valid XML structure I could inject into inDesign.

 

It's likely you can export data to XML from Excel (or use some CSV to XML online converter). But it will be some XML structure that won't fit InDesign. You would need to change the structure and XSLT can be used for that. XSLT is basically a file including instructions to reformat an XML structure.

 

It may sound complicated but regarding pros and cons, I would consider it. I don't think it will be specifically more complex than learning how to use datamerge with scripting plus all the additional code.

 

Here are some details:

1) The InDD template:

LoicAigon_0-1674856728607.png

What I did here is to place all items I need with repeating formatting in mind. For ex, I don't create all "students" frames, only one that will be repeated. The same apply for the "school" (i.e. all data for a specific school) that will be repeated.

2) Data

I exported a default XML and created dummy additional data (Escuela A, Escuela B, Escuela C).

<?xml version="1.0" encoding="UTF-8"?>
<schools>
   <school>
      <school_section>
         <school_name>ESCUALA A</school_name>
         <school_section_name>SECTION A</school_section_name>
         <school_picture href="file:///Users/ozalto/Desktop/escuela.png"/>
      </school_section>
      <students>
         <student>
            <student_container>
               <student_name_container>
                  <student_first_name>FIRST NAME A1</student_first_name>
                  <student_last_name>LAST NAME A1</student_last_name>
               </student_name_container>
               <student_image href="file:///Users/ozalto/Desktop/student1.png"/>
            </student_container>
         </student>
         <student>
            <student_container>
               <student_name_container>
                  <student_first_name>FIRST NAME B1</student_first_name>
                  <student_last_name>LAST NAME B1</student_last_name>
               </student_name_container>
               <student_image href="file:///Users/ozalto/Desktop/student2.png"/>
            </student_container>
         </student>
         <student>
            <student_container>
               <student_name_container>
                  <student_first_name>FIRST NAME C1</student_first_name>
                  <student_last_name>LAST NAME C1</student_last_name>
               </student_name_container>
               <student_image href="file:///Users/ozalto/Desktop/student3.png"/>
            </student_container>
         </student>
      </students>
   </school>
   <school>
      <school_section>
         <school_name>ESCUALA B</school_name>
         <school_section_name>SECTION B</school_section_name>
         <school_picture href="file:///Users/ozalto/Desktop/escuela.png"/>
      </school_section>
      <students>
         <student>
            <student_container>
               <student_name_container>
                  <student_first_name>FIRST NAME A2</student_first_name>
                  <student_last_name>LAST NAME A2</student_last_name>
               </student_name_container>
               <student_image href="file:///Users/ozalto/Desktop/student3.png"/>
            </student_container>
         </student>
         <student>
            <student_container>
               <student_name_container>
                  <student_first_name>FIRST NAME B2</student_first_name>
                  <student_last_name>LAST NAME B2</student_last_name>
               </student_name_container>
               <student_image href="file:///Users/ozalto/Desktop/student2.png"/>
            </student_container>
         </student>
         <student>
            <student_container>
               <student_name_container>
                  <student_first_name>FIRST NAME C2</student_first_name>
                  <student_last_name>LAST NAME C2</student_last_name>
               </student_name_container>
               <student_image href="file:///Users/ozalto/Desktop/student1.png"/>
            </student_container>
         </student>
      </students>
   </school>
   <school>
      <school_section>
         <school_name>ESCUALA C</school_name>
         <school_section_name>SECTION C</school_section_name>
         <school_picture href="file:///Users/ozalto/Desktop/escuela.png"/>
      </school_section>
      <students>
         <student>
            <student_container>
               <student_name_container>
                  <student_first_name>FIRST NAME C1</student_first_name>
                  <student_last_name>LAST NAME C1</student_last_name>
               </student_name_container>
               <student_image href="file:///Users/ozalto/Desktop/student2.png"/>
            </student_container>
         </student>
         <student>
            <student_container>
               <student_name_container>
                  <student_first_name>FIRST NAME C2</student_first_name>
                  <student_last_name>LAST NAME C2</student_last_name>
               </student_name_container>
               <student_image href="file:///Users/ozalto/Desktop/student3.png"/>
            </student_container>
         </student>
         <student>
            <student_container>
               <student_name_container>
                  <student_first_name>FIRST NAME C3</student_first_name>
                  <student_last_name>LAST NAME C3</student_last_name>
               </student_name_container>
               <student_image href="file:///Users/ozalto/Desktop/student1.png"/>
            </student_container>
         </student>
      </students>
   </school>
</schools>

3) Last step is to import data into template:

LoicAigon_1-1674856897082.png

 

4) Result

LoicAigon_2-1674856953440.png

Once again, not the prettiest result but it shows that XML data gently flowed into the template.

 

You get the idea. I hope it can help.

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 30, 2023 Jan 30, 2023

Copy link to clipboard

Copied

thanks. I'm not used to .xml ,  but I will try to learn . Its a great solution. 

In .xml I can use the images in a folder without using the complete path like you did?

Today I only use the name of the image in the excell file with extension.

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Jan 30, 2023 Jan 30, 2023

Copy link to clipboard

Copied

BTW, this is where XSLT can come handy because you can reformat data. In case, images wouldn't be found locally but on a specific location. But it requires some XSLT knowledge, not extremely complex but not easy at first.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 30, 2023 Jan 30, 2023

Copy link to clipboard

Copied

I'm having trouble just to understand how I can transform my datasheet to xml with that complex structure, without I'm having to manually add data . 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Jan 30, 2023 Jan 30, 2023

Copy link to clipboard

Copied

Yes, specifying a relative path works given that the resource is found. Regarding images and xml, you have to be sure images are found before importing or you will get the InDesign link not found warning. If you have one image missing, it's ok. If you have hundreds of them, you will have a bad time, believe my experience on this one 😉

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 31, 2023 Jan 31, 2023

Copy link to clipboard

Copied

LATEST

I just want to thank you ...I discover I use a lot one of your scripts "Inline Merge" to make some of my jobs. 

Like that I ask here. I basically flow all the pictures of all school in a frame and use grep to find and replace a special character that I put on between classes previous on my datasheet. To make the panels with just the individual photos, I can do without much trouble that way. 

My problem is when I have this "group" shot. Today I make in two steps. 

But thanks to bring some new horizonts .

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Jan 30, 2023 Jan 30, 2023

Copy link to clipboard

Copied

I think my (not free) Yearbook Creator add-on could help you a lot:

Yearbook Creator - Id-Extras.com

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Jan 30, 2023 Jan 30, 2023

Copy link to clipboard

Copied

Yes, Ariel, I am myself a big advocate of paid-for solutions instead of twisting your own arm trying to build complex things that editors have already solved. The ROI is often unbeatable. I was only introducing XML as a solution as our friend was looking for a "free" approach and I wish he can consider your tool 😉

Loic

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines