# Panel sidebar: using different fields instead of the title field

**URL:** <https://forum.getkirby.com/t/panel-sidebar-using-different-fields-instead-of-the-title-field/8575>\
**Category:** Questions\
**Tags:** v2\
**Created:** [September 21, 2017, 9:26am UTC](https://forum.getkirby.com/t/panel-sidebar-using-different-fields-instead-of-the-title-field/8575 "2017-09-21T09:26:44Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![hvsrmusic](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/hvsrmusic/32/2722_2.png) [@hvsrmusic](https://forum.getkirby.com/u/hvsrmusic)\
**Post date:** [September 21, 2017, 9:26am UTC](https://forum.getkirby.com/t/panel-sidebar-using-different-fields-instead-of-the-title-field/8575/1 "2017-09-21T09:26:44Z")

</div>

I’m pretty sure someone else already asked it, but I couldn’t find anything.

Music reviews site: the main fields of every article are:

- “Artist” field
- “Title” field

Now, I’d like to show in the sidebar panel (pages and subpages area) both the fields, just like this:

- Reviews  
– Rolling Stones: Sticky Fingers  
– Metallica: Kill 'em all  
…and so on.

Any hint?

I would also like to customize the slug using both the field (not only the title) but I think I can solve this problem with some hooks.

Thanx

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [September 21, 2017, 9:35am UTC](https://forum.getkirby.com/t/panel-sidebar-using-different-fields-instead-of-the-title-field/8575/2 "2017-09-21T09:35:32Z")

</div>

> [@hvsrmusic](#):
>
> I would also like to customize the slug using both the field (not only the title) but I think I can solve this problem with some hooks.

Yes, you can use a `panel.page.create` hook for that.

The Panel sidebar can only show the title, there is no option to change that. Possible solutions:

- modify the Panel core
- use some hacky JS via a field to inject the second field value
- create a new title from both fields either via a hook or on page creation (and copy the title to another field for use in your templates)

---

<div class="post-metadata">

**Author:** ![mrunkel](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/mrunkel/32/4646_2.png) [@mrunkel](https://forum.getkirby.com/u/mrunkel)\
**Post date:** [June 28, 2018, 1:17pm UTC](https://forum.getkirby.com/t/panel-sidebar-using-different-fields-instead-of-the-title-field/8575/3 "2018-06-28T13:17:10Z")

</div>

My question is also around that widget in the panel.

My users would prefer to see the slug instead of the page title in the list as they are used to navigating that way. It also makes it easier if they are trying to get to /foo/bar to just click on foo and bar instead of having to remember what foo and bar are called.

So, I’m curious about replacing that widget. If I create a widget of the same name with almost the same functionality, will the system use mine instead?

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [June 28, 2018, 1:25pm UTC](https://forum.getkirby.com/t/panel-sidebar-using-different-fields-instead-of-the-title-field/8575/4 "2018-06-28T13:25:20Z")

</div>

There is no sidebar widget that you can overwrite with another widget. The code for what is shown in the sidebar is in a snippet in `/panel/app/snippets/pages/sidebar/subpage.php`

---

<div class="post-metadata">

**Author:** ![mrunkel](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/mrunkel/32/4646_2.png) [@mrunkel](https://forum.getkirby.com/u/mrunkel)\
**Post date:** [June 28, 2018, 1:25pm UTC](https://forum.getkirby.com/t/panel-sidebar-using-different-fields-instead-of-the-title-field/8575/5 "2018-06-28T13:25:33Z")

</div>

Answered my own question by just trying it out.

Yes. It works.

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [June 28, 2018, 1:26pm UTC](https://forum.getkirby.com/t/panel-sidebar-using-different-fields-instead-of-the-title-field/8575/6 "2018-06-28T13:26:06Z")

</div>

Interestesting, could you elaborate what you did?

---

<div class="post-metadata">

**Author:** ![mrunkel](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/mrunkel/32/4646_2.png) [@mrunkel](https://forum.getkirby.com/u/mrunkel)\
**Post date:** [June 28, 2018, 1:28pm UTC](https://forum.getkirby.com/t/panel-sidebar-using-different-fields-instead-of-the-title-field/8575/7 "2018-06-28T13:28:34Z")

</div>

Sure.

I created a directory in site/widgets called pages. In that directory I copied the pages.php and pages.html.php from the panel/widgets/pages directory.

I also copied the snippet from panel/snippets/pages/sidebar/subpage.php to site/snippets/panel/subpage.php and adjusted pages.html.php to load it instead with the snippet function. (instead of the panel snippet function)

I then just edited the subpage.php snippet.

Seems to work just fine.

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [June 28, 2018, 1:32pm UTC](https://forum.getkirby.com/t/panel-sidebar-using-different-fields-instead-of-the-title-field/8575/8 "2018-06-28T13:32:26Z")

</div>

Well, yes, that replaces the Dashboard widget, but not what is shown in the Panel _sidebar_?

---

<div class="post-metadata">

**Author:** ![mrunkel](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/mrunkel/32/4646_2.png) [@mrunkel](https://forum.getkirby.com/u/mrunkel)\
**Post date:** [June 28, 2018, 1:34pm UTC](https://forum.getkirby.com/t/panel-sidebar-using-different-fields-instead-of-the-title-field/8575/9 "2018-06-28T13:34:55Z")

</div>

Yeah, on the actual pages themselves, this trick doesn’t work. I see that the OP was asking about something else. I naively assumed it was all the same snippet/widget being reused.

Oh well, at least they’ll be happy about the first click. 🙂

As always, thanks for the fast and helpful replies.

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [June 28, 2018, 1:44pm UTC](https://forum.getkirby.com/t/panel-sidebar-using-different-fields-instead-of-the-title-field/8575/10 "2018-06-28T13:44:46Z")

</div>

Yeah, for the sidebar, it’s not that straightforward. Maybe it can be done by hijacking the subpages route, similar to what @lukaskleinschmidt has done here: [https://github.com/lukaskleinschmidt/kirby-custom-add-form/blob/master/custom-add-form.php](https://github.com/lukaskleinschmidt/kirby-custom-add-form/blob/master/custom-add-form.php)

---

<div class="post-metadata">

**Author:** ![distantnative](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/distantnative/32/11319_2.png) [@distantnative](https://forum.getkirby.com/u/distantnative)\
**Post date:** [February 6, 2025, 5:27pm UTC](https://forum.getkirby.com/t/panel-sidebar-using-different-fields-instead-of-the-title-field/8575/11 "2025-02-06T17:27:53Z")

</div>

Archived on February 6, 2025, 5:27pm UTC


