Documenting Attaching Files
Dear Xara...
Six years on, there is no Help information about an undocumented feature for https://www.talkgraphics.com/showthr...-A-Attach-File.
Could you confirm that using a shape with a Link > Link to file (e.g., filename.ext) and a Placeholder head code of <link rel="stylesheet" href="index_htm_files/filename.ext"/> is the more sane approach as I find adding a file to a box that then tells you nothing is barking.
Acorn
Re: Documenting Attaching Files
Thanks for the alternative approach Acorn! That might be very useful in some cases.
Maybe you (or someone else) can help out with a similar problem.
I'm trying to attach some javascript and CSS files to my document.
Using CTRL + SHIFT + ALT + A this is not a problem. Unfortunately Xara automatically includes attached .js and .css files in the HEAD section of the created htm file.
In my special use case this automatic inclusion is interfering with the functionality of some custom code. Off course the automatic inclusion could be prevented by changing the file extension. But in that case I would have to start messing around with MIME types, and my experience tells that this route should be avoided if possible.
So here my question: Is it possible to attach .js or .css files without having them automaically included to the created htm file?
Re: Documenting Attaching Files
Re: Documenting Attaching Files
Quote:
Originally Posted by
siran
Thanks for the alternative approach Acorn! That might be very useful in some cases.
Maybe you (or someone else) can help out with a similar problem.
I'm trying to attach some javascript and CSS files to my document.
Using CTRL + SHIFT + ALT + A this is not a problem. Unfortunately Xara automatically includes attached .js and .css files in the HEAD section of the created htm file.
In my special use case this automatic inclusion is interfering with the functionality of some custom code. Off course the automatic inclusion could be prevented by changing the file extension. But in that case I would have to start messing around with MIME types, and my experience tells that this route should be avoided if possible.
So here my question: Is it possible to attach .js or .css files without having them automaically included to the created htm file?
siran, if I understand your question; setting up a box with a Link > Link to file on its own simply ensures the external asset appear in the index_htm_files folder. You also have a link, that if clicked, will open that asset (if it is a stylesheet, say). So I magic the link away with a <div></div> in the box's body code.
To go a step further. https://developer.mozilla.org/en-US/.../Element/link:
Quote:
A <link> element can occur either in the <head> or <body> element, depending on whether it has a link type that is body-ok. For example, the stylesheet link type is body-ok, and therefore a <link rel="stylesheet"> is permitted in the body. This isn't however best practice; it makes more sense to separate your <link> elements from your body content, putting them in your head.
So I assume that <link rel="stylesheet" href="index_htm_files/filename.ext"/> in the body code (instead of <div />) places the link in the body immediately after the <a> link for the box and will load up at that point.
In either case, the external asset is available in the index_htm_files folder and could therefore be conditionally invoked and add it to the DOM through some scripting.
Acorn
Re: Documenting Attaching Files
Thanks Boy and Acorn. Will do some testing.