Forum Discussion

wrighte's avatar
wrighte
Expert
14 years ago

Limiting display of annoucement to home page

Is there a way to limit diplay of an annoucement to only the homepage (or more specifically to the "Top" Category only - we use that as our homepage).

 

I guess we could create a separate custom content module for this?

  • Hi Eric,

     

    Here are the ways that I know of to accomplish this:

     

    1. Define separate announcements for the various levels of the community such that the announcement at the community level does not cascade down to lower levels.
    2. Remove the Announcements module via Studio from the pages that you don't want it to display on.
    3. Utilize a custom content module rather than the Announcements module and only place it on the pages where you wish to display the announcement.

    There may be some other work-arounds, but these are the most commonly-used.

     

    Take care,

  • BrianO's avatar
    BrianO
    Lithium Alumni (Retired)

    Hi Eric,

     

    Here are the ways that I know of to accomplish this:

     

    1. Define separate announcements for the various levels of the community such that the announcement at the community level does not cascade down to lower levels.
    2. Remove the Announcements module via Studio from the pages that you don't want it to display on.
    3. Utilize a custom content module rather than the Announcements module and only place it on the pages where you wish to display the announcement.

    There may be some other work-arounds, but these are the most commonly-used.

     

    Take care,

    • xorrkaz's avatar
      xorrkaz
      Genius

      Here's the CSS content we used inside the announcement widget to prevent child announcement widgets from showing up when we didn't want top-level content to cascade down.

       

      <style>
      .lia-component-common-widget-announcement {
          display: none;
      }
      </style>

       

      Stick that in any category announcement section where you want the widget to be completely hidden.

      • KaelaC's avatar
        KaelaC
        Lithium Alumni (Retired)

        You could also get fancy with your CSS and do this

        <style>
        #lia-body .lia-component-common-widget-announcement {
            display: none;
        }
        #lia-body.CategoryPage .lia-component-common-widget-announcement {
            display: block;
        }
        </style>

         That will only show annoncements on your Category pages.  Of course if you have sub-categories it will show up there as well.  If you want to know how to only make it show on some category pages, we would need trickier code.

      • Wendy_S's avatar
        Wendy_S
        Boss

        Hey Eric.

        We have custom content for this as well and rotate announcements using graphics.

        Not sure how familiar you are with HTML though but let me know if I can help