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.

Small Addition of HTML code

3 posters

Go down

Solved Small Addition of HTML code

Post by Corebalt Sun Aug 28, 2011 6:53 pm

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 Sun Aug 28, 2011 11:51 pm; edited 1 time in total
Corebalt
Corebalt
New Member

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

http://sammich.forumotion.net

Back to top Go down

Solved Re: Small Addition of HTML code

Post by Russel Sun Aug 28, 2011 7:22 pm

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?
Russel
Russel
Active Poster

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

Back to top Go down

Solved Re: Small Addition of HTML code

Post by Corebalt Sun Aug 28, 2011 7:32 pm

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.
Corebalt
Corebalt
New Member

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

http://sammich.forumotion.net

Back to top Go down

Solved Re: Small Addition of HTML code

Post by Guest Sun Aug 28, 2011 8:42 pm

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.
avatar
Guest
Guest


Back to top Go down

Solved Re: Small Addition of HTML code

Post by Corebalt Sun Aug 28, 2011 10:39 pm

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?
Corebalt
Corebalt
New Member

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

http://sammich.forumotion.net

Back to top Go down

Solved Re: Small Addition of HTML code

Post by Guest Sun Aug 28, 2011 11:43 pm

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".


avatar
Guest
Guest


Back to top Go down

Solved Re: Small Addition of HTML code

Post by Corebalt Sun Aug 28, 2011 11:50 pm

Thank you so much Dion. It definitely works.

The forum admins/mods can lock this up now. ^^
Corebalt
Corebalt
New Member

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

http://sammich.forumotion.net

Back to top Go down

Solved Re: Small Addition of HTML code

Post by Sanket Sun Aug 28, 2011 11:52 pm

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

Sanket Smile

Sanket
Sanket
ForumGuru

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

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum