# Display Clickable Sections inside Nested Sections

**URL:** <https://discourse.gohugo.io/t/display-clickable-sections-inside-nested-sections/23537>\
**Category:** support\
**Created:** [February 19, 2020, 12:46pm UTC](https://discourse.gohugo.io/t/display-clickable-sections-inside-nested-sections/23537 "2020-02-19T12:46:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tariqgm](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/tariqgm/32/10643_2.png) [@tariqgm](https://discourse.gohugo.io/u/tariqgm)\
**Post date:** [February 19, 2020, 12:46pm UTC](https://discourse.gohugo.io/t/display-clickable-sections-inside-nested-sections/23537/1 "2020-02-19T12:46:17Z")

</div>

Hello I am new to Hugo and using Hugo developing a site. Following is the content structure I am using.

```auto
content
| _____ exercises
      |___exercise_type_1
                 |_topic-1_1.md
                 |_topic-1_2.md
                 |-_index.md
      |___exercise_type_2
	          |_topic-2_1.md
	          |_topic-2-2.md
                  |-_index.md

```

My requirement is to display the nested section on every section page. If user click on any nested section it will display all topics. To achieve this I find the following code but it’s showing all content inside Top section and subsections. However, I need to only Subsections inside a section not all content.

Again Top section will show nested sections and clicking on nested section will display if any subsections inside it or content if no subsections inside it.

I am using following code inside list.html under layouts-\>\_default

```
{{- if .Sections -}}
{{- range .Sections -}}					
	{{- range $i, $e := .Data.Pages -}}
		
		<h2>{{ .Title }}</h2>	
		<p><a href="{{ .RelPermalink }}">{{ .Title }}</a></p>
	{{- end -}}
{{- end -}}				
{{- end -}}

{{- range $i, $e := .Data.Pages -}}
									
<p><a href="{{ .Permalink }}">{{ .Title }}</a></p>	

{{- end -}}

```

Please guide me if you can I am stuck here and need to fix ASAP.

Thank you

---

<div class="post-metadata">

**Author:** ![nfriedli](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/nfriedli/32/26027_2.png) [@nfriedli](https://discourse.gohugo.io/u/nfriedli)\
**Post date:** [February 19, 2020, 6:01pm UTC](https://discourse.gohugo.io/t/display-clickable-sections-inside-nested-sections/23537/2 "2020-02-19T18:01:41Z")

</div>

You can use `Parent` to list your in-section pages and subsections.  
Then a recursive call like: [Snippet - partial for creating breadcrumbs (uses Bootstrap 4)](https://discourse.gohugo.io/t/snippet-partial-for-creating-breadcrumbs-uses-bootstrap-4/15426/2)
