The forum of the forums

Would you like to react to this message? Create an account in a few clicks or log in to continue.
The forum of the forums

    [CSS] Adding style for Announcement and Sticky

    SarkZKalie
    SarkZKalie
    Support Moderator
    Support Moderator


    Male Posts : 1442
    Reputation : 220
    Language : English

    [CSS] Adding style for Announcement and Sticky Empty [CSS] Adding style for Announcement and Sticky

    Post by SarkZKalie May 3rd 2018, 12:23 am

    Hello guys

    1) By default, the whole content inside {topics_list_box.row.TOPIC_TYPE} variable will end by a colon ( : ) So, i write this tutorial to help you remove it without installing any javascript and one more thing it will work all version.

    First of all, define your special text for announcement and sticky by browse to your Admin Control Panel -> General -> Mesages and emails -> Config. -> Define another name

    In my case, I'll use content1 and content2.
    Code:
    Announcement : content1
    Sticky : content2
    Next step, search and locate {topics_list_box.row.TOPIC_TYPE} variable in topics_list_box template.
    Replace it by
    Code:
    <span id="{topics_list_box.row.TOPIC_TYPE}"></span>
    Optional:
    Last step, add this to your CSS
    Code:
    span[id*="content1"]:before, span[id*="content2"]:before {
     Â    padding: 4px 4px;
     Â    margin: 0 5px;
     Â    border: 1px solid #999;
     Â    border-radius: 2px;
    }
     span[id*="content1"]:before {
     Â    content: "new-content1";
     Â    background: darkcyan;
     Â    color: white;
    }
     span[id*="content2"]:before {
     Â    content: "new-content2";
     Â    background: red;
     Â    color: white;
    }
    Result LIVE DEMO
    [CSS] Adding style for Announcement and Sticky Untitl12

    Note : You must have a sticky or announcement post at least, unless this tip won't work as expected

      Current date/time is September 23rd 2024, 4:42 pm