Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Sketchfab Macro

oXL0C0Xo
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 11, 2014

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

0 votes
Robert Massaioli (Atlassian)
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 12, 2015

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.

Peter Clarke July 18, 2017

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?

Robert Massaioli (Atlassian)
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 18, 2017

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

Peter Clarke July 18, 2017

Thanks Robert.

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

0 votes
HosseinA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 17, 2014

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 :)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events