[SOLVED] Table of Contents Using heading tags?

Post

Posted
Rating:
#3845 (In Topic #767)
Greetings,

For some reason I remember Chris saying that the comcode contents (Table of Contents) block can work using the html heading tags, ie


Code

Stuff




Instead of relying on the comcode Title tags…


Code

[title=2]Stuff[/title]


I've yet to see this work. Did I perhaps remember this incorrectly? Likely I did. Is there a way to make the Table of Contents use html headings?

Last edit: by mythus


Post

Posted
Rating:
#3855
Hi,

It should work.

Actually I just tested and couldn't get it not to work. I tried with plain Comcode, and WYSIWYG HTML, both with and without Comcode conversion enabled (btw, don't enable Comcode conversion to test unless you really want it).

Here's an example of HTML that worked:

Code

[contents][/contents]

<h2>Foo</h2>

<h3>Bar</h3>

<h2>Test</h2>

I'm not denying the issue, but I'll need a failing test case like this to debug.

Post

Posted
Rating:
#3857
Man, I wish it worked like that for me… Would make fixing/rebuilding my site after my old server went up in flames so much easier…

Here's screenshots showing you the issues I'm having…

Screenshot_20180208_164320.png

Screenshot_20180208_164350.png

Screenshot_20180208_164441.png

 

Post

Posted
Rating:
#3859
Please post the HTML code (e.g. from the WYSIWYG source view) inside a code tag, I need to be able to copy and paste it to reproduce.

Post

Posted
Rating:
#3860
Here you go.

Code

<input class="cms_keep_ui_controlled" readonly="readonly" size="45" style="cursor: pointer;" title="[contents][/contents]" type="button" value="contents Comcode tag (dbl-click to edit/delete)" /><br />
<br />
Profession is what your character does for a living. Your character&#39;s profession is initially decided upon during the <a class="user_link" href="http://www.legendsofnorova.net/ocportal/index.php?page=wiki&amp;type=browse&amp;id=12&amp;keep_wiki_root=20">Character Origins</a> part of Character Creation and shows the job that your character is currently doing when you have started actually playing your character. If you have chosen not to make use of Character Origins then you do not need to worry about using Professions, unless of course you wish to do so. If you have used Character Origins to help create your character, then you need to read this page to better understand how your character&#39;s profession affects your character&#39;s growth and development.<br />
<br />
<a class="user_link" href="#top" rel="nofollow nofollow" target="_top">Back to top</a>

<h2 id="what-all-does-profession-affect">What all does Profession affect?</h2>
You already know from character origins that your character&#39;s profession gives your character a weekly salary. It might have also given your character some other bonuses. That&#39;s not all that your character&#39;s profession affects though. Your character&#39;s profession also affects the following:<br />
&nbsp;
<ul>
   <li>The rate and which your character learns and masters skills: skills that fall into your character&#39;s profession will be easier for your character to learn and master while others may be more difficult</li>
   <li>The effectiveness of the skills your character uses: skills that fall in your character&#39;s profession might be more effective while others might be less effective</li>
   <li>How effective your character is with certain weapons: your profession might make your character better with daggers than other characters not sharing your profession, for example</li>
   <li>How effective your character is with certain armor: perhaps that heavy armor doesn&#39;t slow your character down as much because of your character&#39;s profession</li>
</ul>
Since your character&#39;s profession is chosen during creation, it is treated as a life profession. This means that you cannot change your character&#39;s profession later &#111;n, so you should carefully consider the benefits and negatives of your character&#39;s profession. Luckily your character&#39;s profession doesn&#39;t prevent you from using other skills or equipment. Instead, it may make them more difficult to use or master.<br />
<br />
<a class="user_link" href="#top" rel="nofollow nofollow" target="_top">Back to top</a>

Post

Posted
Rating:
#3861
I have discovered the culprit...

The id="namehere" inside of the h2 tag is confusing the contents comcode. Removing that bit makes it work.

So either I have to apply the title=2 comcode tags to my headers, go through the larger work of removing the header id's, or hope that the great and all-powerful Chris has a better solution lol. Sigh...

Post

Posted
Rating:
#3862
I should be able to fix pretty easily assuming it reproduces, will tell you soon.

Post

Posted
Rating:
Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 (Liked by mythus)
#3863
Fixed in https://github.com/ocproducts/composr/commit/37715143016fc4fc7d6c8780b07a0a6e3d32c69c

It is probably safe to copy the latest of these 2 files to fix it…
sources/comcode_from_html.php
sources/comcode_renderer.php

But take backups of the replaced files first.

Post

Posted
Rating:
#3864
Also note this will erase any IDs etc on those tags, as it has to forcibly convert any headers to Comcode, which doesn't support those properties.

Post

Posted
Rating:
#3865
Hey it works now! Awesome! Thanks Chris, as always, you rock.

4 guests and 0 members have recently viewed this.