Too many FileAttachments #1956
-
I had an idea to make a page in a Framework project that would display a little blurb each day, along with an SVG of an icon that relates to the blurb. This is looking to be a digital version of a calendar I put together a while back with icons I've made and some generated text. My naive approach was to have an SVG for each day, then create an object that could look up to get the relevant SVG:
This was after consulting the Framework docs and seeing a similar setup to load frames as a bunch of file attachments. However, this seems to get out of hand for larger sets, for example having 300+ attachments and then calling something like I'm wondering if people have thoughts on how I could improve this setup to load the correct SVG based on the day. Specifically, with this setup using a bunch of FileAttachments. Open to other formulations. As I draft this, I'm thinking I could also maybe load the SVGs from an external repo (?), though there may be a challenge displaying the image dynamically. The data doesn't need to change, so no need for periodic data loaders, though I feel like I'm being stymied by the loading of the images. My thinking was I had to use FileAttachment to make the SVGs available, but maybe there's a way of simply storing them and passing the path to them (if they are public). Anywho... Boiling off, the main idea:
Appreciate any insight, cheers! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The page is not supposed to download an attachment that is only declared as a reference. The actual loading only occurs when you call a method that accesses the data. Can you share your code or, if there is indeed a bug, try to share a minimal repro? |
Beta Was this translation helpful? Give feedback.
Looks to be working now, I think I had an error in how I was parsing the images. You're right, looks to only load the referenced image. Thanks!