• Threads
  • Categories
  • Users
  • Documentation
  • GitHub
  • Discord
  • forum
  • group
  • search
  1. Threads
  2. Changing Look and Feel
chevron_left Changing Look and Feel

Adding custom Html to category

  • forum 2 replies
  • last reply by GangzeHD Sept. 27, 2017
  • Last
  • link
    GangzeHD
    Members 16 posts
    Sept. 26, 2017, 10:06 a.m. Sept. 26, 2017, 10:06 a.m.
    link

    Hi!

    I was playing around with the idea of having a discord server widget or a Iframe in a category with a css class of

    Test
    

    And the way i did this is kind off messy. I did it by writing a simple script in javascript checking for the class page-Test and loading the javascript in the base like so

    if (document.hetElementsByClassName("page-Test")[0]) {
        document.body.innerHTML += '<p>Test</p>';
    };
    

    And just loading it in like so

    <script stc="{% static 'misago/js/custom.js' %}"></script>
    

    But this is really inconvenient and messy and not really what i'm looking for so any thoughts?

  • link
    rafalp
    Project Lead 1476 posts
    Sept. 27, 2017, 9:44 a.m. Sept. 27, 2017, 9:44 a.m.
    link

    Hey,

    This seems to be best way to go about what you are after.

  • link
    GangzeHD
    Members 16 posts
    Sept. 27, 2017, 2:11 p.m. Sept. 27, 2017, 2:11 p.m.
    link

    Any tips on that the test div still shows up when using the back arrow and when it doesn't reload the page?
    for example jumping from test category back to homepage it still shows up?

    trevor likes this.

    favorite 1

There are no more posts in this thread.

  • This site uses cookies to gather statistical data for use in traffic analysis.
  • Documentation
  • GitHub
  • Discord
  • Terms of service
  • Privacy policy
powered by misago