CSS to avoid posting/searching in unwanted categories



  • Every time I’m creating a new thread here, I first select the category in the Russian forum instead of the international one. That’s why I decided to hide almost all items of Local forum category in the new thread category selection dropdown.

    This hides all the local forums. You need an extension that allows you to inject CSS (I use Vivaldi Forum Mod).

    /* Local forum */
    .composer-container .category-list-container li[data-cid="38"],
    /* Russian */
    .composer-container .category-list-container li[data-cid="20"],
    .composer-container .category-list-container li[data-cid="172"],
    .composer-container .category-list-container li[data-cid="123"],
    .composer-container .category-list-container li[data-cid="124"],
    .composer-container .category-list-container li[data-cid="176"],
    .composer-container .category-list-container li[data-cid="177"],
    .composer-container .category-list-container li[data-cid="178"],
    .composer-container .category-list-container li[data-cid="179"],
    .composer-container .category-list-container li[data-cid="173"],
    .composer-container .category-list-container li[data-cid="149"],
    .composer-container .category-list-container li[data-cid="174"],
    .composer-container .category-list-container li[data-cid="175"],
    .composer-container .category-list-container li[data-cid="162"],
    .composer-container .category-list-container li[data-cid="166"],
    .composer-container .category-list-container li[data-cid="165"],
    .composer-container .category-list-container li[data-cid="167"],
    /* Japanese */
    .composer-container .category-list-container li[data-cid="26"],
    .composer-container .category-list-container li[data-cid="78"],
    .composer-container .category-list-container li[data-cid="143"],
    .composer-container .category-list-container li[data-cid="77"],
    .composer-container .category-list-container li[data-cid="76"],
    /* German */
    .composer-container .category-list-container li[data-cid="24"],
    .composer-container .category-list-container li[data-cid="98"],
    .composer-container .category-list-container li[data-cid="99"],
    .composer-container .category-list-container li[data-cid="100"],
    .composer-container .category-list-container li[data-cid="137"],
    .composer-container .category-list-container li[data-cid="138"],
    /* Spanish */
    .composer-container .category-list-container li[data-cid="22"],
    .composer-container .category-list-container li[data-cid="46"],
    .composer-container .category-list-container li[data-cid="106"],
    .composer-container .category-list-container li[data-cid="107"],
    .composer-container .category-list-container li[data-cid="108"],
    .composer-container .category-list-container li[data-cid="181"],
    /* French */
    .composer-container .category-list-container li[data-cid="21"],
    .composer-container .category-list-container li[data-cid="47"],
    .composer-container .category-list-container li[data-cid="44"],
    .composer-container .category-list-container li[data-cid="156"],
    .composer-container .category-list-container li[data-cid="157"],
    .composer-container .category-list-container li[data-cid="109"],
    .composer-container .category-list-container li[data-cid="110"],
    .composer-container .category-list-container li[data-cid="111"],
    /* Chinese */
    .composer-container .category-list-container li[data-cid="23"],
    /* Czech */
    .composer-container .category-list-container li[data-cid="70"],
    /* Greek */
    .composer-container .category-list-container li[data-cid="168"],
    .composer-container .category-list-container li[data-cid="169"],
    .composer-container .category-list-container li[data-cid="170"],
    /* Italian */
    .composer-container .category-list-container li[data-cid="25"],
    .composer-container .category-list-container li[data-cid="141"],
    .composer-container .category-list-container li[data-cid="142"],
    /* Polish */
    .composer-container .category-list-container li[data-cid="27"],
    .composer-container .category-list-container li[data-cid="148"],
    .composer-container .category-list-container li[data-cid="101"],
    .composer-container .category-list-container li[data-cid="102"],
    .composer-container .category-list-container li[data-cid="103"],
    /* Portugese */
    .composer-container .category-list-container li[data-cid="28"],
    .composer-container .category-list-container li[data-cid="42"],
    .composer-container .category-list-container li[data-cid="50"],
    .composer-container .category-list-container li[data-cid="97"],
    .composer-container .category-list-container li[data-cid="135"],
    /* Slovak */
    .composer-container .category-list-container li[data-cid="90"],
    .composer-container .category-list-container li[data-cid="117"],
    .composer-container .category-list-container li[data-cid="152"],
    .composer-container .category-list-container li[data-cid="153"],
    .composer-container .category-list-container li[data-cid="118"],
    .composer-container .category-list-container li[data-cid="119"],
    .composer-container .category-list-container li[data-cid="120"],
    .composer-container .category-list-container li[data-cid="121"],
    /* Turkish */
    .composer-container .category-list-container li[data-cid="29"],
    /* Persian */
    .composer-container .category-list-container li[data-cid="39"],
    /* Ukrainian */
    .composer-container .category-list-container li[data-cid="40"] {
        display: none;
    }
    

    Edit: as @luetage suggested, this hides all the local forum categories in advanced search (order doesn’t seem to work unfortunately)

    /* Local forum */
    #advanced-search #posted-in-categories option[value="38"],
    /* Russian */
    #advanced-search #posted-in-categories option[value="20"],
    #advanced-search #posted-in-categories option[value="172"],
    #advanced-search #posted-in-categories option[value="123"],
    #advanced-search #posted-in-categories option[value="124"],
    #advanced-search #posted-in-categories option[value="176"],
    #advanced-search #posted-in-categories option[value="177"],
    #advanced-search #posted-in-categories option[value="178"],
    #advanced-search #posted-in-categories option[value="179"],
    #advanced-search #posted-in-categories option[value="173"],
    #advanced-search #posted-in-categories option[value="149"],
    #advanced-search #posted-in-categories option[value="174"],
    #advanced-search #posted-in-categories option[value="175"],
    #advanced-search #posted-in-categories option[value="162"],
    #advanced-search #posted-in-categories option[value="166"],
    #advanced-search #posted-in-categories option[value="165"],
    #advanced-search #posted-in-categories option[value="167"],
    /* Japanese */
    #advanced-search #posted-in-categories option[value="26"],
    #advanced-search #posted-in-categories option[value="78"],
    #advanced-search #posted-in-categories option[value="143"],
    #advanced-search #posted-in-categories option[value="77"],
    #advanced-search #posted-in-categories option[value="76"],
    /* German */
    #advanced-search #posted-in-categories option[value="24"],
    #advanced-search #posted-in-categories option[value="98"],
    #advanced-search #posted-in-categories option[value="99"],
    #advanced-search #posted-in-categories option[value="100"],
    #advanced-search #posted-in-categories option[value="137"],
    #advanced-search #posted-in-categories option[value="138"],
    /* Spanish */
    #advanced-search #posted-in-categories option[value="22"],
    #advanced-search #posted-in-categories option[value="46"],
    #advanced-search #posted-in-categories option[value="106"],
    #advanced-search #posted-in-categories option[value="107"],
    #advanced-search #posted-in-categories option[value="108"],
    #advanced-search #posted-in-categories option[value="181"],
    /* French */
    #advanced-search #posted-in-categories option[value="21"],
    #advanced-search #posted-in-categories option[value="47"],
    #advanced-search #posted-in-categories option[value="44"],
    #advanced-search #posted-in-categories option[value="156"],
    #advanced-search #posted-in-categories option[value="157"],
    #advanced-search #posted-in-categories option[value="109"],
    #advanced-search #posted-in-categories option[value="110"],
    #advanced-search #posted-in-categories option[value="111"],
    /* Chinese */
    #advanced-search #posted-in-categories option[value="23"],
    /* Czech */
    #advanced-search #posted-in-categories option[value="70"],
    /* Greek */
    #advanced-search #posted-in-categories option[value="168"],
    #advanced-search #posted-in-categories option[value="169"],
    #advanced-search #posted-in-categories option[value="170"],
    /* Italian */
    #advanced-search #posted-in-categories option[value="25"],
    #advanced-search #posted-in-categories option[value="141"],
    #advanced-search #posted-in-categories option[value="142"],
    /* Polish */
    #advanced-search #posted-in-categories option[value="27"],
    #advanced-search #posted-in-categories option[value="148"],
    #advanced-search #posted-in-categories option[value="101"],
    #advanced-search #posted-in-categories option[value="102"],
    #advanced-search #posted-in-categories option[value="103"],
    /* Portugese */
    #advanced-search #posted-in-categories option[value="28"],
    #advanced-search #posted-in-categories option[value="42"],
    #advanced-search #posted-in-categories option[value="50"],
    #advanced-search #posted-in-categories option[value="97"],
    #advanced-search #posted-in-categories option[value="135"],
    /* Slovak */
    #advanced-search #posted-in-categories option[value="90"],
    #advanced-search #posted-in-categories option[value="117"],
    #advanced-search #posted-in-categories option[value="152"],
    #advanced-search #posted-in-categories option[value="153"],
    #advanced-search #posted-in-categories option[value="118"],
    #advanced-search #posted-in-categories option[value="119"],
    #advanced-search #posted-in-categories option[value="120"],
    #advanced-search #posted-in-categories option[value="121"],
    /* Turkish */
    #advanced-search #posted-in-categories option[value="29"],
    /* Persian */
    #advanced-search #posted-in-categories option[value="39"],
    /* Ukrainian */
    #advanced-search #posted-in-categories option[value="40"] {
       display: none;
    }
    

  • Moderator

    @potmeklecbohdan Nice, 👍

    But – that may only work as long as the data-cids do not change.



  • @Gwen-Dragon They shouldn’t—e.g. modifications has been 52 as far as my memory goes. Can you imagine what would happen if the only reliable way to identify a category was changed?


  • Moderator

    @potmeklecbohdan said in CSS to avoid posting in unwanted categories:

    They shouldn’t—e.g. modifications has been 52 as far as my memory goes

    Then your userCSS is very useful!

    Excuse me, you have more knowledge on such patches. 😊



  • @potmeklecbohdan Yeah, the local forums are extremely annoying, especially because they are listed first and foremost, both when posting a topic and when issuing an advanced search.



  • @luetage Good idea! Will add in a moment.


Log in to reply
 

Looks like your connection to Vivaldi Forum was lost, please wait while we try to reconnect.