# Zola 12 current\_path Issue

**URL:** <https://zola.discourse.group/t/zola-12-current-path-issue/589>\
**Category:** Support\
**Created:** [September 16, 2020, 9:48am UTC](https://zola.discourse.group/t/zola-12-current-path-issue/589 "2020-09-16T09:48:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![SgtIria](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/sgtiria/32/85_2.png) [@SgtIria](https://zola.discourse.group/u/SgtIria)\
**Post date:** [September 16, 2020, 9:48am UTC](https://zola.discourse.group/t/zola-12-current-path-issue/589/1 "2020-09-16T09:48:12Z")

</div>

# Problem with `current_path`

I’m comparing output from **zola 11** verses **version 12**.

Using the following template snippet:

```auto
    <!-- Taxonomy SEO -->

    <!-- critical -->
	{% if term -%}
		{% set tparent = current_path | split(pat="/") | first | capitalize -%}
		{% set tname = term.name | capitalize -%}
		{% if tparent=="English" -%}
			<title>English {{ tname }} Lessons</title>	
		{% elif tparent=="Downloads" -%}
			<title>English {{ tname }} {{tparent}}</title>			
		{% else -%}
			<title>Adept English {{ tname }} - {{tparent}}</title>		
		{% endif -%}
	{% else -%}
		<title>{{ config.title}}</title>
	{% endif -%}

```

We customised the title of each page based on it’s path. We do this for `taxonomies` to get the parent of this term.

## Zola 11 output…

```auto
      <!-- Taxonomy SEO -->

    <!-- critical -->
	<title>Adept English Andrew - Authors</title>

```

## Zola 12 output…

```auto
      <!-- Taxonomy SEO -->

    <!-- critical -->
	<title>Adept English Andrew - </title>	

```

> It appears the `{{tparent}}` variable is now empty.

We use split path a lot, mostly for breadcrumbs lists throughout the site.

## Zola 11 output…

```auto
        <nav class="breadcrumb" aria-label="breadcrumbs">
            <ul>
                <li><a class="is-capitalized" href="https://adeptenglish.com">🏠 Home</a></li>
                
                <li><a class="is-capitalized" href="https://adeptenglish.com/authors">authors</a></li>
                <li class="is-active"><a class="is-capitalized" href="#">Andrew</a></li>
            </ul>
        </nav>

```

## Zola 12 output

```auto
        <nav class="breadcrumb" aria-label="breadcrumbs">
            <ul>
                <li><a class="is-capitalized" href="https://adeptenglish.com">🏠 Home</a></li>
                
                <li><a class="is-capitalized" href="https://adeptenglish.com/"></a></li>
                <li class="is-active"><a class="is-capitalized" href="#">Andrew</a></li>
            </ul>
        </nav>

```

> Note the missing authors

## Thoughts…

I’m pretty sure this is because the split path | first no longer works as `current_path` now has an additional `/` slash.

If the new current\_path is necessary, could you suggest a way of splitting the path and getting the same output as we used to using tera split path?

---

<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:** [September 16, 2020, 10:45am UTC](https://zola.discourse.group/t/zola-12-current-path-issue/589/2 "2020-09-16T10:45:44Z")

</div>

> [@SgtIria](#):
>
> ` {% set tparent = current_path | split(pat="/") | first | capitalize -%}`

You can probably do something ` {% set tparent = current_path | trim_start_matches(pat="/") | split(pat="/") | first | capitalize -%}` or get the second object via index but that takes more than a line

---

<div class="post-metadata">

**Author:** ![SgtIria](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/sgtiria/32/85_2.png) [@SgtIria](https://zola.discourse.group/u/SgtIria)\
**Post date:** [September 16, 2020, 10:48am UTC](https://zola.discourse.group/t/zola-12-current-path-issue/589/3 "2020-09-16T10:48:02Z")

</div>

Oh OK, I’ll try that workaround. When you say using the index, do you mean

```auto
tparent[1]

```

Not sure if that is the correct syntax?

Also is tera 0 indexed?

Thanks

---

<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:** [September 16, 2020, 10:49am UTC](https://zola.discourse.group/t/zola-12-current-path-issue/589/4 "2020-09-16T10:49:06Z")

</div>

yep that’s what I meant. Tera is 0 indexed

---

<div class="post-metadata">

**Author:** ![SgtIria](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/sgtiria/32/85_2.png) [@SgtIria](https://zola.discourse.group/u/SgtIria)\
**Post date:** [September 22, 2020, 3:33pm UTC](https://zola.discourse.group/t/zola-12-current-path-issue/589/5 "2020-09-22T15:33:41Z")

</div>

> [@keats](#):
>
> You can probably do something ` {% set tparent = current_path | trim_start_matches(pat="/") | split(pat="/") | first | capitalize -%}` or get the second object via index but that takes more than a line

This worked perfectly, and it keeps backward compatibility. So thank you for this suggestion.
