Doctype not being recognized in my code

Hello! I have a prismic repo for an internal site at my company. We have multiple document types, one of which is document, and one is training document (training_document). We have the custom types set up, and the UIDs show properly as what they should be. We also have documents created of each type, which render on the pages. However, when I console.log(doc.type) the system does not always recognize what doc.type it is. If it is a training document, it should log "training_document" but often logs "document". Am I doing something wrong? Why does it not recognize what type it is? I verified many times in prismic that it actually is a training doc, but it is just not seeing that sometimes. for some documents, it recognizes and for others it does not. Any help is appreciated. Thank you!

Hi @winnie.dresden ,

It would be interesting to know more about you're use case for what you're trying to achieve here.

But to understand why you're not seeing the doc type, I would need to know your repo URL and for you to show me the full code that you are doing to get the content.

Thanks.

hi Phil, thanks for getting back to me! The use case here is that we want a training_document page to behave differently than a "regular" doc. The issue we are running into, is that if you click into a training page from search (we use algolia for our search) the proper page will load but not the proper side-navigation for that page. Since training docs and regular docs are set up to have different navigations, we have found that the docs that are actually being recognized as a 'training document' have the proper nav loaded, while those that are showing as "document" do not load the proper nav, but keeps the nav from the previous page. I've found that there are certain functions that do not get hit when the page is a training document.
Here is the link to our repo https://finxact-learning.prismic.io/documents/working?l=en-us
not sure if that will work. I am not able to share our code with you however.

Hi @winnie.dresden ,

Sorry about the long delay in the response. I'm not sure I can help unless I see your code. If you would be more comfortable sharing it in private you can contact us on our support portal:

https://prismic.atlassian.net/servicedesk/customer/portals