Question

When implementing a gadget, is there a setting that would tell blogger to display the gadget in a post (or on a homepage) only?

I know that one can add conditional tags to the template html but that's NOT what I'm after. I need to figure out a way how to do this via the gadget's code so that the end user doesn't need to interfere with any code to achieve the effect.

Was it helpful?

Solution

I've figured that this isn't possible.

A workaround I've come up with is to set the gadget's default height to 0, then use javascript to find out whether we're on a homepage or an individual post and then, depending on the requirement, resize the gadget to the desired height. In such case, it is necessary to include the <Require feature="dynamic-height"/> in the ModulePref section of the xml file and use the gadgets.window.adjustHeight() function.

The caveat with this workaround is that the gadget, event when its height is set to 0, will take at least 10px in height.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top