diff --git a/src/gutenberg-blocks/tainacan-facets/facets-list/facets-list-theme.js b/src/gutenberg-blocks/tainacan-facets/facets-list/facets-list-theme.js
index ea0c8d83c..c294635da 100644
--- a/src/gutenberg-blocks/tainacan-facets/facets-list/facets-list-theme.js
+++ b/src/gutenberg-blocks/tainacan-facets/facets-list/facets-list-theme.js
@@ -10,7 +10,8 @@ document.addEventListener("DOMContentLoaded", () => {
metadatumId: '',
metadatumType: '',
collectionId: '',
- collectionSlug: '',
+ collectionSlug: '',
+ parentTermId: null,
showImage: true,
showItemsCount: true,
showSearchBar: false,
@@ -30,7 +31,8 @@ document.addEventListener("DOMContentLoaded", () => {
metadatumId: this.metadatumId,
metadatumType: this.metadatumType,
collectionId: this.collectionId,
- collectionSlug: this.collectionSlug,
+ collectionSlug: this.collectionSlug,
+ parentTermId: this.parentTermId,
showImage: this.showImage,
showItemsCount: this.showItemsCount,
showSearchBar: this.showSearchBar,
@@ -51,6 +53,7 @@ document.addEventListener("DOMContentLoaded", () => {
this.metadatumType = this.$el.attributes['metadatum-type'] != undefined ? this.$el.attributes['metadatum-type'].value : undefined;
this.collectionId = this.$el.attributes['collection-id'] != undefined ? this.$el.attributes['collection-id'].value : undefined;
this.collectionSlug = this.$el.attributes['collection-slug'] != undefined ? this.$el.attributes['collection-slug'].value : undefined;
+ this.parentTermId = this.$el.attributes['parent-term-id'] != undefined ? this.$el.attributes['parent-term-id'].value : undefined;
this.showImage = this.$el.attributes['show-image'] != undefined ? this.$el.attributes['show-image'].value == 'true' : true;
this.showItemsCount = this.$el.attributes['show-items-count'] != undefined ? this.$el.attributes['show-items-count'].value == 'true' : true;
this.showSearchBar = this.$el.attributes['show-search-bar'] != undefined ? this.$el.attributes['show-search-bar'].value == 'true' : false;
diff --git a/src/gutenberg-blocks/tainacan-facets/facets-list/facets-list-theme.vue b/src/gutenberg-blocks/tainacan-facets/facets-list/facets-list-theme.vue
index 9ea3dc21a..90f305d0f 100644
--- a/src/gutenberg-blocks/tainacan-facets/facets-list/facets-list-theme.vue
+++ b/src/gutenberg-blocks/tainacan-facets/facets-list/facets-list-theme.vue
@@ -158,7 +158,8 @@ export default {
metadatumId: String,
metadatumType: String,
collectionId: String,
- collectionSlug: String,
+ collectionSlug: String,
+ parentTermId: String,
showImage: Boolean,
showItemsCount: Boolean,
showSearchBar: Boolean,
@@ -227,7 +228,15 @@ export default {
queryObject.offset = this.offset;
if (this.lastTerm != undefined)
queryObject.last_term = this.lastTerm;
-
+
+ // Set up parentTerm for taxonomies
+ if (this.parentTermId !== undefined && this.parentTermId !== null && this.parentTermId !== '' && this.metadatumType == 'Taxonomy')
+ queryObject.parent = this.parentTermId;
+ else {
+ delete queryObject.parent;
+ this.parentTermId = null;
+ }
+
// Parameter fo tech entity object with image and url
queryObject['context'] = 'extended';
diff --git a/src/gutenberg-blocks/tainacan-facets/facets-list/index.js b/src/gutenberg-blocks/tainacan-facets/facets-list/index.js
index 9d2e3c521..bb5291d9c 100644
--- a/src/gutenberg-blocks/tainacan-facets/facets-list/index.js
+++ b/src/gutenberg-blocks/tainacan-facets/facets-list/index.js
@@ -422,7 +422,7 @@ registerBlockType('tainacan/facets-list', {
@@ -542,7 +542,8 @@ registerBlockType('tainacan/facets-list', {
setAttributes({
metadatumId: metadatumId,
metadatumType: metadatumType,
- isModalOpen: false
+ isModalOpen: false,
+ parentTerm: null
});
setContent();
}}
@@ -585,7 +586,7 @@ registerBlockType('tainacan/facets-list', {
isPrimary
type="submit"
onClick={ () => openMetadataModal() }>
- {__('Configure search', 'tainacan')}
+ {__('Select facets', 'tainacan')}
): null
@@ -642,12 +643,32 @@ registerBlockType('tainacan/facets-list', {
{__('List facets from a Tainacan Collection or Repository', 'tainacan')}
{__('or', 'tainacan')}
+ +