Closed remcotolsma closed 2 years ago
We are working on 3 blocks for Pronamic Events:
Currently i use the following naming:
pronamic-events/event-start-date
pronamic-events/event-end-date
pronamic-events/event-location
Documentation:
The name for a block is a unique string that identifies a block. Names have to be structured as namespace/block-name, where namespace is the name of your plugin or theme.
namespace/block-name
This results in the following code:
<!-- wp:pronamic-events/event-start-date {"format":"d.m.Y"} /--> <!-- wp:pronamic-events/event-end-date {"format":"d.m.Y"} /--> <!-- wp:pronamic-events/event-location /-->
And the following HTML output:
<div class="wp-block-pronamic-events-event-start-date"><time datetime="2022-05-03T00:00:00+02:00">03.05.2022</time></div> <div class="wp-block-pronamic-events-event-end-date"><time datetime="2022-05-05T00:00:00+02:00">05.05.2022</time></div> <div class="wp-block-pronamic-events-event-location">Some location</div>
We could also choose for the following shorter naming:
pronamic-events/start-date
pronamic-events/end-date
pronamic-events/location
I think I prefer the longer notation, WordPress also uses post-date and not just date:
post-date
date
<!-- wp:post-date {"format":"F j, Y g:i a"} /-->
@kjtolsma @rvdsteege What do you think?
I'd go with the long format too. The long format makes clear that it is the start date of a single event.
We are working on 3 blocks for Pronamic Events:
Currently i use the following naming:
pronamic-events/event-start-date
pronamic-events/event-end-date
pronamic-events/event-location
Documentation:
This results in the following code:
And the following HTML output:
We could also choose for the following shorter naming:
pronamic-events/start-date
pronamic-events/end-date
pronamic-events/location
I think I prefer the longer notation, WordPress also uses
post-date
and not justdate
:@kjtolsma @rvdsteege What do you think?