Skip to content

Instantly share code, notes, and snippets.

@carlcs
Created October 7, 2015 17:12
Show Gist options
  • Save carlcs/60e3d38af59cc56927d3 to your computer and use it in GitHub Desktop.
Save carlcs/60e3d38af59cc56927d3 to your computer and use it in GitHub Desktop.
<?php
namespace Craft;
class BusinessLogicPlugin extends BasePlugin
{
public function getName()
{
return 'Business Logic';
}
public function getVersion()
{
return '1.0';
}
public function getDeveloper()
{
return 'Admin';
}
public function getDeveloperUrl()
{
return 'https://example.com';
}
public function modifyEntrySources(&$sources, $context)
{
$newSources = array(
array('heading' => 'Post Formats'),
array(
'label' => 'Articles',
'criteria' => array('section' => 'blog', 'type' => 'article')
),
array(
'label' => 'Links',
'criteria' => array('section' => 'blog', 'type' => 'link')
)
);
$sources = array_merge($sources, $newSources);
}
}
@carlcs
Copy link
Author

carlcs commented Oct 7, 2015

Create this file in craft/plugins/businesslogic/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment