-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy patheventHandler.cfc
executable file
·64 lines (52 loc) · 1.67 KB
/
eventHandler.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
/*
This file is part of the Escape Velocity Mura CMS Theme
*/
component extends="mura.cfobject" output="false" {
/*
This is the THEME eventHandler.cfc
* Add theme-specific eventHandlers (listeners) here
* This file is much like a controller in a MVC application
* Reload the application when additions/changes are made to THIS file!
*/
public any function onApplicationLoad($) {
// make sure 'Home' page set to 'Page/Home'
var homeBean = arguments.$.getBean('content').loadBy(filename='');
if ( homeBean.getValue('subType') != 'Home' ) {
homeBean
.setValue('subType', 'Home')
.setValue('template', 'home.cfm')
.save();
}
}
public any function onRenderStart($) {
// force Home layout template if subtype is 'Home'
if ( arguments.$.content('subtype') == 'Home' ) {
arguments.$.content('template', 'home.cfm');
}
// force Summary page view for Link and File content types
if ( arguments.$.event('showMeta') != 2 ) {
arguments.$.event('showMeta', 1);
}
// for code syntax highlighting
try {
arguments.$.loadPrettify();
} catch(any e) {
// Mura CMS version is probably older than 6.1
}
}
public any function onComponentFeedColumnsBodyRender($) {
var str = '';
savecontent variable='str' {
WriteOutput(
arguments.$.columnizeFeed(
feedName = arguments.$.component('feedColumnsFeed')
, feedHeading = arguments.$.component('feedColumnsHeading')
, maxItems = Val(arguments.$.component('feedColumnsMaxItems'))
, columnCount = Val(arguments.$.component('feedColumnsColumnCount'))
, readMoreText = arguments.$.component('feedColumnsReadMoreText')
)
);
}
return str;
}
}