#Breadcrumbs Missing After Custom View Implementation?

37 messages · Page 1 of 1 (latest)

violet gardenBOT
#

Hello, when I replace collection view with my custom view BreadCrumbs don't show current route anymore, is this a bug or am I doing smth wrongly? (payload 3.0)

unique folioBOT
#

Original message from @slow lodge - Moved from #general message

compact frigate
slow lodge
#

Already tried it and unfortunately it's throwing error:

compact frigate
#

And the SetStepNav component doesn't work for you either?

compact frigate
#

Can you share how you are defining your custom view

#

In config

slow lodge
#
import CustomAnalytics from '@/components/CustomAnalytics'
import { BeforeOperationHook } from 'node_modules/payload/dist/collections/config/types'
import { CollectionConfig, PayloadComponent } from 'payload'

export const Analytics: CollectionConfig = {
  slug: 'analytics',
  admin: {
    useAsTitle: 'title',
    group: 'Workspace',
    components: {
      views: {
        list: {
          Component: '/components/CustomAnalytics',
        },
      },
    },
  },

  fields: [
    {
      name: 'title',
      type: 'text',
      required: true,
      admin: {
        hidden: false,
      },
    },
  ],
}
#

also when I log nav object, I get undefined so I guess it might be connected to the problem

compact frigate
#

Yeah, not sure where you are pulling that nav from tbh

#

But it doesn't get automatically passed in

#

You should use the collection configs plural label

#

Or some other navItem[]

#

I think that's the issue here

slow lodge
#

I mean even if I manually set string as value, it still returns the same error for the setStepNav, that it's not a function...

compact frigate
#

Hmm, weird - what Payload version are you using?

slow lodge
#

3.0

#

The other guy that you managed to help was facing exactly same problem but for him SetStepNav component worked...

compact frigate
#

I mean what actual version? 3.0 has had a bunch of releases since launch

#

Do other hooks work for you?

#

Try useAuth

#

Just to test

slow lodge
#

@compact frigate fixed it, turns out I had version mismatch :))

compact frigate
#

Ah very nice!

#

Glad you figured it out here

slow lodge
#

Thanks for your help

#

It's much appreciated

compact frigate
#

It's my pleasure, truly

slow lodge
unique folioBOT