Hello all,
I’m in the middle of developing a new page template, and I believe I may end up in a situation where a widget on each page has to be hard coded with a unique ID, unique tag, etc.
(Details: major/minor pages, ~90 pages and their corresponding ~90 profiles with key content to display. I considered using the profiles as the basis for the pages, but we want the URLs that pages provide “/academics/” rather than /“live/profiles/”. Any thoughts on alternative approaches welcome, but I’m not seeing a good alternative.)
Given the number of pages/widgets involved, and give they could “break” outside of the dedicated editor’s control, my thought was to try and develop a failsafe like the following:
- Assume the widget fails to display anything (i.e. the profile to be shown is Hidden).
- The widget displays a message to the user (like normal): “Something went wrong…”
- The widget also triggers something that sends an email:
- To a defined set of people, likely specific to the widget.
- With a message that identifies the specific page and widget: “widget on /x/y/z/ failed.”
- That is only sent for a given page once every x hours, if triggered constantly.
My best guess to achieve this would be a XPHP variable appended to the “no_results” parameter of the widget, triggering a custom module that would achieve the above, assuming the page details are available.
Otherwise, an include JS script with key details passed as URL parameters.
My questions:
- Has anyone done something like this before? If so, would you be willing to share code or directions?
- Else, anyone have input on how best to implement such functionality, or any other observations?
Thanks,
Nick

