I use newsshowpro quite a bit, and love its flexibility. I also use extensively a custom photo presentation slideshow module. I will frequently embed the custom module in a K2 article by using the excellent modules anywhere plugin. Works great, and my customers love it.
The problem I am having is simply this - If the embedded slideshow appears in the first part of the article it is picked up as introductory text on newshowprow and an instance of the slideshow plays in the news show display.
I can use css selectors to set the display to none for the slideshow module only when it is inside of newshowpro, but the slideshow is still loading and running (and consuming bandwidth, loading time, etc) even though it is not displayed. If I have a newshowpro display which has 10 pages with arts, and each page has embedded slideshows, then I can have dozens of slideshows running invisibly and slowing things down.
Lately, i have been putting the slideshow in a different position, rather than embedding, so that Newshowpro doesn't pick it up. That works, but is kind of cumbersome - and adds a layer of difficulty that my customers struggle with.
What I really need to do is go back to embedding, but prevent the embedded module from being executed in Newshowpro. I have self imposed limits of not hacking the core, or another module. I have learned my lesson on the nightmare of maintenance once you start hacking.
So what I think I need is a way to detect if the slideshow module, which is embedded in a K2 article, is running inside of Newshowpro, or not. If I can detect it, I can easily write conditional code in my module to either execute or not execute the slideshow code. But I have not found a way to detect it.
I have looked at the getelementsbyid javascript function, but newshowpro has a dynamic id to allow for multiple instances on the same page. So i cant test for the ID as the id is not known until run time.
Any ideas? What code/function/test can I run to detect if a piece of code is running in a module, which is embedded in a K2 article, which is in turn displayed in newshowpro?