Hide/show Humble Squid's Category Boxes along with "My Activities", "Submit a Request"
In our support organization, we have tiered levels of support, where paying customers can submit requests, but our free users can use our community and knowledge base.
There's already a couple good articles already out there on how to hide "My Actvities" and "Submit a Request", such as this one
We used the Humble Squid theme, which contains a number of boxes or tiles. In one of those tiles or boxes, we show an image, with a link to submit a support request. However, we also want to hide this tile or box from anonymous and free users.
This is what our support portal looks like, when a user first arrives there:
As you can see, there is no "My Activities" or "Submit a Request" on the upper right corner. In the cream box in the center, there are three tiles displayed: Knowledge Base, Known Issues and Community.
However, for customers that are able to submit support requests, we obviously want to show "My Activities" or "Submit a Request", as well as show a tile with an icon for submitting a support request, as shown below:
so what I did here is to hide the content if a user is anonymous,
or is not logged in. I did this by hiding or removing the HTML elements with JQuery and Javascript.
The four tiles above, have the following CSS style:
So in order to hide the "My Activities" or "Submit a Request" as well as the li element with the submit a request image link, I added the following Javascript, to accomplish a number of things:
- Made sure the user's org or role was not anonymous, and if it was, I set their role & org value to "none"
- Passed the values to a Javascript function to hide the content.
- Hid or removed the HTML elements from the page
- Finally, set a wider width of the tiles as we went from 4 to 3 tiles or boxes.
This works pretty well, and allows for great flexibility.
-
Another great post! You're on fire! :)
-
Woo hoo! Thanks, Riley!
-
Thanx ladies :)
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
3 Kommentare