Giter VIP home page Giter VIP logo

Comments (5)

berteh avatar berteh commented on August 30, 2024

hello.

In the current implementation %SG_NEXT-RECORD% is not to be considered a variable, but rather a signpost in the SLA template file that instantly loads the data of the next record when met to be used for the current and subsequent substitutions... and the SLA template file is read by ScribusGenerator as a plain text file, in sequence, since Scribus was not using much of the XML nesting features.

So its effect really boils down to either the moment you include it in your template (in your case I'd recommand to remove all but firt 2 cards content (with variables and all ready), then add a text frame with simple content %SG_NEXT-RECORD% (if it's empty it will be removed by SG), and then add all content of second row. No need to create extra pages if your content is the same: the first page will be duplicated to fit the provided data length.

a more detailed walktrough for %SG_NEXT-RECORD% is available at https://github.com/berteh/ScribusGenerator/wiki/How-to-use-%25SG_NEXT-RECORD%25

any suggestion to improve this feature is welcome, especially along with a PR.
B.

from scribusgenerator.

mlewis-everley avatar mlewis-everley commented on August 30, 2024

Thanks for the response. I think what you are saying is what I expected :-/

I have already tried what you suggest (I added a text frame with %SG_NEXT-RECORD% between the first row and second) but the first card on the second row only seems to have ~50% of the variables correctly updated (the rest are from the previous record).

I have checked the outline view and the text field with %SG_NEXT-RECORD% appears to be located in the correct place. Looking at other issues and the wiki, is it safer to assume that the XML generated by Scribus is not a direct representation of the outline? Or, is it that Python doesn't load the XML nodes in sequential order?

from scribusgenerator.

berteh avatar berteh commented on August 30, 2024
  1. indeed the XML generated by Scribus is not a direct representation of the outline. things such as parent page, groups, levels, inline images and some more are coded as plain text attributes and not the XML hierarchy. Scribus stores the elements more or less in the order of creation.

  2. the scribus generator (currently) loads the XML exactly in sequential (textual) order, not hierarchical (the outline).

If you are comfortable witḣ reading XML code, the easiest way is to open the SLA template with a text editor and move the element containing %SG_NEXT-RECORD% to the location that suits your needs (I'd guess just below all the content of your first row). I isually add meaningful IDs to my object properties, so finding them with a text search goes fast.

from scribusgenerator.

mlewis-everley avatar mlewis-everley commented on August 30, 2024

Thanks for the reply (and clarification). I can understand now why this is so annoying to implement!

I am fairly familiar with XML, thought I cannot say I enjoy it much :-p. I will have a play around and see what I come up with,

from scribusgenerator.

berteh avatar berteh commented on August 30, 2024

good luck !

any improvement to the documentation is welcome directly in the wiki at https://github.com/berteh/ScribusGenerator/wiki/How-to-use-%25SG_NEXT-RECORD%25

or if you have a better idea for the overall workflow don't hesitate to open a new issue on that topic !

from scribusgenerator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.