Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Using Modules a...Using Modules a...Show/Hide conent based on QueryStringShow/Hide conent based on QueryString
Previous
 
Next
New Post
3/22/2013 9:52 PM
 

Does anyone know how I can show/hide content  based on a passed-in querystring value?

I'm passing a QueryString value into a page (ClassID).  Based on the value of ClassID, I'd like to show/hide a series of images.  Can someone tell me how to show/hide images within a HTML/Text module OR I could create 4 seperate modules, one with each image button then show/hide entire modules.

Any help would be much appreciated!

Thanks!

 
New Post
3/23/2013 8:02 AM
 

I don't think there is anything built-in to DNN that can do this.  You could do some jQuery to show and hide.  Maybe something like:

 

<script type="text/javascript">

var url = document.location.href;

if (url.indexOf('class=1') >= 0) {
  $('#class1_div').show();
} else {
  $('#class1_div').hide();
}

</script>

 

Thanks,

Mike

 

 

 

 

 
New Post
3/23/2013 10:07 AM
 
Hi Mike,

Thanks so much for the reply.

I'm not having any luck putting this together. This is my first time working with JS and JQUERY in the DNN environment. I put the attached JS code you sent me into the Page's Header section and created a div tag with an ID of "class1_div"  inside my module.  inside that div tag I put a button that, in theory, should be shown or hidden based on the passed in query string value.

Is there anything that I'm missing?
 
New Post
3/23/2013 10:10 AM
 
Create your own module and code it in asp.net to show/hide the content using asp:panels. Just like you'd do in a regular .net web page.

Mark
 
New Post
3/23/2013 10:16 AM
 

Mark,

Thanks for your note.  I'm trying to keep this simple and not get into developing modules.  I just thought there was a simple way through HTML to read the query string value being passed in and show/hide content on my page.  I can't seem to find any examples of doing it.

 

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Using Modules a...Using Modules a...Show/Hide conent based on QueryStringShow/Hide conent based on QueryString


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out