Conteúdo
After a packed version 0.19 and a discrete update with fixes (0.19.1), it’s time to bring you another version of cycle 19 (which as we promised before, will be the last one before 1.0). And the big focus of this cycle is on metadata, so today we have more news for those who have just started to organize their information with the metadata sections!
What’s new
Metadata and Section Blocks
Tainacan’s family of Gutenberg blocks has just gained 6 new blocks! To see them, just go to any post or page on your site and search for the block Metadata Sections. Choose an item you want to show and…
Using a block hierarchy, it is loaded, for the item you have selected:
- The list of its metadata sections
- For each section, a single section block
- For each section block, a section title, section description and its list of item metadata
- For each metadata list block, a single item metadatum block
- For each section block, a section title, section description and its list of item metadata
- For each section, a single section block
Using this hierarchy, you will have the flexibility to enter only the information you are interested in, either an entire set of metadata, or a single metadata at a time. All of these blocks also come with various customization options such as colors and typography, spacing and alignment, etc.
The way the blocks are related also gives you the flexibility to re-order and remove some fields. However, with great power comes great responsibility!
It is important to know that re-ordering or removing one of the child blocks here will not reflect on how this information is organized in Tainacan itself, this is only valid for this presentation layer of the blocks.
If on the other hand, you want to ensure that this block reflects all changes made on the administrative side (such as changing the order of metadata and adding new ones), we have an option in the root blocks that allows you to block this flexibility, “Dynamically sync with Tainacan”:
On the other hand, if your intention is just to show some metadata, it is easy to rearrange it to make a table or columns, for example, and still ensure that the metadata values themselves are up to date.
Improvements
Textual search refactor for better performance
We have constantly sought to improve the performance of the Tainacan search, both in terms of expected behavior and speed. In this release, we bring a number of tweaks that should improve the performance of the textual search. In addition, we are introducing a new default behavior that should help you find more objectively what you are looking for. Here is how it works:
If in previous versions a textual search for basket of straw was done in the general search, it would internally search for the terms “basket” OR “of” OR “straw” in every metadata of all the items in the collection. This might sound interesting, but it was bringing results that were difficult to interpret, where for example an item might have the term “strawberry” in the title metadata and “basketball” in the description metadata. This could be handled by wrapping the search terms in quotes (“straw of basket”), but many people never knew about this option… so we changed strategy.
Now, a search for basket of straw will search for this complete phrase. Although it keeps searching through all the metadata, the words must be together and in this order. At most, this can result in situations like “basket of straws”. In this way, the search helps you find what you need in a more precise way.
And if you prefer the old way, it is still possible to pass parameters to the API (sentence=true
) that use the old strategy. We are already developing a visual interface so that this can be achieved by regular users. In any case, more complex searches can also be done with the advanced search or with filters.
Enhanced compatibility for themes in the item single page
Theme support for Tainacan pages has always been a very important issue for our team. If you are one of the users that doesn’t want to stick with Tainacan Interface or Blocksy (both of which we support with the new released features), you have probably already seen the theme support documentation. There we mention that there are two page “templates” that a theme needs to implement in order to say that it supports Tainacan:
- The pages that list Tainacan items (whether repository, collection or term), which by default look like a WordPress post list;
- The pages for a Tainacan item itself, which also looks like a post, without showing attachments and sections.
For the first case, we introduced the Faceted Search block and will soon have more options that make it easier to use. For the second, however, the alternative has always been to get our hands on the code. Now, fortunately, we have better compatibility with any theme for the item page. Regardless of which theme you are using, the item page will show:
- The Main Document, including its media gallery with zoom;
- The public metadata sections, in a linear fashion on a single column;
- A carousel of attachments, also with a zooming gallery.
This is a great improvement over the previous standard, which displayed the raw document, regardless of its format, followed by the metadata without their sections and no list of attachments:
E so much more!
- Compatibility of the Item Gallery Block and the new Metadata blocks with editing templates/page templates in Full Site Editing (FSE) themes.
- Order blocks that have manual selection by their selection order instead of creation date;
- Hides the metadata section if there is no metadata value on the item page;
- Compatibility with the CSS of modals in WordPress 6.1.
Bug fixes
- Fixed bug where some repository level metadata was not displayed within sections;
- Fixed error with items related to this not showing the thumbnail correctly;
- Fixed error of items related to this not showing the correct link on sites with sub-directories;
- Prevent an item from being listed twice in the same relationship metadata;
- Fixed error related to status in the repository level search;
- Prevents undeclared warnings of
wp.hooks
for previous WordPress versions; - Minor fixes to general and advanced search;
- Several translation fixes.
For developers
- We renamed the
/metadatasection
endpoint to/metadata-sections
. - The new endpoint
/item/:idem_id/metadatasection/>id_metadata_section
allows you to get the metadata of an item pre-filtered by section.
Get it now!
Tainacan version 0.19.2 is now available. You can download or update it directly from your WordPress dashboard: