Forum Discussion

Inactive User's avatar
Inactive User
12 years ago

A few display questions...

I have a couple questions relating to display...

 

  1. If a user is not logged in or does not have permission to post on an article/topic, is there a way to hide the elements such as Reply/Like/Report Inappropriate Content from view? I set the Reply buttons to 'display:none' when they are disabled but I'm not sure what to do about the others.
  2. Is there a way to show the helper text (.lia-form-validation-help-text) underneath input boxes always, rather than just onFocus? Or is there a good reason we should leave it as-is?
  3. Is there a way to hide the time portion of the date/time text on articles/posts?

Thanks!

  • Inactive User's avatar
    Inactive User
    Found #2. Just hidden among all the options :)
  • AdamN's avatar
    AdamN
    Khoros Oracle

    Hi jlutterloh,

     

    For #1, there are probably a couple ways you could approach this. One idea would be to use FreeMarker to detect whether or not the user is registered. If they're not registered, you could add some CSS to hide those particular elements (display:none like you did for the reply button).

     

    Another idea would be to create some custom components to replace those elements you want to conditinally hide. Inside your custom component, you would check to see if the current user is registered. If they are, then you can use FreeMarker to include the standard component that you replaced. So you're essentially creating a wrapper for the standard component.

     

    One thing to keep in mind, though, is that displaying these elements to users that are not logged in can actually be a good thing. It serves as a reminder to those that are registered, and encourages those that aren't registered to do so.

     

    For #3, the time has its own CSS class separate from the date. So if you wanted to hide it, you could certainly do so using CSS. The class is named "local-time". You can add additional selectors depending on how specific you want to be with your CSS rule.

     

    Let me know if you need any more information about any of these options. I hope this helps!

     

    -Adam