Portal Engine Questions on portal engine and web parts.
Version 7.x > Portal Engine > Hide/Show Webparts on querystring View modes: 
User avatar
Certified Developer 12
Certified Developer 12
chetan2309-gmail - 8/13/2013 10:21:14 AM
   
Hide/Show Webparts on querystring
Hi,

I want to hide/show two webparts:-

1. If I pass parameter "cat" and its value "All" or that parameter is not passed then "Webpart A" will be displayed otherwise "Webpart B"

2. Secondly, if possible I can stop rendering of these webparts. As these are custom query repeaters they will unnecessary will make sql call.

Thanks,
Chetan

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 8/13/2013 10:52:16 AM
   
RE:Hide/Show Webparts on querystring
#1 Try this
{% if( Request.QueryString["cat"] == "All") {true}else{false} %}
#2 When the visibility is set to false, processing is stopped. You can test this (and the macro) by turning on Debugging within the CMSSiteManager>Settings>System>Debug.

User avatar
Certified Developer 12
Certified Developer 12
chetan2309-gmail - 8/13/2013 12:52:40 PM
   
RE:Hide/Show Webparts on querystring
This {% if( Request.QueryString["cat"] == "All") {true}else{false} %}

is returning false no matter. I have checked macros debug logs. Everytime this statement is returning false.

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 8/13/2013 1:18:57 PM
   
RE:Hide/Show Webparts on querystring
My apoligies, it should be
QueryString.GetValue("cat")

User avatar
Certified Developer 12
Certified Developer 12
chetan2309-gmail - 8/13/2013 1:30:31 PM
   
RE:Hide/Show Webparts on querystring
Thanks FroggEye. That worked!!

What's better than you helping us? No apologies required!!

Thank You
Chetan