How to use baseCollectionPath with Firestore hierarchy? #537
Replies: 3 comments 4 replies
-
Hi @rickpasetto
|
Beta Was this translation helpful? Give feedback.
-
Got it, in that case you can just set the complete path in the collection config, and ignore basePath and baseCollectionPath.
Path need to have an odd number of segments |
Beta Was this translation helpful? Give feedback.
-
Hi Rick, that sounds like a bug then. So the error is only happening when
deep linking?
…On Thu, Aug 17, 2023 at 3:01 AM Rick Pasetto ***@***.***> wrote:
Got it, in that case you can just set the complete path in the collection
config, and ignore basePath and baseCollectionPath.
You can set the path in collections in any collection level, so you can do:
path: "cms/app1/subcol"
Yep, that's exactly what I'm doing. But when I do that, deep-linking (or
simply page refresh) fails (gets a 404) when CMS is inside that collection.
Note it only happens on production builds (not when developing and pointing
at localhost). Could it be a bug, or perhaps still user error on my part?
—
Reply to this email directly, view it on GitHub
<#537 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABHCCD24EEHJRWIGF5IQNMLXVVUP3ANCNFSM6AAAAAA3KTYWZY>
.
You are receiving this because you commented.Message ID:
***@***.***>
--
Camberi - Madrid, Munich, Milan
|
Beta Was this translation helpful? Give feedback.
-
Greetings. This has been something that I've been stuck on for a while. I am hoping someone can please help.
I have my Firebase Firestore CMS storage set up such that the base collections are not at the top level, but under a hierarchy. In my case, for example, I have the following:
/cms/app1/collectionA/...
/cms/app1/collectionB/...
/cms/app2/collectionC/...
/cms/app2/collectionD/...
Each app has its own set of collections, so they aren't mixed (and in fact have their own CMS instances). In other words, I just need FireCMS to operate under a non-top-level root. So, to achieve this, I tried setting up FireCMS, say for
app1
, like this:...and each collection defines it subpath, e.g.
...etc.
Now, the problem is, this doesn't work when I descend into one of these sub collections. I get the following error:
But, if I ignore
baseCollection
, and set each of my collections with an absolute path, like this:...and each collection defines it subpath, e.g.
...then, it works.... EXCEPT, now routing (deep-linking, i.e. trying to open
http://.../cms/app1/collectionA
directly) no longer works.I have tried using
basePath
instead ofbaseCollectionPath
, or setting both, and nothing seems to work. Unfortunately the documentation isn't that informative:Can someone please help? Maybe I'm doing something wrong?
Beta Was this translation helpful? Give feedback.
All reactions