added samples to search result card
This commit is contained in:
parent
e07c6b5260
commit
1ca9937fd4
|
@ -70,6 +70,7 @@ type SearchResult {
|
|||
images: [Image]
|
||||
visuels: [Image]
|
||||
reference: String
|
||||
samples: [Sample]
|
||||
}
|
||||
|
||||
type Product {
|
||||
|
|
|
@ -342,6 +342,12 @@ class MaterioSchemaExtension extends SdlSchemaExtensionPluginBase {
|
|||
->map('path', $builder->fromValue('field_reference.value'))
|
||||
);
|
||||
|
||||
$registry->addFieldResolver('SearchResult', 'samples',
|
||||
$builder->produce('property_path')
|
||||
->map('type', $builder->fromValue('entity:node'))
|
||||
->map('value', $builder->fromParent())
|
||||
->map('path', $builder->fromValue('field_samples'))
|
||||
);
|
||||
}
|
||||
|
||||
// ___ _
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -16,5 +16,12 @@ fragment SearchResultFields on SearchResult {
|
|||
alt
|
||||
style_cardmedium_url
|
||||
style_hd_url
|
||||
}
|
||||
samples{
|
||||
showroom{
|
||||
name
|
||||
id
|
||||
}
|
||||
location
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,6 +27,20 @@
|
|||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
<section class="tool samples" v-if="item.samples && item.samples.length">
|
||||
<span class="btn mdi mdi-beaker-outline"/>
|
||||
<div class="tool-content">
|
||||
<span class="label">{{ $t("materio.Samples") }}</span>
|
||||
<ul>
|
||||
<li
|
||||
v-for="sample in item.samples"
|
||||
:key="sample.showroom.id"
|
||||
>
|
||||
<span class="showroom">{{ sample.showroom.name }}</span>: {{ sample.location }}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</nav>
|
||||
<section class="images" v-switcher>
|
||||
<figure
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
<section class="tool samples">
|
||||
<section class="tool samples" v-if="item.samples && item.samples.length">
|
||||
<span class="btn mdi mdi-beaker-outline"/>
|
||||
<div class="tool-content">
|
||||
<span class="label">{{ $t("materio.Samples") }}</span>
|
||||
|
|
Loading…
Reference in New Issue