I have a problem identifying the type of document that I am querying. My URL structure is fully dynamic, which means that I cannot insert the type name into the URL. Is it better in my case to have multiple types or to do everything with just one type? The main problem, in that case, would be that the content posts will be difficult to navigate. Is that the case?
We are using the standard approach available in your documentation, but could not find if we need to send "post type" within a query if we already use the UID. This becomes a problem when we have multiple types on the same level within the URL structure. Mainly, that is the use case.
You need to send the document type in API query like here. In getByUID, you need to send two parameters: one is document type and another one is uid. It is mandatory to send document type because different custom types can have the same uid.
Now for the another point of having multiple document types for the same level within URL structure:
(I'm assuming you are using nuxt framework)
If DOM structure (rendering) is same for all URLs of types and Uid combination.
For example: If you have folder structure like: /pages/:document-type/:uid, and two URLs like /type1/uid1 and /type2/uid2, then after getting different data results from getByUid query, same redering can be applied.
If DOM structure (rendering) is not the same for all uid and document types combinations, you need to fix the document type in URL like /pages/type1/:uid, and /pages/type2/:uid.
It would be better if you can share the code with me.