Hello Tom,
Thank you for getting back to me
My problem is that myWidgetType.load is being called numerous times for a single page even though it a singleton, and there is only one instance of it.
Through debugging, I did notice the value of req.url changed each time the "load" method was being called.
The first time the "load" method is called the req.url is the slug of the page as expected. The times after that the req.url includes file urls like image files.
This is log output when a single page is access with that widgetType and nothing else. The calls are sequential in order.
==== Start Log =====
Initializing multi with host fotis:3000 portal= portal
mongodb://localhost:27017/toyota-development
I see no data/address file, defaulting to address 0.0.0.0
I see no data/port file, defaulting to port 3000
Mongoose open
Widget => self.load called
Widget ==> req.url= /page/one
Widget => self.load called
Widget ==> req.url= /page/one
Widget => self.load called
Widget ==> req.url= /subpage/page/one
Widget => self.load called
Widget ==> req.url= /apos-editor-2/content-menu
Widget => self.load called
Widget ==> req.url= /apos-editor-2/content-menu
Widget => self.load called
Widget ==> req.url= /apos-editor-2/content-menu
Widget => self.load called
Widget ==> req.url= /subpage/favicon.png
==== End Log =====
FP