Last active
January 24, 2019 15:34
-
-
Save khoatran/120278106929c8c1314385364057f86f to your computer and use it in GitHub Desktop.
OctoberCMS add fields under secondary tabs
This file contains hidden or 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 | |
class Plugin extends PluginBase | |
{ | |
public function boot() | |
{ | |
parent::boot(); | |
$this->extendRainlabPost(); | |
} | |
protected function extendRainlabPost() { | |
Posts::extendFormFields(function (Form $form, $model, $context) { | |
if (!$model instanceof \RainLab\Blog\Models\Post) { | |
return; | |
} | |
$form->addSecondaryTabFields([ | |
'sticky' => [ | |
'label' => 'Sticky post', | |
'type' => 'switch', | |
'tab' => 'rainlab.blog::lang.post.tab_manage' | |
] | |
]); | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment