Dynamic pages
under review
Ryan Johnson
This sounds pretty complicated. They don't even have embedded HTML available yet in their WYSIWYG editor.
Jason Bryant
Was there any follow-up with this? I'm trying to find a way of doing the same without having to use iframes if at all possible.
A
Alex Rodenberg
One could make a system, that can do Rest API Calls, and SQL calls, with proper security for secrets/headers etc, it could generate tables based off this.
There are a few of these in confluence fx:
But it can be a big task to undergo, the rewards are awesome though, for companies that have multiple systems they would like to display data from in their wiki pages, without having to create separate web sites.
Henry T
I have a similar request - I would like to do something similar except the data is from an Azure Storage blob.
V
Vinod Kulkarni
Here is an approach and I would like to know security issues herein:
Let us say we want to define a SFC (single file component) in vue, which will do things like define a table and pull data from axios and display it. Let us say this is in /Components/MyComponent. And there are appropriate admin permissions. And also, under administration/renderers, disable SafeHTML for now. (We will see how to safely enable it later.)
We need following approach (code changes):
- Create a URL to get raw content of page. Say '/r/Components/MyComponent'. Or we can also use GraphQL to fetch raw content of page.
- Define a component called third-party in client/components. Its purpose is to introduce tag called <third-party source="/r/MyComponent'"></third-party> usable in any page. This component has mounted() section, which then uses 'http-vue-loader' to load the single file component (SFC) from source specified. The user's component has been specified in the MyComponent page with usual template, screen and style sections.
- Now in any other HTML page, we can use <third-party source="..."></third-party> to introduce use of Vue component defined under /Components folder. (So sufficiently protected)
I have verified this approach and it works. Instead of disabling SafeHTML, one can whitelist 'thirdparty' tag under html-security plugin.
I have verified that this works nicely.
<!-- ./client/components/third-party.vue -->
<!-- source is any value URL pointing to SFC vue component. -->
<template>
<div id="page-component">
<page-component></page-component>
</div>
</template>
<script>
import Vue from 'vue'
import httpVueLoader from 'http-vue-loader'
export default {
props: {
source: {
type: String,
default: "<template></template>"
}
},
data: function() {
return {
who: 'world'
}
},
mounted() {
let page_component = httpVueLoader.load(this.source)
Vue.component('page-component', page_component)
new Vue({el: '#page-component'})
}
}
</script>
Nicolas Giard
under review
V
Vinod Kulkarni
Quick approach:
Suppose you have table in google sheets, it can be easily shown in the wikijs page using an iframe. I did this by modifying server/modules/rendering/html-security/rendering.js and adding this to whitelist:
iframe: ['src', 'class', 'style']
And then, you create a html raw wiki page. Goto google sheets, Files -> Publish to web, and select Embed. This gives html iframe to put in your raw wiki page. Make sure right styles are added.
Better approach
: Wikijs should make it easy to integrate with headless CMS such as strapi, which can take care of creation and management of schema and content.
There are lots of examples out there as to how to then create websites using next.js or vue with content served from strapi.
What we could do is to make it easy to consume strapi tables within wiki directly, and apply our own styles, managed from within wikijs.
I
Ian Watson
Vinod Kulkarni: The idea of being able to use a wiki.js ui over strapi based content is great.
Searching for such a solution is exactly what brought me here.
Stefaan Vandevelde
World be nice, but how to do this in a convenience way ? Not a simple one.
Ильяс Мамеев
need this asap