The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Small Addition of HTML code

View previous topic View next topic Go down

Solved Small Addition of HTML code

Post by Corebalt on 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:



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

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 on 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?

Russel
Active Poster

Male Posts : 1400
Reputation : 235
Language : English, Filipino
Location : Philippines

http://help.forumotion.com/forum

Back to top Go down

Solved Re: Small Addition of HTML code

Post by Corebalt on 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.

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

Guest
Guest


Back to top Go down

Solved Re: Small Addition of HTML code

Post by Corebalt on 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?

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



Guest
Guest


Back to top Go down

Solved Re: Small Addition of HTML code

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

Thank you so much Dion. It definitely works.

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

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 on August 29th 2011, 6:52 am

Since this thread is marked solved, I will lock this thread.


Sanket Smile


Sanket
ForumGuru

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

http://webartzforum.com

Back to top Go down

View previous topic View next topic Back to top


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