IMPR: Element Icons

This commit is contained in:
Tony Air 2021-07-08 15:53:26 +02:00
parent 19221317e6
commit d582a08e4d
4 changed files with 23 additions and 19 deletions

View File

@ -12,6 +12,7 @@ use DNADesign\ElementalList\Model\ElementList;
class AccordionElement extends ElementList
{
private static $icon = 'font-icon-block-file-list';
private static $singular_name = 'Accordion Element';
private static $plural_name = 'Accordion Element';

View File

@ -15,6 +15,7 @@ use SilverStripe\Forms\TextareaField;
class CustomSnippetElement extends ElementContent
{
private static $icon = 'font-icon-external-link';
private static $singular_name = 'Custom Snippet';
private static $plural_name = 'Custom Snippets';

View File

@ -8,12 +8,12 @@
namespace A2nt\ElementalBasics\Elements;
use DNADesign\Elemental\Models\BaseElement;
use SilverStripe\Core\Convert;
class InstagramElement extends BaseElement
{
private static $icon = 'font-icon-menu-files';
private static $singular_name = 'Instagram';
private static $plural_name = 'Instagram Elements';
@ -24,15 +24,15 @@ class InstagramElement extends BaseElement
private static $db = [
'Username' => 'Varchar(255)',
'Tag' => 'Varchar(255)',
'DisplayProfile' => 'Boolean(0)',
'DisplayBiography' => 'Boolean(0)',
'DisplayGallery' => 'Boolean(0)',
'DisplayCaptions' => 'Boolean(0)',
'Tag' => 'Varchar(255)',
'DisplayProfile' => 'Boolean(0)',
'DisplayBiography' => 'Boolean(0)',
'DisplayGallery' => 'Boolean(0)',
'DisplayCaptions' => 'Boolean(0)',
];
private static $defaults = [
'DisplayGallery' => true,
'DisplayGallery' => true,
];
public function getType()
@ -45,14 +45,14 @@ class InstagramElement extends BaseElement
*/
public function getAttributes(): array
{
return [
'data-username' => $this->Username,
'data-display-profile' => $this->DisplayProfile,
'data-display-biography' => $this->DisplayBiography,
'data-display-gallery' => $this->DisplayGallery,
'data-display-captions' => $this->DisplayCaptions,
'data-items' => 12,
];
return [
'data-username' => $this->Username,
'data-display-profile' => $this->DisplayProfile,
'data-display-biography' => $this->DisplayBiography,
'data-display-gallery' => $this->DisplayGallery,
'data-display-captions' => $this->DisplayCaptions,
'data-items' => 12,
];
}
/**
* Custom attributes to process.
@ -63,7 +63,7 @@ class InstagramElement extends BaseElement
*/
public function AttributesHTML($attributes = null): string
{
if (!$attributes) {
if (!$attributes) {
$attributes = $this->getAttributes();
}
@ -93,11 +93,11 @@ class InstagramElement extends BaseElement
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()
{
return ($this->Username ? '@'.$this->Username : '#'.$this->Tag);
return ($this->Username ? '@'.$this->Username : '#'.$this->Tag);
}
}

View File

@ -7,11 +7,13 @@
*/
namespace A2nt\ElementalBasics\Elements;
use DNADesign\Elemental\Models\BaseElement;
use A2nt\ElementalBasics\Models\TeamMember;
class TeamMembersElement extends BaseElement
{
private static $icon = 'font-icon-menu-security';
private static $singular_name = 'Team Members';
private static $plural_name = 'Team Members';
@ -25,6 +27,6 @@ class TeamMembersElement extends BaseElement
public function Members()
{
return TeamMember::get()->sort('RAND()');
return TeamMember::get();
}
}