The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

Page layout section messed up by using javascript with innerHTML

NKS
May 30, 2022

Hi everyone

A simple macro kills the page layout when sections are used.

The macro:


## @noparams

<div id="ToBeFilled"></div>

<script>
var dicontent = 'Lorem';
document.getElementById("ToBeFilled").innerHTML = dicontent;
</script>


The layout of the page in the edit mode:

edit_layout.jpg

And the layout of the page after clicking on "Update":

page_layout.jpg

 

If there are none or only one section, everything works fine. If there are two or more, all sections after the macro are messed up. The section with the macro is displayed on the left, the rest on the right.

I don't understand why this happens like this and therefore I don't know how to solve it. I think there is a problem with the "innerHTML", but I don't know what exactly and how to avoid it.

Is anyone out there who could help me?

Thanks a lot and best regards

nks

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Jordan Hauser
Contributor
June 23, 2022

This is just a test page right? Can you go to the advanced options ellipses at the top right of the published page and click 'View Page Storage Format'

I recently had a project where I was setting up pages from code and api requests and learned about macros a bit more. That kind of function is what happens when you use the page layout options OR use a section macro and put two column macros in it from what I understand. The regular page layout appears to be just a GUI friendly way to show the macros, as using the section and column macros nested looks pretty messy in the editor.

The storage format for the page would be helpful to figure it out
-Jordan

DEPLOYMENT TYPE
SERVER
VERSION
7.13.1
TAGS
AUG Leaders

Atlassian Community Events