-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathcontentRenderer.cfc
executable file
·116 lines (94 loc) · 3.51 KB
/
contentRenderer.cfc
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
/*
This file is part of the ZeroFour Mura CMS Theme
*/
component extends="mura.cfobject" output="false" {
/*
This is the THEME contentRenderer.cfc
* Add theme-specific methods here
* Any methods here will be accessible with the following notation:
$.yourFunctionName()
*/
// contentRenderer settings
// GENERAL
this.jsLib = 'jquery';
this.jsLibLoaded = true;
this.suppressWhitespace = false;
this.showInlineEditor=true;
// layout manager
this.layoutmanager=true;
this.legacyObjects=false;
// nav
this.ulTopClass = 'style2';
// headings
this.headline = 'h1';
this.subHead1 = 'h2';
this.subHead2 = 'h3';
this.subHead3 = 'h4';
this.subHead4 = 'h5';
// buttons
this.customButtonClass = 'button';
this.customButtonClassAlt = 'button alt';
this.searchResultWrapperClass='';
this.searchResultsRowClass='';
this.searchResultsMoreResultsRowClass='';
this.searchAgainRowClass='';
this.searchFormSubmitClass=this.customButtonClass;
this.searchAgainSubmitClass=this.customButtonClass;
this.loginWrapperClass='';
this.formButtonClass=this.customButtonClass;
this.commentSubmitButtonClass=this.customButtonClass;
this.formBuilderSubmitClass=this.customButtonClass;
this.loginFormSubmitClass=this.customButtonClass;
this.mailingListSubmitClass=this.customButtonClass;
this.userToolsLoginFormSubmitClass=this.customButtonClass;
this.notRegisteredLinkClass=this.customButtonClass;
this.editProfileExtAttributeDownloadButtonClass=this.customButtonClass;
this.editProfileSubmitButtonClass=this.customButtonClass;
this.userToolsLoginFormSubmitClass=this.customButtonClass;
this.userToolsNotRegisteredLinkClass=this.customButtonClass;
this.userToolsEditProfileLinkClass=this.customButtonClass;
this.userToolsLogoutLinkClass=this.customButtonClassAlt;
// custom theme methods
public any function getSectionTitle() {
return variables.$.getCrumbVarByLevel('title', 1);
}
// class extension specific methods
// helper for RSS Feeds
public any function convertFeedDateTime(string httpDateTime) {
return IsDate(arguments.httpDateTime)
? LSDateFormat(ParseDateTime(arguments.httpDateTime), 'long')
: 'invalid';
}
// used to populate the homeFeature1Feed and componentSpotlight selectbox class extension
public any function getLocalFeeds() {
return variables.$.getBean('feedManager').getFeeds(siteid=variables.$.event('siteid'), type='local');
}
public any function getLocalFeedNames() {
var rs = getLocalFeeds();
return rs.getRecordcount()
? ValueList(rs.name, '^')
: 'No Content Collections Exist!';
}
public any function getHomeBean() {
return variables.$.getBean('content').loadby(filename='');
}
public string function dspBackgroundImage() {
var img = variables.$.getURLForImage(fileid=getHomeBean().getValue('headerBackgroundImage'), size='headerbackgroundimage');
return Len(img)
? '<style>##header-wrapper{background:url(' & img & ') top center;size:cover;}</style>'
: '';
}
// Helper
public any function dspComponent(string componentid) {
return variables.$.dspObject(
object='component'
, objectid=arguments.componentid
);
}
public any function dspNoFeedNotice(feedName='') {
return '<h3>The #HTMLEditFormat(arguments.feedName)# Content Collection Does Not Exist</h3><p>Go to <strong>Modules > Content Collections</strong> and create it!</p>';
}
public any function dspNoItemsNotice() {
return '<h3>No items exist yet.</h3>';
}
}