1
+ import { getAsArray , get } from " @parameter1/base-cms-object-path" ;
2
+ import defaultValue from " @parameter1/base-cms-marko-core/utils/default-value" ;
3
+ import getContentPreview from " @parameter1/base-cms-marko-web-theme-monorail/utils/get-content-preview" ;
4
+
1
5
$ const { id , type , pageNode } = data;
2
- $ const { recaptcha } = out .global ;
6
+ $ const { recaptcha , identityX } = out .global ;
3
7
4
8
<marko-web-content-page-layout id = id type = type >
5
9
<@page >
@@ -22,17 +26,57 @@ $ const { recaptcha } = out.global;
22
26
<div class = " row mt-3" >
23
27
<div class = " col-md-8" >
24
28
<div class = " content-page-body" >
25
- <theme-page-contents |{ blockName }| attrs = { " data-gallery-id" : id } >
26
29
<marko-web-p1-events-track-content-scroll-depth
27
30
content = content
28
31
selector = " .document-container .page .row .content-page-body"
29
32
/>
30
- <content-body
31
- content = content
32
- block-name = blockName
33
- display-read-next = false
34
- display-comments = false
35
- />
33
+ <theme-page-contents |{ blockName }| attrs = { " data-gallery-id" : id } >
34
+ $ const requiresRegistration = get (content, " userRegistration.isCurrentlyRequired" );
35
+ $ const progressiveRegEnabled = identityX ? identityX .config .getProgresiveQuestions ().length != = 0 : false ;
36
+ $ const checkReg = requiresRegistration || progressiveRegEnabled;
37
+ <marko-web-identity-x-access |context| enabled = checkReg >
38
+ <!-- If ProgressiveReg is enabled & required: Fire it first & ignore required user fields! -->
39
+ <if (progressiveRegEnabled) >
40
+ $ const body = getContentPreview ({ body: content .body , selector: " p:nth-of-type(1)" });
41
+ <marko-web-content-body block-name = blockName obj = { body } />
42
+ <div class = " content-page-preview-overlay" />
43
+ <theme-content-page-gate
44
+ profile-confirmation = false
45
+ can-access = context .canAccess
46
+ is-logged-in = context .isLoggedIn
47
+ has-required-access-level = context .hasRequiredAccessLevel
48
+ requires-access-level = context .requiresAccessLevel
49
+ requires-user-input = false
50
+ requiresPUI = context .requiresPUI
51
+ messages = context .messages
52
+ content-gate-type = " default"
53
+ />
54
+ </if >
55
+ <else-if (! context .canAccess || (context .requiresUserInput && requiresRegistration)) >
56
+ $ const body = getContentPreview ({ body: content .body , selector: " p:nth-of-type(1)" });
57
+ <marko-web-content-body block-name = blockName obj = { body } />
58
+ <div class = " content-page-preview-overlay" />
59
+ <theme-content-page-gate
60
+ profile-confirmation = false
61
+ can-access = context .canAccess
62
+ is-logged-in = context .isLoggedIn
63
+ has-required-access-level = context .hasRequiredAccessLevel
64
+ requires-access-level = context .requiresAccessLevel
65
+ requires-user-input = context .requiresUserInput
66
+ requiresPUI = context .requiresPUI
67
+ messages = context .messages
68
+ content-gate-type = " default"
69
+ />
70
+ </else-if >
71
+ <else >
72
+ <content-body
73
+ content = content
74
+ block-name = blockName
75
+ display-read-next = false
76
+ display-comments = false
77
+ />
78
+ </else >
79
+ </marko-web-identity-x-access >
36
80
</theme-page-contents >
37
81
</div >
38
82
</div >
0 commit comments