Custom Archetypes in section

Hello. I need help. I have the section “career”. In this section I published the vacancies.
Each vacancy have parameters like: requirements, department and etc.

I want to insert each parameter in a variable and then use it in a template “list”.

For example, in the “list” template - {{ .department }}

How to do it?

I understand that I need to create the file in “themes/mytheme/archetypes/”.
file contents

title = ""
description = ""
tags = []
department = ""

And then in insert the code {{ .department }}. But it is not working

Try .Params.department

No work :frowning:

Where are you placing this in your list template? Is this in a range or are you talking about accessing it in the section page itself, in which case you can create an at content/careers/ that can contain both front matter and content.

If you have a bunch of markdown files at content/careers/*.md, maybe you are looking for something like this:

<!--.e.g, in layouts/section/careers.html-->
<ul class="careers">
{{ range .Data.Pages }}
    <li class="career">{{ .Title }} | {{ .Params.department }}</li>
{{ end }}

If you can provide more templating examples, maybe I can provide more assistance…

In content files (*.md) you need to use shortcodes.

Good point. I made an assumption that was a reference to list.html.

@igramnet can you tell me if you’re talking about the list template or the content file, please?