Forums / Cotonti / Extensions / Support / Autotab - create tabs on my pages where I want them

Reworking the autotoc extension

foxhound
#37637 2013-06-25 21:39

Yes, but that is only to create the tabs.
After that people still need to add the markup for the table contents as well. Not to mention the fact with the WYSIWYG editors they do need to change it to code to be able to see the html and add all the info which they want to show in any particular tab.
Maybe it can be made in the editor as a plugin or something but again........for me implementing that would be as difficult as making this plugin and so it probably wont be done ;)

Added 44 minutes later:

Actually, I got a little further :)

I added the following code after the closing "}" of the chapter foreeach:

$text = str_replace("</h3>", "</h3></div></div>", $text);

What this does is checking the page_text for any h3 and if it finds it it replaces it with the proper H3 with closing divs.
And this actually works. It is now properly closing all divs.................BUT.........it is not showing the text on the page for some weird reason.
The HTML source shows all the text is there but in page it does not show. When you first open the page it shows the text + title from Tab 1 but if you than click on another tab the page stays empty. In fact if you than press Tab 1 it also does not display the Tab 1 text.

And, like I said that is weird cause in the HTML source all the text is there. Look at this:

				<div>
					<div class="tabs-1"><ul class="tabs-nav clearfix"><li><a href="/new_armaholic/index.php?e=page&c=page&al=test-12#tab1" title="tab1">tab1</a></li><li><a href="/new_armaholic/index.php?e=page&c=page&al=test-12#tab2" title="tab2">tab2</a></li><li><a href="/new_armaholic/index.php?e=page&c=page&al=test-12#tab3" title="tab3">tab3</a></li><li><a href="/new_armaholic/index.php?e=page&c=page&al=test-12#tab4" title="tab4">tab4</a></li></ul><div class="tabs-container">
					<div class="tab-content" id="tab1"><div class="gamelist"><h2>1. tab1</h2>

<h3>text tab 1</h3></div></div>

<div class="tab-content" id="tab2"><div class="gamelist"><h2>2. tab2</h2>

<h3>text tab 2</h3></div></div>

<div class="tab-content" id="tab3"><div class="gamelist"><h2>3. tab3</h2>

<h3>text tab 3</h3></div></div>

<div class="tab-content" id="tab4"><div class="gamelist"><h2>4. tab4</h2>

<h3>text tab 4</h3></div></div></div></div>
				</div>

 

Added 55 minutes later:

Ok, and more progress.
I think the isue why the text is not displaying is cause the H3 is a subchapter (that is the default plugin behaviour/setting).
So, I need to change " $text = str_replace("<$elem>$chapter_raw</$elem>", "<div class=\"tab-content\" id=\"tab$level\"><div class=\"gamelist\"><$elem>$level. $chapter</$elem>", $text);" so it does not display "chapter" but "subchapter".
If I change it to "$subchapters" the oly output I got in my page was "Array" instead of any text. That seems logic as it is meant to show a subchapter count but than the plugin needs to be adapted so "$subchapters" is handles the same as "$chapter" ....... right?
Does that make any sense?

<img src="http://www.armaholic.com/datas/thumbs/green-sea-battalion-uniforms-version-03-preview_4.jpg" alt="green-sea-battalion-uniforms-version-03-" />
This post was edited by foxhound (2013-06-25 23:18, 10 years ago)