Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Using attached data as src for CSS and JS inside HTML Macro?

Greetings fellow Atlassians, i wanted to ask you whether (and if yes how?) it is possible to link attached files of a confluence page as source for the style / script for my HTML-Script inside of a HTML Macro.

Thank you for your help.

1 answer

Hi @Jo Ro ,

If I understood well you have a CSS and JS files attached to a Confluence page and you'd like to use them in your HTML macro. If this is the case, maybe you can add in the macro:

<link rel="styleshhet" href="/your_site_name/download/attachments/page_id/your_styles.css">

<script src="/your_site_name/download/attachments/page_id/your_scripts.js"></script>
  • Your_site_name is the pathname for your site. If the URL to reach Confluence is something like www.johannesrother.com/confluence, /confluence is the pathname
  • You can find the ID of the page with the attachments (page_id) by, for instance, viewing the page information (Tools menu). In the URL you will have something like /your_site_name/pages/viewinfo.action?pageId=page_id (e.g. 52691589). This is the page_id you should use in the path of your link and script tags.

Hope it helps.

Vitor

Hi @Vitor LC , 

thank you for your answer. 

Finally i was able to test whether this option is working but sadly it isn't.

Is it possible that empty spaces in the page name have to be decoded for the link?

 

 

Thanks for your help.

Normally not. What are you getting?

There was a problem with the spaces in the pages title, but i was able to resolve that problem by substituting them with "+".

 

Sry for the late answer.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Confluence

Announcing Team Calendars in Confluence Data Center

Hi Community! We're thrilled to share that Team Calendars for Confluence is now a built-in feature for Confluence Data Center releases 7.11 and beyond.  A long time favorite,  Team Cale...

101 views 0 3
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you