DNN Forums

Ask questions about your website to get help learning DNN and help resolve issues.

Hiding a module from appearing on a mobile device

 7 Replies
 1 Subscribed to this topic
 30 Subscribed to this forum
Sort:
Author
Messages
Growing Member
Posts: 31
Growing Member
Helpful Replier
Helpful Replier
Thanks for being such a helpful replier!
New Poster
New Poster
Congrats on posting!

Trying to hide a module from appearing on a mobile device the Module is dnn sharp  action grid

So in the portal.css file I added the following:

@media only screen and (max-width: 768px) {

  .hide-mobile {

    display: none !important;

  }

}

And then in module advanced setting under header tag I placed the following

  This content will only be visible on tablets and desktops.

This does not hide the hide the module on a mobile device – what am I missing?

Thanks

Bob

Growing Member
Posts: 31
Growing Member
Helpful Replier
Helpful Replier
Thanks for being such a helpful replier!
New Poster
New Poster
Congrats on posting!

oops

in the module under header tag i placed



  This content will only be visible on tablets and desktops.

Growing Member
Posts: 31
Growing Member
Helpful Replier
Helpful Replier
Thanks for being such a helpful replier!
New Poster
New Poster
Congrats on posting!

why is css not showing up

meta name="viewport" content="width=device-width, initial-scale=1">
div class="hide-mobile">
  This content will only be visible on tablets and desktops.
div>

Advanced Member
Posts: 233
Advanced Member
4 Helpful Replier
Helpful Replier
Thanks for being such a helpful replier!
New Poster
New Poster
Congrats on posting!
4 Engaged Reader
Engaged Reader
You are an engaged reader!

 

 @Bob M, html, xml, and css needs to be surrounded by "code" tags to be properly displayed. Here is some documentation on that:

https://github.com/DNNCom...-To-Enter-XML-&-HTML
 

Advanced Member
Posts: 233
Advanced Member
4 Helpful Replier
Helpful Replier
Thanks for being such a helpful replier!
New Poster
New Poster
Congrats on posting!
4 Engaged Reader
Engaged Reader
You are an engaged reader!

Just a guess here but I think there is a new security setting in DNN 9.13.10 (and somewhere in the DNN 10 version lineage, 10.2?) to enable html in the module header. 

Growing Member
Posts: 31
Growing Member
Helpful Replier
Helpful Replier
Thanks for being such a helpful replier!
New Poster
New Poster
Congrats on posting!

Trying to hide a module from appearing on a mobile device the Module is dnn action grid

So in the portal.css file I added the following:

@media only screen and (max-width: 768px) {

  .hide-mobile {

    display: none !important;

  }

}

then in module advanced setting under header tag I placed the following

<code><meta name="viewport" content="width=device-width, initial-scale=1"></code>

<code><<div class="hide-on-mobile"></code>

  This content will only be visible on tablets and desktops.

<code></div></code>

 

This does not hide the hide the module on a mobile device – what am I missing?

Thanks

 

Veteran Member
Posts: 838
Veteran Member
3 Helpful Replier
Helpful Replier
Thanks for being such a helpful replier!
New Poster
New Poster
Congrats on posting!

Well, in the code I see a div opening with << so that could create an issue.

Another thing is that the class name in the HTML is not the same as the css class.

I never tried to add the HTML in the header tag btw. I either add the class in the HTML of the module or use the ID of the module to set the display none

Growing Member
Posts: 31
Growing Member
Helpful Replier
Helpful Replier
Thanks for being such a helpful replier!
New Poster
New Poster
Congrats on posting!

Tycho  thanks for that information

These Forums are for the discussion of the open source CMS DNN platform and ecosystem.

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

  1. If you have (suspected) security issues, please DO NOT post them in the forums but instead follow the official DNN security policy
  2. No Advertising. This includes the promotion of commercial and non-commercial products or services which are not directly related to DNN.
  3. 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.
  4. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  5. No Flaming or Trolling.
  6. No Profanity, Racism, or Prejudice.
  7. Site Moderators have the final word on approving / removing a thread or post or comment.
  8. English language posting only, please.

Would you like to help us?

Awesome! Simply post in the forums using the link below and we'll get you started.

Get Involved