Hi, I am using collections and dynamic pages in a non conventional way (so it seems :))
I have a financial calculator which I market to insurance agents - each agent shows the page as if it was his calculator so I have multiple items each with a different look and feel. for that I built a dynamic page in which the content is changed according to the agent’s content (logo, BG images, about us etc.) I retrieve the current Item (after page and dataset are ready) from the collection and set the page elements with the retrieved data - some of it is directly connected via the editor “connect to data set” and some is set by code. Example for 2 collection “items”:
The thing is I have a sensitive information in that collection on top of the operational information (the images, text etc.) I tried setting the sensitive field as a “personally identifiable data” but it can still be shown as clear text in the console (both i preview and live site).
What I would like to do is to call the getCurrentItem function from backend and then filter out the sensitive fields before sending it to frontend - thus hiding both dataset name and current Item from front end. But, I don’t know how to get the current Item id only (current dynamic page id) without calling getCurrentItem
I thought of storing the sensitive data in a separate collection but a novice hacker will be able to use the retrieved item data (such an ID) to get data from the other collection
Appreciate any directions
Thanks
Instead of using a dynamic page, you can use a router page: on backend/routers.js query the collection, delete the sensitive fields from the results and return the processed results.
Thank you for the quick response J. D.
From what I read so far, you can’t direct from a router to a dynamic page - so I converted the dynamic page to a router page (dynamic to static and then add to router).
The question now is how (if at all) I set strip background dynamically as was when it was a dynamic page? there is no option to do so using code so it has to be using a dataset in editor - but now I can’t just connect strip background to a dataset as the page won’t “know” which line to reference in the collection.
(Each line in the collection represents a different insurance agent page elements)
EDIT: the strip BG is video, I tried overlaying the strip with a video element - so that i can use the src property to set the video source - but afer resizing it to the size of the strip (full width) I noticed it shows only at base resolution with the rest of the video player showing as black.
Yes. Unfortunately the api for strips is quite limited. I didn’t know you can make it dynamic via the editor.
So if you can’t do with code, you can either use a custom element to create a custom strip instead (if you know how to use CSS and html) or you should stay with the dynamic page and split you collection so the sensitive info won’t be in the collection that you retrieve.
Another possible option is to keep everything in the same collection, but to create an afterQuery data hook that removes the confidential data (and you need to use the confidential data, suppress the hook on the backend. You can suppress hooks from the front end).