Sketchfab Macro

Hello, I'm trying to add a macro to my editor so that this html code will get executed with the user only supplying the last field of a URL. Here's the code:

<iframe width="640" height="480" src="https://sketchfab.com/models/3e687de1cfe141b7b0f6fc664944a8de/embed" frameborder="0" allowfullscreen mozallowfullscreen="true" webkitallowfullscreen="true" onmousewheel=""></iframe>

<p style="font-size: 13px; font-weight: normal; margin: 5px; color: #4A4A4A;">
    <a href="https://sketchfab.com/models/3e687de1cfe141b7b0f6fc664944a8de" style="font-weight: bold; color: #1CAAD9;">Scene_000</a>
    by <a href="https://sketchfab.com/fpg" style="font-weight: bold; color: #1CAAD9;">Foul Play Games</a>
    on <a href="https://sketchfab.com" style="font-weight: bold; color: #1CAAD9;">Sketchfab</a>
</p>

What I need to be able to replace is both instances of 3e687de1cfe141b7b0f6fc664944a8de So that the user can just add that to display a model that they have uploaded to the sketchfab site.

Thank you for your time,

Bryon

2 answers

Hi Bryon,

I think you can write a User Macro for this. Please refer to https://confluence.atlassian.com/display/DOC/Writing+User+Macros

You can make the macro visible for all users, and select "Unrendered" for body processing.

In template, you can have:

<iframe width="640" height="480" src="https://sketchfab.com/models/$body/embed" frameborder="0" allowfullscreen mozallowfullscreen="true" webkitallowfullscreen="true" onmousewheel=""></iframe>
 
<p style="font-size: 13px; font-weight: normal; margin: 5px; color: #4A4A4A;">
    <a href="https://sketchfab.com/models/3e687de1cfe141b7b0f6fc664944a8de" style="font-weight: bold; color: #1CAAD9;">Scene_000</a>
    by <a href="https://sketchfab.com/fpg" style="font-weight: bold; color: #1CAAD9;">Foul Play Games</a>
    on <a href="https://sketchfab.com" style="font-weight: bold; color: #1CAAD9;">Sketchfab</a>
</p>

Note "$body" in above code, as that takes the body of the macro. After saving that. You can insert the marco in your pages and in the body of macro, you can have the ID of the model you wish to display.

I hope this helps :)

0 vote

If you have a Cloud site I wrote an add-on that can do this yesterday called: Sketchfab for Confluence.

It's completely free so you should install it and give it a try.

Hi Robert, 

I love this add-on, but I can't get it to render the iframe full width. 

Is there a width setting somewhere I'm missing?

There is no width setting. I just imagined that the default size that came back would be acceptable. Do the Confluence formatting features not work for you with respect to positioning the box? Or would you just like more of it to show?

At any rate, I raised an issue for this: https://bitbucket.org/robertmassaioli/sketchfab-connect/issues/4/make-it-possible-to-declare-the-width-of

Thanks Robert.

I replied in the issue... but basically, I'd like to see the whole box.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published May 17, 2018 in Confluence

Color tables for a shiny Confluence page

...; ## Developed by: Alana Fernando ## Shared with love ## @param style:title=style type|type=enum|required=true|desc=Choose a style.|enumValues=Style1,Style2,Style3,Style4,Style5 ## @param alignment:title...

384 views 17 18
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you