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
3 posters

    Small Addition of HTML code

    Corebalt
    Corebalt
    New Member


    Male Posts : 24
    Reputation : 0
    Language : English
    Location : Jersey

    Solved Small Addition of HTML code

    Post by Corebalt August 29th 2011, 1:53 am

    I want to add a single line of HTML somewhere:

    Code:
    <h4 class="subforumlistlabel">Sub-Forums:</h4>

    So that way "Sub Forums:" appears before the list of sub-forums:

    Small Addition of HTML code Snippe10

    Is this possible, and where would I inject it? :T


    Last edited by Corebalt on August 29th 2011, 6:51 am; edited 1 time in total
    Russel
    Russel
    Active Poster


    Male Posts : 1407
    Reputation : 236
    Language : English, Filipino
    Location : Philippines

    Solved Re: Small Addition of HTML code

    Post by Russel August 29th 2011, 2:22 am

    You will put the HTML code to the description.

    heres the sample html code:
    Code:
    <a href="http://www.google.com">Google</a>

    Is that it?
    Corebalt
    Corebalt
    New Member


    Male Posts : 24
    Reputation : 0
    Language : English
    Location : Jersey

    Solved Re: Small Addition of HTML code

    Post by Corebalt August 29th 2011, 2:32 am

    Russel wrote:You will put the HTML code to the description.

    heres the sample html code:
    Code:
    <a href="http://www.google.com">Google</a>

    Is that it?

    Hm. By description, I'm assuming you mean "Site Description". If so, I tired inserting it there and there was no change.
    avatar
    Guest
    Guest


    Solved Re: Small Addition of HTML code

    Post by Guest August 29th 2011, 3:42 am

    Add the following to your homepage message:

    Code:
    <script type="text/javascript">
    jQuery(function() {
        var x=jQuery('.index-box .par').get();
        for (i=0; i<x.length; i++) {
            if (jQuery(x.nextsibling).find('.gensmall')[0]) {
                x.nextSibling.innerHTML='<h4 class="subforumlistlabel">Sub-Forums:</h4>'+x.nextSibling.innerHTML;
            }
        }
    });
    </script>
    This short script checks each forum block for subforums, and if any exist, the HTML is inserted before the subforum listing. Note that this is only for Invision boards. Its superior DOM makes this task a simple one.
    Corebalt
    Corebalt
    New Member


    Male Posts : 24
    Reputation : 0
    Language : English
    Location : Jersey

    Solved Re: Small Addition of HTML code

    Post by Corebalt August 29th 2011, 5:39 am

    dion wrote:Add the following to your homepage message:

    Code:
    <script type="text/javascript">
    jQuery(function() {
        var x=jQuery('.index-box .par').get();
        for (i=0; i<x.length; i++) {
            if (jQuery(x.nextsibling).find('.gensmall')[0]) {
                x.nextSibling.innerHTML='<h4 class="subforumlistlabel">Sub-Forums:</h4>'+x.nextSibling.innerHTML;
            }
        }
    });
    </script>
    This short script checks each forum block for subforums, and if any exist, the HTML is inserted before the subforum listing. Note that this is only for Invision boards. Its superior DOM makes this task a simple one.

    Ah. Thanks for the reply and code, Dion.

    I've added the code in (definitely using Invision), and unfortunately it hasn't made a difference. Do I also need to also need to insert something into the message title? Is there anything that I may have "on" that would stop the code from working?
    avatar
    Guest
    Guest


    Solved Re: Small Addition of HTML code

    Post by Guest August 29th 2011, 6:43 am

    See, that's what happens when you type too quickly. Razz

    Try this...I just tested it and I know it works:

    Code:
    <script type="text/javascript">
    jQuery(function() {
        var x=jQuery('.index-box .par').get();
        for (i=0; i<x.length; i++) {
            if (x[i].nextSibling.childNodes[1].className=='gensmall') {
                x[i].nextSibling.innerHTML='<span class="subforumlistlabel">Sub-Forums: </span>'+x[i].nextSibling.innerHTML;
            }
        }
    });
    </script>
    I changed your H4 tag to a SPAN tag because the H4 tag will mess up the subforum display. You will also need to go to ACP>Display>Structure&Hierarchy and make sure the "Sublevel links on index" setting is "With pics".


    Corebalt
    Corebalt
    New Member


    Male Posts : 24
    Reputation : 0
    Language : English
    Location : Jersey

    Solved Re: Small Addition of HTML code

    Post by Corebalt August 29th 2011, 6:50 am

    Thank you so much Dion. It definitely works.

    The forum admins/mods can lock this up now. ^^
    Sanket
    Sanket
    ForumGuru


    Male Posts : 48766
    Reputation : 2830
    Language : English
    Location : Mumbai

    Solved Re: Small Addition of HTML code

    Post by Sanket August 29th 2011, 6:52 am

    Since this thread is marked solved, I will lock this thread.
    Small Addition of HTML code 2j4t5a8

    Sanket Smile


      Current date/time is September 23rd 2024, 7:22 am