Hi,
I want to set the header (h1) like the insert in the space-title field I have the following code.Is that possible?
Hi Matthias,
From what I understand, you want to apply the same style of the page tile to all the "Heading 1" elements in the content of your page.
I was able to accomplish this with the script below, inserted into the "At end of the BODY" section of the Custom HTML admin page:
<script>
const pageTitle = document.querySelector('#title-text');
const pageTitleStyle = window.getComputedStyle(pageTitle);
const headings = document.querySelectorAll('.wiki-content h1');
headings.forEach(heading => {
Array.from(pageTitleStyle)
.forEach(key => heading.style.setProperty(key, pageTitleStyle.getPropertyValue(key), pageTitleStyle.getPropertyPriority(key)))
})
</script>
It essentially uses .getComputedStyle() method to determine the style of the page title, then applies these styles to each the Level 1 header in the content.
I hope this helps!
Hi @Zak Laughton,
thanks for your quick answer, I mean when I create a new room with my space blueprint that the h1 is an input, not the name + home page as normal. If I want to create a new space with my space blueprint, there is a field header and I want this input to be set as page title, I hope I explained it better.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.