This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Extension; | |
use SilverStripe\Core\Config\Config; | |
use SilverStripe\ORM\DataExtension; | |
/** | |
* Simple class to add "active" class to $LinkingMode (does not replace `current` class) for Bootstrap Menus |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Different YAML maps/arrays for the same obeject/element are usually merged. | |
In the below example the value "5px" would usually be merged with the first defined map. | |
if you want to override maps/array you can first reset it by setting it to null. | |
Verschiedene YAML-Maps/Arrays für das gleiche Objekt/Element werden in der Regel zusammengeführt. | |
Im folgenden Beispiel wird der Wert "5px" normalerweise mit der ersten definierten Map zusammengeführt. | |
Wenn man Map/Array überschreiben will, kann man es zunächst zurücksetzen, indem man es auf Null setzt. | |
#### /vendor/My/Extension/_config/config.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add E-Mail Obfuscation to Dataobjects (and thus also for Pages). | |
* Activate: | |
* save this file to mysite/code or mysite/extensions | |
* and: | |
* in _config.php: DataObject::add_extension('DataObject', 'ObfuscateEmailExtension'); | |
* or in config.yml: DataObject: extensions: - ObfuscateEmailExtension |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function onBeforeWrite() { | |
// Magic Links: Make sure "http://" exists at the start of the URL, if it doesn't have http:// or https:// | |
// replace "$this->ExternaLink" for your needs | |
if ($link = $this->ExternalLink) { | |
$this->ExternalLink = (substr($link, 0, 7) == 'http://' || substr($link, 0, 8) == 'https://') ? $link : 'http://' . $link; | |
} | |
parent::onBeforeWrite(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SomeClass.php | |
class SomeClass extends DataObject { | |
static $db = array ( | |
'Title_de_DE' => 'Text', | |
'Title_en_US' => 'Text' | |
); | |
... | |
... | |
// return Title (or other field) for current locale |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
config.xmlprologue = none | |
# HTML5 f. css3pie benötigt - hatte bei box-shadow (ältere IE? nicht sicher...) z.T. Abstand zwischen Schatten und Objekt | |
config.doctype ( | |
<!doctype html> | |
<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ --> | |
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]--> | |
<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en"> <![endif]--> | |
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en"> <![endif]--> | |
<!-- Consider adding an manifest.appcache: h5bp.com/d/Offline --> | |
<!--[if gt IE 8]><!--> |
NewerOlder