Tinderbox Forum

Exporting aliases with images

I have an extensive course outline with a lot of hierarchical nesting: One note for each unit, containing one note for each section of the unit, containing notes about concepts.

I’ve created a “definedTerm” prototype and set up an agent to gather all notes from that subtree of my .tbx that have $Prototype=“definedTerm”, for the purpose of creating a glossary. (Is this a common way of achieving that purpose? Is there a better way?)

The problem is that when I go to export that glossary note, none of the images embedded in its children appear. AFAICT this is because the agent contains only aliases: the images don’t show up in the Preview tab if I click on the alias notes in the agent, but they’re present in the Text tab, and if I do a Cmd+R on a note that’s missing images, I can see that they’re present in the original note regardless of whether I’m in Text or Preview.

Is there a way I can tell Tinderbox to preserve the images in aliases, when exporting? If not, is there a workaround I could use that won’t entail manually touching all the notes in my Glossary agent? (There are 122 of them.)

It is a way of doing it, but personally, I do not. I use the values in $Term attribute and action code to automatically create my glossary of terms, including indexes. This gives me much more flexibility to control the export code. You can view the last few meetups to see examples of this in action.

I can reproduce this. An embedded image on a note will show in preview. An embedded image in a notes alias does NOT show in preview.

NOTE: if you intended to export these notes out of Tinderbox, I don’t believe embedded images are exported. I find it best to externally link to an image and the pull it into a note using an template.

Testing, the answer is to copy all the images exported by the source notes (when exported as originals) from their ‘original’ location into a folder alongside the HTML file exported by the agent using the same name as the HTML file. So if the agent creates a file called “Syllabus.html”, you need to create a folder called “Syllabus” (name is case-sensitive). then you copy all the needed images to there. If you don’t currently export the originals, you’ll need to just to generate the images so you can copy them.

Personally, I never embed images for just this sort of reason. Much easier it to insert HTML into the notes needing image(s). Make a folder images , e.g. “images” and put this in the root of your exported folder. For an image called pic.png’ you’d write HTML like so:

<img src="^root^images/pic.png"/>

The ^root^ part is evaluated at export. Of course you’ll want to add height, width, etc. attributes to the <IMG> tag as well, but this gives the gist.

I don’t think the issue you’ve encountered is deliberate but nonetheless it can’t be fixed by the user in v9.2.1 other than by either of the workarounds above.

OK, thanks for the info!

1 Like

I’ll report the agent issue as I’m sure that isn’t the intention.

1 Like

Here’s a demo of the above problem: Archive 2.zip (36.4 KB)

The Zip contains a small test TBX, and its HTML export in folder ‘image-test’. In the additional folder ‘image-test2’ I have manually made a new folder 'test_agent_ and copied images there to illustrate the fix suggested up-thread.

For my 2¢-worth, if exporting to HTML is (a part of) your end point, don’t waste your time embedding images because it seems easier/less work. Use HTML inline in the $Text to use images stored outside Tinderbox. To use preview you will need to have exported the document once (so Tinderbox knows where to look for the image). But, if your plan is to export anywaythat’s no impediment as you’re going to export anyway.

2 Likes

I completely concur with this. Not only does this ensure reliable export, it also lets you manipulate the image width, height, and alt value, and start creating a library of assets that you can use for future work.

1 Like

The zip doesn’t contain the Tinderbox file.

No worries: I’m looking into the underlying question

Try this one: Archive 2.zip (6.0 MB)