-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathadd content of a page to products page.html
53 lines (28 loc) · 1.3 KB
/
add content of a page to products page.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<script>
$( ( ) => {
/*
add content of a page to products page
License : < https://tinyurl.com/s872fb68 >
Version : 0.1d3
SS Version : 7.0
Templates : Montauk ( Julia, Kent, Om )
Wells
Wexley
your template is not listed? then it is not currently
supported
Dependencies : jQuery
By : Thomas Creedon < http://www.tomsWeb.consulting/ >
*/
/* copy value for url below from Page Settings > General > URL SLUG field.
you only need exactly what can be selected from the field */
const url = '[enter page url slug here between single quotes]';
// do not change anything below, there be the borg here
if ( ! $( '#productList' ).length ) return;
const options = { format: 'json', _ : new Date ( ).getTime ( ) };
$.getJSON ( '/' + url, options, function ( data ) {
$( '.col.sqs-col-12.span-12', data.mainContent )
.attr ( 'id', 'twc-products-page-header' )
.prependTo ( '#page' );
} );
} );
</script>