Welcome to TalkGraphics.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    17,746

    Exclamation 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
    Acorn - installed Xara software: Cloud+/Pro+ and most others back through time (to CC's Artworks). Contact for technical remediation/consultancy for your web designs.
    When we provide assistance, your responses are valuable as they benefit the community. TG Nuggets you might like. Report faults: Xara Cloud+/Pro+/Magix Legacy; Xara KB & Chat

  2. #2
    Join Date
    Apr 2015
    Location
    Germany
    Posts
    927

    Default 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?

  3. #3
    Join Date
    Mar 2009
    Posts
    4,501

    Default Re: Documenting Attaching Files

    Include them manually?

  4. #4
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    17,746

    Default Re: Documenting Attaching Files

    Quote Originally Posted by siran View Post
    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:
    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
    Acorn - installed Xara software: Cloud+/Pro+ and most others back through time (to CC's Artworks). Contact for technical remediation/consultancy for your web designs.
    When we provide assistance, your responses are valuable as they benefit the community. TG Nuggets you might like. Report faults: Xara Cloud+/Pro+/Magix Legacy; Xara KB & Chat

  5. #5
    Join Date
    Apr 2015
    Location
    Germany
    Posts
    927

    Default Re: Documenting Attaching Files

    Thanks Boy and Acorn. Will do some testing.

 

 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •