Skip to content

Commit ee0235f

Browse files
adnanqaopsgitbook-bot
authored andcommitted
GITBOOK-176: Added WordPress page. Added Demo to HTML and NEXT.JS pages.
1 parent 48d1a03 commit ee0235f

File tree

4 files changed

+51
-21
lines changed

4 files changed

+51
-21
lines changed

docs/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@
118118
* [Publish an App](publish-apps/publish-an-app.md)
119119
* [Embedd an App](publish-apps/embedd-an-app/README.md)
120120
* [Embed App in HTML Pages](publish-apps/embedd-an-app/embed-app-in-html-pages.md)
121+
* [Embed App in WordPress Pages](publish-apps/embedd-an-app/embed-app-in-wordpress-pages.md)
121122
* [Embed Apps in React](publish-apps/embedd-an-app/embed-apps-in-react.md)
122123
* [Embed Apps in NEXT.JS](publish-apps/embedd-an-app/embed-apps-in-next.js.md)
123124
* [Native embed SDK](publish-apps/embedd-an-app/native-embed-sdk/README.md)

docs/publish-apps/embedd-an-app/embed-app-in-html-pages.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,6 @@ Place the standard JavaScript Files in your \<HEAD> part of the HTML page.
1111

1212
And now the Lowcoder SDK Scripts, as the last tags before the \</BODY> closing tag.
1313

14-
```
15-
<script src="https://sdk.lowcoder.cloud/bundle.js"></script>
16-
<script type="module" src="https://unpkg.com/lowcoder-comps@latest/index.js"></script>
17-
```
18-
19-
{% hint style="warning" %}
20-
From version 2.4 on, you would only need to include the standard bundle file.
21-
{% endhint %}
22-
2314
```
2415
<script src="https://sdk.lowcoder.cloud/bundle.js"></script>
2516
```
@@ -43,3 +34,7 @@ Now you can place a small HTML snippet at the place where your App should be emb
4334
```
4435

4536
You can embed in this way multiple apps on an HTML page.
37+
38+
The result of the above code in an HTML page is shown below in the Demo. The List component with Yellow background is the Lowcoder App :&#x20;
39+
40+
{% embed url="https://www.loom.com/share/ad204fdbce674882a4c993d53c93b4a1?sid=4a2b982d-e915-4f63-9bd5-7b22c455c702" %}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Embed App in WordPress Pages
2+
3+
It is also possible to embed Lowcoder Apps on any WordPress Page with simple Scripts, that we provide on sdk.lowcoder.cloud. This enables you to embed Lowcoder Apps even without deep knowledge of React or Web Development.
4+
5+
Place the standard JavaScript Files in your \<HEAD> part of the WordPress page.
6+
7+
```
8+
<script src="https://unpkg.com/react@16.4.1/umd/react.production.min.js"></script>
9+
<script src="https://unpkg.com/react-dom@16.4.1/umd/react-dom.production.min.js"></script>
10+
```
11+
12+
And now the Lowcoder SDK Scripts, as the last tags before the \</BODY> closing tag.
13+
14+
```
15+
<script src="https://sdk.lowcoder.cloud/bundle.js"></script>
16+
```
17+
18+
Now you can place a small HTML snippet at the place where your App should be embedded:
19+
20+
```
21+
<div class="lowcoder-module-container">
22+
<div id="lowcoder-embedding">
23+
<div class="lowcoder-module-display"></div>
24+
<input type="hidden" class="locoder-backend-url" value="https://api-service.lowcoder.cloud" />
25+
<script>
26+
var app_id_information = document.createElement("input");
27+
app_id_information.setAttribute("type", "hidden");
28+
app_id_information.setAttribute("class", "module-id");
29+
app_id_information.setAttribute("value", "66ab6af10390b00771b2e649");
30+
document.getElementById('lowcoder-embedding').appendChild(app_id_information);
31+
</script>
32+
</div>
33+
</div>
34+
```
35+
36+
You can embed in this way multiple apps on a WordPress page.
37+
38+
We have created a WordPress Website and added two Lowcoder components. The 1st component is a sign up modal, and the 2nd component is an App. You may visit this site, below.
39+
40+
{% embed url="http://demo-lowcoder.42web.io/" %}

docs/publish-apps/embedd-an-app/embed-apps-in-next.js.md

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ import "lowcoder-sdk/dist/style.css";
3232

3333
* Create Wrapper Component to Embed Lowcoder Apps
3434

35-
````
3635
```
3736
"use client"
3837
import { LowcoderAppView } from "lowcoder-sdk";
@@ -57,33 +56,27 @@ function LowcoderAppWrapper(props) {
5756
5857
export default LowcoderAppWrapper;
5958
```
60-
````
6159

6260
* Dynamically import the LowcoderAppWrapper component in the file where you want to embed the Lowcoder app
6361

64-
````
6562
```
6663
const LowcoderAppWrapper = dynamic(
6764
() => import('../components/LowcoderAppWrapper'), {ssr: false}
6865
);
6966
```
70-
````
7167

7268
* Now, we can embed our Lowcoder app by just passing the appId to the imported LowcoderAppWrapper component.
7369

74-
````
7570
```
7671
<LowcoderAppWrapper
7772
appId='66ab6af10390b00771b2e649'
7873
/>
7974
```
80-
````
8175

8276
### Embed Lowcoder Modules
8377

8478
* Create Wrapper Component to Embed Lowcoder Modules
8579

86-
````
8780
```
8881
"use client"
8982
import { useRef } from "react";
@@ -120,27 +113,28 @@ function LowcoderModuleWrapper(props) {
120113
121114
export default LowcoderModuleWrapper;
122115
```
123-
````
124116

125117
* Dynamically import the LowcoderModuleWrapper component in the file where you want to embed the Lowcoder Module
126118

127-
````
128119
```
129120
const LowcoderModuleWrapper = dynamic(
130121
() => import('../components/LowcoderModuleWrapper'), {ssr: false}
131122
);
132123
```
133-
````
134124

135125
* Now, we can embed our Lowcoder module by just passing the appId to the imported LowcoderModuleWrapper component.
136126

137-
````
138127
```
139128
<LowcoderModuleWrapper
140129
appId="660f13367c18a91b174fe96d"
141130
/>
142131
```
143-
````
132+
133+
### Demo
134+
135+
The result of the above code in NEXT.JS App is shown below in the Demo. The List component with Yellow background is the Lowcoder App and the Table component is the Lowcoder Module :&#x20;
136+
137+
{% embed url="https://demos.lowcoder.cloud/demo/clzi68y2h1jaw9x776x7lwz8p" %}
144138

145139
### Properties
146140

0 commit comments

Comments
 (0)