Skip to content

Commit

Permalink
aded options to update the HTML Text fields from Site Tree to Markdow…
Browse files Browse the repository at this point in the history
…n texts
  • Loading branch information
fonsekaean committed Sep 23, 2017
1 parent db44452 commit 8702111
Show file tree
Hide file tree
Showing 8 changed files with 307 additions and 20,969 deletions.
10 changes: 6 additions & 4 deletions _config.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
* To change this template use File | Settings | File Templates.
*/

$strMarkDownPath = dirname(__FILE__);

if(!defined('MARKDOWN_BASE')){
$strBase = substr(str_replace(BASE_PATH, '', $strMarkDownPath), 1);
define('MARKDOWN_BASE', $strBase);
$asBase = \SilverStripe\Core\Config\Config::inst()->get(\SilverStripers\markdown\db\MarkdownText::class, 'markdown_as_base');
if($asBase) {
$siteTreeDB = \SilverStripe\Core\Config\Config::inst()->get(\SilverStripe\CMS\Model\SiteTree::class, 'db');
$siteTreeDB['Content'] = \SilverStripers\markdown\db\MarkdownText::class;
\SilverStripe\Core\Config\Config::modify()
->set(\SilverStripe\CMS\Model\SiteTree::class, 'db', $siteTreeDB);
}
5 changes: 4 additions & 1 deletion _config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@ Name: markdown
---
SilverStripe\Admin\LeftAndMain:
extensions:
- SilverStripers\markdown\extensions\MarkdownFieldExtension
- SilverStripers\markdown\extensions\MarkdownFieldExtension
SilverStripe\CMS\Model\SiteTree:
extensions:
- SilverStripers\markdown\extensions\MarkdownSiteTreeExtension
Loading

0 comments on commit 8702111

Please sign in to comment.