# Having a common property that can be used in pages and sections

**URL:** <https://zola.discourse.group/t/having-a-common-property-that-can-be-used-in-pages-and-sections/1258>\
**Category:** Feature requests\
**Created:** [April 5, 2022, 6:36pm UTC](https://zola.discourse.group/t/having-a-common-property-that-can-be-used-in-pages-and-sections/1258 "2022-04-05T18:36:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![amcsi](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/amcsi/32/406_2.png) [@amcsi](https://zola.discourse.group/u/amcsi)\
**Post date:** [April 5, 2022, 6:36pm UTC](https://zola.discourse.group/t/having-a-common-property-that-can-be-used-in-pages-and-sections/1258/1 "2022-04-05T18:36:26Z")

</div>

Zola has a concept of pages and sections which have similarities. According to the docs, a lot of the variables of sections and pages are common among the two:

```auto
www.getzola.org/documentation/content/section/#front-matter
www.getzola.org/documentation/content/page/#front-matter

```

The issue though is that when trying to access these variables in the templates, I have to reference the “section” object in sections and the “page” object in pages. This is inconvenient for me, because I have some HTML templates that have shared use across both sections and pages.

Here is a little hack I did to be able to use the variables in a common way by simply copying “section” to “page” in a template if it’s being rendered as a page in my open source blog:

> <https://github.com/amcsi/gabor-website-zola/commit/f7f396ce6f22c3e8af2c1e528ecf7134d2c5e04e>
>
> https://zola.discourse.group/t/how-to-have-text-not-list-of-posts-on-the-home-pa…ge/313/8?u=amcsi

Though to be fair, the reason I needed to do that in the first place was that I couldn’t use the home page properly like a page like in this discussion:

`zola.discourse.group/t/how-to-have-text-not-list-of-posts-on-the-home-page/313/8?u=amcsi`

Anyway, I thought that still, it could possibly be useful if there was a shared object that could be used in both sections and pages that had the common properties. I’m a bit new to Rust, but thanks to some basic knowledge and a lot of IDE help, I was able to write up a Proof-of-Concept commit:

> <https://github.com/amcsi/zola/commit/736b507a008634ffed2ac4fc5671886bc95ae29d>

What are your thoughts?

---

<div class="post-metadata">

**Author:** ![keats](https://avatars.discourse-cdn.com/v4/letter/k/34f0e0/32.png) [@keats](https://zola.discourse.group/u/keats)\
**Post date:** [April 5, 2022, 7:43pm UTC](https://zola.discourse.group/t/having-a-common-property-that-can-be-used-in-pages-and-sections/1258/2 "2022-04-05T19:43:54Z")

</div>

It’s a semi-common issue but I think it’s better done by using the same variable name for both page and section rather than making code changes.
