Based on a suggestion I swear I read in the documentation (but can no longer find), I’ve repurposed the “Campus” event type as “University Event Level.” (Administration wants three tiers/types of events for different audiences.) Everything is working correctly except one thing: I can’t figure out how to rename the text “Campus” on the back end — people editing an event will still see “Campus” instead of “University Event Level.”
We have done this a few times — most recently the day before yesterday! — and we’ve got some code for it.
This is just a cosmetic change of “Campus” to “Area of Interest” in several spots where it appears on the back end. You’ll still see campus in the URL — to change that would be deeper and more complex — but this seems to do the trick for most folks.
If you save this to the non-public /livewhale/ directory as /livewhale/client/modules/rename_campuses, then log out and then back in, this ought to work for your needs. (You may of course change “Area of Interest” to something else.)
<?php
$_LW->REGISTERED_APPS['rename_campuses'] = array( // configure this application module
'title' => 'Rename Campuses',
'handlers' => ['onOutput']
);
class LiveWhaleApplicationRenameCampuses {
/* The onOutput() hander allows you to add the custom form element to the editor. */
public function onOutput($buffer) {
global $_LW;
$buffer=str_replace('Event Types: Campus','Event Types: Area of Interest', $buffer);
$buffer=str_replace('Add a new Campus','Add Area of Interest', $buffer);
$buffer=str_replace('Merge Campuses...','Merge Types...', $buffer);
$buffer=str_replace('Campuses','Areas of interest', $buffer);
$buffer=str_replace('in these campuses','in these areas', $buffer);
$buffer=str_replace('<span>Campus:</span>','<span>Area of Interest:</span>', $buffer);
$buffer=str_replace('<legend>Campus</legend>','<legend>Area(s) of Interest</legend>', $buffer);
return $buffer;
}
}
?>
<?php
$_LW->REGISTERED_APPS['rename_campuses'] = array( // configure this application module
'title' => 'Rename Campuses',
'handlers' => ['onOutput']
);
class LiveWhaleApplicationRenameCampuses {
/* The onOutput() hander allows you to add the custom form element to the editor. */
public function onOutput($buffer) {
global $_LW;
$buffer=str_replace('Event Types: Campus','Event Types: University Event Level', $buffer);
$buffer=str_replace('Add a new Campus','Add University Event Level', $buffer);
$buffer=str_replace('Merge Campuses...','Merge University Event Levels...', $buffer);
$buffer=str_replace('Campuses','University Event Levels', $buffer);
$buffer=str_replace('in these campuses','in these University Event Levels', $buffer);
$buffer=str_replace('<span>Campus:</span>','<span>University Event Level:</span>', $buffer);
$buffer=str_replace('<legend>Campus</legend>','<legend>University Event Level</legend>', $buffer);
return $buffer;
}
}
?>
… and I’ve saved it here: livewhale/client/modules/rename_campuses.php
Logged out and logged back in. Unfortunately still not seeing it. Tried an incognito window but still nothing.
I’m still extremely optimistic though. Let me know what to do next!
Great! This kind of thing is useful but also powerful and dangerous — that onOutput handler just transforms HTML, so you don’t want to be too broad in what you transform.