mirror of
https://github.com/a2nt/silverstripe-elemental-basics.git
synced 2024-10-22 15:05:54 +00:00
IMPR: Element Icons
This commit is contained in:
parent
19221317e6
commit
d582a08e4d
@ -12,6 +12,7 @@ use DNADesign\ElementalList\Model\ElementList;
|
|||||||
|
|
||||||
class AccordionElement extends ElementList
|
class AccordionElement extends ElementList
|
||||||
{
|
{
|
||||||
|
private static $icon = 'font-icon-block-file-list';
|
||||||
private static $singular_name = 'Accordion Element';
|
private static $singular_name = 'Accordion Element';
|
||||||
|
|
||||||
private static $plural_name = 'Accordion Element';
|
private static $plural_name = 'Accordion Element';
|
||||||
|
@ -15,6 +15,7 @@ use SilverStripe\Forms\TextareaField;
|
|||||||
|
|
||||||
class CustomSnippetElement extends ElementContent
|
class CustomSnippetElement extends ElementContent
|
||||||
{
|
{
|
||||||
|
private static $icon = 'font-icon-external-link';
|
||||||
private static $singular_name = 'Custom Snippet';
|
private static $singular_name = 'Custom Snippet';
|
||||||
|
|
||||||
private static $plural_name = 'Custom Snippets';
|
private static $plural_name = 'Custom Snippets';
|
||||||
|
@ -8,12 +8,12 @@
|
|||||||
|
|
||||||
namespace A2nt\ElementalBasics\Elements;
|
namespace A2nt\ElementalBasics\Elements;
|
||||||
|
|
||||||
|
|
||||||
use DNADesign\Elemental\Models\BaseElement;
|
use DNADesign\Elemental\Models\BaseElement;
|
||||||
use SilverStripe\Core\Convert;
|
use SilverStripe\Core\Convert;
|
||||||
|
|
||||||
class InstagramElement extends BaseElement
|
class InstagramElement extends BaseElement
|
||||||
{
|
{
|
||||||
|
private static $icon = 'font-icon-menu-files';
|
||||||
private static $singular_name = 'Instagram';
|
private static $singular_name = 'Instagram';
|
||||||
|
|
||||||
private static $plural_name = 'Instagram Elements';
|
private static $plural_name = 'Instagram Elements';
|
||||||
@ -24,15 +24,15 @@ class InstagramElement extends BaseElement
|
|||||||
|
|
||||||
private static $db = [
|
private static $db = [
|
||||||
'Username' => 'Varchar(255)',
|
'Username' => 'Varchar(255)',
|
||||||
'Tag' => 'Varchar(255)',
|
'Tag' => 'Varchar(255)',
|
||||||
'DisplayProfile' => 'Boolean(0)',
|
'DisplayProfile' => 'Boolean(0)',
|
||||||
'DisplayBiography' => 'Boolean(0)',
|
'DisplayBiography' => 'Boolean(0)',
|
||||||
'DisplayGallery' => 'Boolean(0)',
|
'DisplayGallery' => 'Boolean(0)',
|
||||||
'DisplayCaptions' => 'Boolean(0)',
|
'DisplayCaptions' => 'Boolean(0)',
|
||||||
];
|
];
|
||||||
|
|
||||||
private static $defaults = [
|
private static $defaults = [
|
||||||
'DisplayGallery' => true,
|
'DisplayGallery' => true,
|
||||||
];
|
];
|
||||||
|
|
||||||
public function getType()
|
public function getType()
|
||||||
@ -45,14 +45,14 @@ class InstagramElement extends BaseElement
|
|||||||
*/
|
*/
|
||||||
public function getAttributes(): array
|
public function getAttributes(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'data-username' => $this->Username,
|
'data-username' => $this->Username,
|
||||||
'data-display-profile' => $this->DisplayProfile,
|
'data-display-profile' => $this->DisplayProfile,
|
||||||
'data-display-biography' => $this->DisplayBiography,
|
'data-display-biography' => $this->DisplayBiography,
|
||||||
'data-display-gallery' => $this->DisplayGallery,
|
'data-display-gallery' => $this->DisplayGallery,
|
||||||
'data-display-captions' => $this->DisplayCaptions,
|
'data-display-captions' => $this->DisplayCaptions,
|
||||||
'data-items' => 12,
|
'data-items' => 12,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Custom attributes to process.
|
* Custom attributes to process.
|
||||||
@ -63,7 +63,7 @@ class InstagramElement extends BaseElement
|
|||||||
*/
|
*/
|
||||||
public function AttributesHTML($attributes = null): string
|
public function AttributesHTML($attributes = null): string
|
||||||
{
|
{
|
||||||
if (!$attributes) {
|
if (!$attributes) {
|
||||||
$attributes = $this->getAttributes();
|
$attributes = $this->getAttributes();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -93,11 +93,11 @@ class InstagramElement extends BaseElement
|
|||||||
|
|
||||||
public function FeedLink()
|
public function FeedLink()
|
||||||
{
|
{
|
||||||
return 'https://www.instagram.com/'.($this->Username ? $this->Username : 'explore/tags/'.$this->Tag).'/';
|
return 'https://www.instagram.com/'.($this->Username ? $this->Username : 'explore/tags/'.$this->Tag).'/';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function FeedTitle()
|
public function FeedTitle()
|
||||||
{
|
{
|
||||||
return ($this->Username ? '@'.$this->Username : '#'.$this->Tag);
|
return ($this->Username ? '@'.$this->Username : '#'.$this->Tag);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,11 +7,13 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
namespace A2nt\ElementalBasics\Elements;
|
namespace A2nt\ElementalBasics\Elements;
|
||||||
|
|
||||||
use DNADesign\Elemental\Models\BaseElement;
|
use DNADesign\Elemental\Models\BaseElement;
|
||||||
use A2nt\ElementalBasics\Models\TeamMember;
|
use A2nt\ElementalBasics\Models\TeamMember;
|
||||||
|
|
||||||
class TeamMembersElement extends BaseElement
|
class TeamMembersElement extends BaseElement
|
||||||
{
|
{
|
||||||
|
private static $icon = 'font-icon-menu-security';
|
||||||
private static $singular_name = 'Team Members';
|
private static $singular_name = 'Team Members';
|
||||||
|
|
||||||
private static $plural_name = 'Team Members';
|
private static $plural_name = 'Team Members';
|
||||||
@ -25,6 +27,6 @@ class TeamMembersElement extends BaseElement
|
|||||||
|
|
||||||
public function Members()
|
public function Members()
|
||||||
{
|
{
|
||||||
return TeamMember::get()->sort('RAND()');
|
return TeamMember::get();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user