I am new to Sitecore JSS
development. I am really struggling with how placeholders are working in JSS. I am using VUE.JS for my development. I have three root level placeholders in the layout.vue
. I can see the root level placeholders are working but the placeholder inside my component is not showing the data:
Below is my VUE code for footer
component:
<div class="row">
<div class="component link-list col-8 col-sm-9 col-lg-10 footer-links--major">
<div class="component-content">
<placeholder name="jss-footer/jss-top-links" :rendering="rendering" /> //this is not showing
</div>
</div>
The LinkList
component code (Not displayed):
<template>
<ul>
<li class="item0 odd first">
<div class="field-link">
<!-- <div> <pre>{{JSON.stringify(rendering) }}</pre> </div> -->
<a href="/about-us" target=""><span>About us</span></a>
</div>
</li>
<li class="item1 even">
<div class="field-link">
<a href="/about-us/careers" target=""><span>Careers</span></a>
</div>
</li>
<li class="item2 odd">
<div class="field-link">
<a href="/about-us/news-and-media" target=""><span>News and media</span></a>
</div>
</li>
<li class="item3 even">
<div class="field-link">
<a href="/help-contact" target=""><span>Help & Contact</span></a>
</div>
</li>
<li class="item4 odd last">
<div class="field-link">
<a href="https://www.abc.com.au/login" target=""><span>My RACQ Account</span></a>
</div>
</li>
<pre> {{JSON.stringify(fields)}} </pre>
</ul>
</template>
<script>
//import { Link } from '@sitecore-jss/sitecore-jss-vue';
export default {
name: 'LinkList',
components: {
},
props: {
rendering: {
type: Object,
default: () => ({}),
},
fields: {
type: Array,
default: () => ([]),
},
},
};
</script>
My layout.vue
<template>
<div>
<visitor-identification />
<placeholder name="jss-header" :rendering="route" />
<div class="container">
<placeholder name="jss-main" :rendering="route" />
<placeholder name="jss-footer" :rendering="route" />
</div>
</div>
</template>
<script>
import { Placeholder } from '@sitecore-jss/sitecore-jss-vue';
import VisitorIdentification from './VisitorIdentification';
import 'bootstrap/dist/css/bootstrap.css';
import './assets/app.css';
export default {
name: 'Layout',
props: {
route: {
type: Object,
default: () => ({}),
},
rendering: {
type: Object,
default: () => ({}),
}
},
metaInfo() {
return {
title:
(this.route.fields && this.route.fields.pageTitle && this.route.fields.pageTitle.value) ||
'Page',
};
},
components: {
Placeholder,
VisitorIdentification,
},
};
</script>
I am using page designs and partial designs to add footer to the SXA. The footer is added but top links are not below is my sitecore setup: