XModPro

Can a ScriptBlock be conditionally shown or hidden in a template?

Mike9355 Mike9355 posted Feb 18, 2026
Active Feb 22 · Viewed 101 times

I have a data column for GoogleTagID, which contains the Google Analytics ID. If the data column is empty, then I want to hide the Google header script block in an ItemTemplate, but if there is a value for GoogleTagID, then I want to show the Scriptblock. I have included the code in the fiddle that I am using. Is it not possible to conditionally hide a Scriptblock? Also I can't seem to conditional hide it using, Select Case/Else either.

Thanks!

http://dnndev.com/fiddle/fid/898

3 Replies

Loading replies...