Skip to content

Commit

Permalink
Add example for Areabrick
Browse files Browse the repository at this point in the history
  • Loading branch information
aryaantony92 committed Oct 24, 2023
1 parent fc8c059 commit 7a76471
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 56 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,11 @@
use Pimcore\Extension\Document\Areabrick\Attribute\AsAreabrick;
use Pimcore\Extension\Document\Areabrick\AbstractTemplateAreabrick;

#[AsAreabrick(id: 'iframe')]
class Iframe extends AbstractTemplateAreabrick
#[AsAreabrick(id: 'date')]
class Date extends AbstractTemplateAreabrick
{
public function getName(): string
{
return 'Iframe';
}

public function getDescription(): string
{
return 'Embed contents from other URL (websites) via iframe';
return 'Date';
}
}
10 changes: 10 additions & 0 deletions templates/areas/date/view.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{% set date = pimcore_date('myDate', {
'format': 'd.m.Y',
'outputFormat': '%d.%m.%Y'
}) %}

{% if editmode or not date.isEmpty() %}
<div class="page-header">
<h2>{{ date|raw }}</h2>
</div>
{% endif %}
46 changes: 0 additions & 46 deletions templates/areas/iframe/view.html.twig

This file was deleted.

2 changes: 1 addition & 1 deletion templates/content/default.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</div>

{{ pimcore_areablock('content', {
'allowed': ['blockquote', 'embed', 'featurette', 'gallery-carousel', 'gallery-folder',
'allowed': ['blockquote', 'date', 'embed', 'featurette', 'gallery-carousel', 'gallery-folder',
'gallery-single-images', 'headlines', 'horizontal-line', 'icon-teaser-row', 'image', 'iframe', 'image-gallery',
'image-hotspot-marker', 'image-metadata', 'pdf', 'product-grid', 'product-teaser', 'standard-teaser', 'text-accordion',
'time-slider-featurette', 'video', 'wysiwyg', 'wysiwyg-with-images', 'personalized-product-teaser']
Expand Down
2 changes: 1 addition & 1 deletion templates/default/events.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

{% block content %}
{{ pimcore_areablock('content', {
'allowed': ['blockquote', 'embed', 'featurette', 'gallery-carousel', 'gallery-folder',
'allowed': ['blockquote', 'embed', 'date', 'featurette', 'gallery-carousel', 'gallery-folder',
'gallery-single-images', 'headlines', 'horizontal-line', 'icon-teaser-row', 'image',
'image-hotspot-marker', 'pdf', 'product-grid', 'product-teaser', 'standard-teaser', 'text-accordion',
'time-slider-featurette', 'video', 'wysiwyg', 'wysiwyg-with-images']
Expand Down

0 comments on commit 7a76471

Please sign in to comment.