Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ wp acorn scaffold:person
wp acorn scaffold:project
```

After scaffolding wp-events, [follow these manual steps to complete the setup](docs/wp-events.md).

### Child Themes

To create a child theme you can run the following command. This will create a child theme directory in
Expand Down
51 changes: 51 additions & 0 deletions docs/wp-events.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# WP Events
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Voeg ook een referentie naar deze doc toe in de ScaffoldCommand! Dan ziet degene die het scaffold het meteen.

Zie https://github.com/yardinternet/brave-scaffold/blob/main/src/Console/ElasticsearchScaffoldCommand.php#L34-L35


Use the WP Acorn scaffold command to get started:

```shell
wp acorn scaffold:wp-events
```

After scaffolding, follow these steps:

## 1. Install dependencies

```shell
composer require yard/wp-events
```

## 2. Run the Acorn WP-CLI command to discover this package

```shell
wp acorn package:discover
```

## 3. Update the Card component

Add the following parameters to the `__construct` method in the `Cards.php` file:

```php
public function __construct(
// existing params...
public ?string $eventDateTime = null,
public ?string $eventLocation = null,
) {
// existing code...
}
```

Add the following line to the view of the Card component:

```php
<x-meta.event :eventDateTime="$eventDateTime" :eventLocation="$eventLocation" />
```

## 4. Import css file

Add the following import to your frontend stylesheet:

```css
@import './blocks/add-event-to-calendar/shared';
```

Everything should now be set up and ready to use!
2 changes: 2 additions & 0 deletions src/Console/EventScaffoldCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,7 @@ public function handle(): void
'--provider' => 'Yard\\Brave\\Scaffold\\ScaffoldServiceProvider',
'--tag' => 'wp-events',
]);
$this->info('You need to do some additional steps after running this scaffold. Please read the docs here:');
$this->line('https://github.com/yardinternet/brave-scaffold/blob/main/docs/wp-events.md');
}
}
12 changes: 6 additions & 6 deletions src/ScaffoldServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function bootingPackage(): void
__DIR__ . '/../stubs/config/facetwp/templates/news.php' => config_path('facetwp/templates/news.php'),
__DIR__ . '/../stubs/resources/views/blocks/FacetWP/loops/news-loop.blade.php' => resource_path('views/blocks/FacetWP/loops/news-loop.blade.php'),
__DIR__ . '/../stubs/resources/views/blocks/FacetWP/templates/news.blade.php' => resource_path('views/blocks/FacetWP/templates/news.blade.php'),
__DIR__ . '/../stubs/resources/views/partials/content-single-news.blade.php' => resource_path('views/partials/content-single-news.blade.php'),
__DIR__ . '/../stubs/resources/views/single-news.blade.php' => resource_path('views/single-news.blade.php'),
], 'news');

$this->publishes([
Expand All @@ -73,7 +73,7 @@ public function bootingPackage(): void
__DIR__ . '/../stubs/config/facetwp/templates/knowledgebase.php' => config_path('facetwp/templates/knowledgebase.php'),
__DIR__ . '/../stubs/resources/views/blocks/FacetWP/loops/knowledgebase-loop.blade.php' => resource_path('views/blocks/FacetWP/loops/knowledgebase-loop.blade.php'),
__DIR__ . '/../stubs/resources/views/blocks/FacetWP/templates/knowledgebase.blade.php' => resource_path('views/blocks/FacetWP/templates/knowledgebase.blade.php'),
__DIR__ . '/../stubs/resources/views/partials/content-single-knowledgebase.blade.php' => resource_path('views/partials/content-single-knowledgebase.blade.php'),
__DIR__ . '/../stubs/resources/views/single-knowledgebase.blade.php' => resource_path('views/single-knowledgebase.blade.php'),
__DIR__ . '/../stubs/acf-json/group_66e0254a243fd.json' => base_path('acf-json/group_66e0254a243fd.json'),
], 'knowledgebase');

Expand All @@ -87,7 +87,7 @@ public function bootingPackage(): void
__DIR__ . '/../stubs/resources/views/blocks/FacetWP/loops/person-loop.blade.php' => resource_path('views/blocks/FacetWP/loops/person-loop.blade.php'),
__DIR__ . '/../stubs/resources/views/blocks/FacetWP/templates/person.blade.php' => resource_path('views/blocks/FacetWP/templates/person.blade.php'),
__DIR__ . '/../stubs/resources/views/components/meta/person.blade.php' => resource_path('views/components/meta/person.blade.php'),
__DIR__ . '/../stubs/resources/views/partials/content-single-person.blade.php' => resource_path('views/partials/content-single-person.blade.php'),
__DIR__ . '/../stubs/resources/views/single-person.blade.php' => resource_path('views/single-person.blade.php'),
__DIR__ . '/../stubs/acf-json/group_66e02ff47667d.json' => base_path('acf-json/group_66e02ff47667d.json'),
], 'person');

Expand All @@ -106,7 +106,7 @@ public function bootingPackage(): void
__DIR__ . '/../stubs/config/poet/taxonomy/project_type.php' => config_path('poet/taxonomy/project_type.php'),
__DIR__ . '/../stubs/resources/views/blocks/FacetWP/loops/project-loop.blade.php' => resource_path('views/blocks/FacetWP/loops/project-loop.blade.php'),
__DIR__ . '/../stubs/resources/views/blocks/FacetWP/templates/project.blade.php' => resource_path('views/blocks/FacetWP/templates/project.blade.php'),
__DIR__ . '/../stubs/resources/views/partials/content-single-project.blade.php' => resource_path('views/partials/content-single-project.blade.php'),
__DIR__ . '/../stubs/resources/views/single-project.blade.php' => resource_path('views/single-project.blade.php'),
], 'project');

$this->publishes([
Expand All @@ -121,8 +121,8 @@ public function bootingPackage(): void
__DIR__ . '/../stubs/resources/views/blocks/FacetWP/templates/events.blade.php' => resource_path('views/blocks/FacetWP/templates/events.blade.php'),
__DIR__ . '/../stubs/resources/views/components/meta/event.blade.php' => resource_path('views/components/meta/event.blade.php'),
__DIR__ . '/../stubs/resources/views/vendor/wp-events/blocks/event-info.blade.php' => resource_path('views/vendor/wp-events/blocks/event-info.blade.php'),
__DIR__ . '/../stubs/resources/views/partials/content-single-yard-event-schedule.blade.php' => resource_path('views/partials/content-single-yard-event-schedule.blade.php'),
__DIR__ . '/../stubs/resources/views/partials/content-single-yard-event.blade.php' => resource_path('views/partials/content-single-yard-event.blade.php'),
__DIR__ . '/../stubs/resources/views/single-yard-event-schedule.blade.php' => resource_path('views/single-yard-event-schedule.blade.php'),
__DIR__ . '/../stubs/resources/views/single-yard-event.blade.php' => resource_path('views/partials/content-single-yard-event.blade.php'),
], 'wp-events');
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
@use(App\View\Components\Card\Enums\Direction)

<div class="@xl:gap-6 grid gap-4">
@forelse ($postDataCollection as $postData)
<x-card.yard-event :postData="$postData" class="card-horizontal" />
<x-card.yard-event :postData="$postData" :direction="Direction::FLUID" />
@empty
<x-facetwp.no-results />
@endforelse
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
@use(App\View\Components\Card\Enums\Direction)

<div class="@xl:gap-6 grid gap-4">
@forelse ($postDataCollection as $postData)
<x-card.knowledgebase class="card-horizontal" :postData="$postData" />
<x-card.knowledgebase :postData="$postData" :direction="Direction::FLUID" />
@empty
<x-facetwp.no-results />
@endforelse
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
@use(App\View\Components\Card\Enums\Direction)

<div class="@xl:gap-6 grid gap-4">
@forelse ($postDataCollection as $postData)
<x-card.news class="card-horizontal" :postData="$postData" />
<x-card.news :postData="$postData" :direction="Direction::FLUID" />
@empty
<x-facetwp.no-results />
@endforelse
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<div class="@xl:gap-6 grid grid-cols-12 gap-4">
@use(App\View\Components\Card\Enums\Direction)

<div class="@xl:gap-6 grid gap-4">
@forelse ($postDataCollection as $postData)
<x-card.project :postData="$postData" />
<x-card.project :postData="$postData" :direction="Direction::FLUID" />
@empty
@include('blocks.FacetWP.partials.no-results')
@endforelse
Expand Down

This file was deleted.

23 changes: 0 additions & 23 deletions stubs/resources/views/partials/content-single-news.blade.php

This file was deleted.

This file was deleted.

53 changes: 0 additions & 53 deletions stubs/resources/views/partials/content-single-project.blade.php

This file was deleted.

This file was deleted.

This file was deleted.

24 changes: 24 additions & 0 deletions stubs/resources/views/single-knowledgebase.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<x-layout.article>
<x-slot:article>
<x-brave-back-button />

<h1>{!! $postData->title() !!}</h1>

{!! $postData->content() !!}

<x-social-share />
</x-slot:article>

<x-slot:bottom>
@if ($postData->related()->isNotEmpty())
<h2 class="alignwide mt-12! xl:mt-16! mb-0">Bekijk ook</h2>
<div class="@container alignwide">
<div class="@2xl:grid-cols-3 @2xl:mt-8 mb-2 mt-4 grid gap-4 lg:gap-6">
@foreach ($postData->related() as $related)
<x-card.knowledgebase :postData="$related" />
@endforeach
</div>
</div>
@endif
</x-slot:bottom>
</x-layout.article>
29 changes: 29 additions & 0 deletions stubs/resources/views/single-news.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<x-layout.article>
<x-slot:article>
<x-brave-back-button />

<h1>{!! $postData->title() !!}</h1>

<time class="my-4 block text-gray-500 md:my-6" datetime="{{ $postData->date('Y-m-d') }}">
<i class="fa-light fa-clock mr-1 sm:mr-2" aria-hidden="true"></i>
{{ $postData->date('j F Y') }}
</time>

{!! $postData->content() !!}

<x-social-share />
</x-slot:article>

<x-slot:bottom>
@if ($postData->related()->isNotEmpty())
<h2 class="alignwide mt-12! xl:mt-16! mb-0">{{ __('Het laatste nieuws', 'sage') }}</h2>
<div class="@container alignwide">
<div class="@2xl:grid-cols-3 @2xl:mt-8 mb-2 mt-4 grid gap-4 lg:gap-6">
@foreach ($postData->related() as $related)
<x-card.news :postData="$related" />
@endforeach
</div>
</div>
@endif
</x-slot:bottom>
</x-layout.article>
11 changes: 11 additions & 0 deletions stubs/resources/views/single-person.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<x-layout.article>
<x-slot:article>
<x-brave-back-button />

<h1>{!! $postData->title() !!}</h1>

<x-meta.person class="mb-6" :email="$postData->email" :phone="$postData->phone" />

{!! $postData->content() !!}
</x-slot:article>
</x-layout.article>
Loading