Extension talk:Header Tabs/2020
Add topicThis page used the Structured Discussions extension to give structured discussions. It has since been converted to wikitext, so the content and history here are only an approximation of what was actually displayed at the time these comments were made. |
Old messages from this page are archived.
Automatic Tab Generation Not Working
[edit]Automatic Tab generation is not working on any namespave on my Mediawiki instakk. It works fine when I use <headertabs/>..
Used previously but I cannot seem to make it work on my current setup. Any advice appreciated.
Versions
MediaWiki - 1.34.0
Software Verions :-
PHP - 7.3.15
MySQL - 5.6.47
ICU - 50.1.2
Lua - 5.1.5
Header Tabs 1.2 (b548d42) 06:17, 2 August 2019
Config
wfLoadExtension( 'HeaderTabs' );
$wgHeaderTabsUseHistory = false;
$wgHeaderTabsRenderSingleTab = true;
$wgHeaderTabsAutomaticNamespaces[1] = NS_MAIN;
$wgHeaderTabsAutomaticNamespaces[2] = NS_TEMPLATE;
$wgHeaderTabsAutomaticNamespaces[3] = SF_NS_FORM;
$wgHeaderTabsAutomaticNamespaces[4] = SMW_NS_PROPERTY;
$wgHeaderTabsAutomaticNamespaces[5] = NS_CIAO;
$wgHeaderTabsDisableDefaultToc = false;
$wgHeaderTabsGenerateTabTocs = felse;
$wgHeaderTabsEditTabLink = false; 185.98.182.122 (talk) 22:26, 14 April 2020 (UTC)
Suppress HeaderTabs when Printing Page
[edit]Hi. I was wondering if there was a specific class for the rendered HeaderTabs such that I could suppress printing of the HeaderTabs by adding a "display: none" in my Print.css?
Or is there a different way to suppress printing of the HeaderTabs?
Thank you,
Gregg GMShimokura (talk) 22:57, 14 May 2020 (UTC)
Edit tab link pointing to Hauptseite
[edit]I have recently upgraded to 1.34.2 and the edit link on headertabs is now pointing to "title=Hauptseite&action=edit" - This is on an English wiki so not sure where this is coming from.
Drew Stampstudy (talk) 16:38, 26 July 2020 (UTC)
- Interestingly, this bug was in place for a long time, but was just fixed last week. If you get the latest Header Tabs code, the problem should go away - and you'll see a new display style for tabs. Yaron Koren (talk) 14:50, 27 July 2020 (UTC)
- That worked perfectly, many thanks. Now to figure out how to change the tab colours. Stampstudy (talk) 15:10, 28 July 2020 (UTC)
Nice upgrade - One note of finding
[edit]This appears to have fixed a long annoyance that sometimes a tabbed page wouldn't show up with the tabs. Hitting Ctrl+r usually woke it up. Another problem was, I use Page Forms (for Semantic Mediawiki) and the spreadsheet style editing tables never initially showed up formatted correctly. Adding or editing a row would fix it, but again annoying.
This appears to have fixed those issues. THANKS!
One note of warning, I had one form stop working after the upgrade to 2.0. You edit on the first tab ok, but none would flip. Scrolling down you would see each tab going down the page, with it stuck on loading the last one. If you didn't notice and did an edit and save on the first tab, it would erase the spreadsheet style created templates. Upon investigation of the form, the only difference between working forms and the non-working form was a blank line before <headertabs />. After adding the blank line to the non-working form, it worked as well as the rest. Tgschaef (talk) 12:33, 29 August 2020 (UTC)
- That's good to know - thank you. Yaron Koren (talk) 14:29, 2 September 2020 (UTC)
Tabs Not Displaying Form
[edit]MW 1.34.2, Header Tabs 1.2. Have a form with a template built out with Page Forms and Cargo. Installed Header Tabs. Tabs pop up but only the last tab shows the Form. It is a single Template and a single Form. I would like to split the Form into tabs. So, link here: https://digitalmatrixgroup.com/index.php/Form:Investor_Asset and here https://digitalmatrixgroup.com/index.php/Template:Investor_Asset. The example link listed in your Extension page does not allow viewing any code and looks like a regular web page. I put links to the photo examples here which document where I put the '=Tab=' info into the Form and I added the end "<headertabs/>" before the Standard sections: https://pasteboard.co/JoXbcZI.png ... https://pasteboard.co/JoXbV6F.png ... https://pasteboard.co/JoXc6C8.png ... I asked over on the IRC but no one really had a response. Thanks for your time! Foreclosurepedia (talk) 19:31, 31 August 2020 (UTC)
- You should upgrade to the latest version of Header Tabs, 2.0, if possible - it just came out a few weeks ago, and it improves in a few key ways on the previous version. Yaron Koren (talk) 22:06, 31 August 2020 (UTC)
- I have been trying to keep all extensions matching the Stable Version of MW I run, but I upgraded to v2.0 just now and no change. I ran the Purge and Purge Cache on the Form as well. Any other suggestions or points I might be missing? Thanks! Foreclosurepedia (talk) 14:55, 1 September 2020 (UTC)
- I just looked at the form - I think the issue is that you put the tabs inside a table. That won't work, I don't think - if you're going to have three tabs, you should have three separate tables, each one in its own tab. Yaron Koren (talk) 23:32, 1 September 2020 (UTC)
- Worked like a charm! Thank you very much! There is something different that happens now, though. The tab being used is colored white as opposed to light blue. Do not know if that is important and would be curious how to either change the color from white to "x" when it is active or statically. Regardless, thanks for taking the time to both look and answer and have a great day! Foreclosurepedia (talk) 13:56, 2 September 2020 (UTC)
- Great! Well, in v2.0 of Header Tabs, the underlying JS library being used changed from jQuery UI to OOUI - which is a MediaWiki-specific library. I don't know how to change any of the colors - I assume it can all be done with CSS. If you really prefer the older look, I guess you could just revert Header Tabs back to the older version - it should still work. Yaron Koren (talk) 14:17, 2 September 2020 (UTC)
- I'll stick with what is working now and delve into CSS down the road. Thanks again for the help!!! Foreclosurepedia (talk) 23:40, 2 September 2020 (UTC)
When running scripts I get PHP Notice: Undefined index:
[edit]- Setup
- MediaWiki 1.35.0-rc.2 (5f6c9d1) 17:32, 21 August 2020 - PHP 7.2.24-0ubuntu0.18.04.6 (apache2handler) - Header Tabs 2.0 (36e8e34) 19:30, 25 August 2020
- Issue
PHP Notice: Undefined index: HTTP_HOST in /../w/extensions/HeaderTabs/includes/HeaderTabs.php on line 227 Notice: Undefined index: HTTP_HOST in /../w/extensions/HeaderTabs/includes/HeaderTabs.php on line 227 PHP Notice: Undefined index: REQUEST_URI in /../w/extensions/HeaderTabs/includes/HeaderTabs.php on line 230 Notice: Undefined index: REQUEST_URI in /../w/extensions/HeaderTabs/includes/HeaderTabs.php on line 230
[[kgh]] (talk) 14:10, 14 September 2020 (UTC)
- I had hoped that the new version 2.1 fixes the issue, however it does not. I am on MW 1.35.x [[kgh]] (talk) 09:28, 20 October 2021 (UTC)
- Also reported with Extension talk:Header Tabs#h-Notices:_Undefined_index_displayed_in_latest_version-2021-06-18T09:05:00.000Z [[kgh]] (talk) 09:30, 20 October 2021 (UTC)
- Sorry about that - this was a (slight) bug introduced about a year ago. I just checked in a fix for it. Yaron Koren (talk) 17:39, 20 October 2021 (UTC)
- Affirmative, master works fine. A tag will be great if possible. [[kgh]] (talk) 21:12, 20 October 2021 (UTC)
- Sorry to came back to this issue, but I'm on mediawiki 1.37.1 and right now, during the semantic-mediawiki rebuild, and I can see the same error.
- [...]
- ... updating ... 19308 / 106374 ( 18%)
- PHP Notice: Undefined index: HTTP_HOST in /var/www/wiki/extensions/HeaderTabs/includes/HeaderTabs.php on line 226
- PHP Notice: Undefined index: REQUEST_URI in /var/www/wiki/extensions/HeaderTabs/includes/HeaderTabs.php on line 229
- I checked out from git repo the latest code and changed to branch REL1_37. Helioloureiro (talk) 14:17, 22 January 2022 (UTC)
- You should use the master code, not the REL1_37 branch. Yaron Koren (talk) 16:00, 24 January 2022 (UTC)
Bookmarks
[edit]With the old version of the Header Tabs. I could set links from other pages with bookmarks and it goes to that specific tab with the tab shown. This new version doesn't do that. The only way is to include "#tab=" and followed by bookmark.
But the thing is that I use Semantic Mediawiki subobjects to query for the links, and subobjects used hashtags which I also used as bookmarks to point to the proper tab or (no with tabs) location on the page. Is my only option is to try to manipulate the queries? Acnetj (talk) 21:46, 27 September 2020 (UTC)
Link to tab does a partial match
[edit]MediaWiki 1.35.0, HeaderTabs 1.3
If I have a headertabs page where there there is a header title that is a superstring of another header title, when linking to the substring I actually navigate to the superstring tab.
Example page:
= Header Yellow = This is section one. = Another Header Red = This is section two. = Header Green = This is section three. = Header Red = This is section four. <headertabs/>
If I link to this page via Page Title#Header Red, it will actually take me to the "Another Header Red" tab. Gaerlin (talk) 20:44, 8 November 2020 (UTC)
Call to undefined method Parser::formatHeadings()
[edit]The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
MediaWiki 1.35.0, HeaderTabs 2.0
Problem preventing the page from displaying!Call to undefined method Parser::formatHeadings()
//$tabtocraw = $tocparser->formatHeadings( $content, '' );
- Megajoule (talk) 20:00, 24 November 2020 (UTC)
$tabtocraw = $tocparser->internalParse( $content );
Is $wgHeaderTabsDisableDefaultToc = true; not working?
[edit]The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
MediaWiki 1.35.0, HeaderTabs 2.0
Solution : change this in HeaderTabs\includes\HeaderTabs.php$tocpattern = '%<div id="toc" class="toc" role="navigation" aria-labelledby="mw-toc-heading"><input type="checkbox" role="button" id="toctogglecheckbox" class="toctogglecheckbox" style="display:none" /><div class="toctitle" lang=".+?" dir="ltr"><h2 id="mw-toc-heading">.+?</h2><span class="toctogglespan"><label class="toctogglelabel" for="toctogglecheckbox"></label></span></div>' . "\n+" . '(<ul>' . "\n+" . '.+?</ul>)' . "\n+" . '</div>' . "\n+" . '%ms';
Is $wgHeaderTabsGenerateTabTocs = true; not working ?
[edit]The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
MediaWiki 1.35.0, HeaderTabs 2.0
Solution : change that in HeaderTabs\includes\HeaderTabs.php
$s = 0;
$titleCount= array() ;
$tocparser = clone $parser;
$tabtocraw = $tocparser->internalParse( $content );
$tocpattern = '%<div id="toc" class="toc" role="navigation" aria-labelledby="mw-toc-heading"><input type="checkbox" role="button" id="toctogglecheckbox" class="toctogglecheckbox" style="display:none"/><div class="toctitle" lang=".+?" dir="ltr"><h2 id="mw-toc-heading">.+?</h2><span class="toctogglespan"><label class="toctogglelabel" for="toctogglecheckbox"></label></span></div>' . "\n+" . '(<ul>' . "\n+" . '.+?</ul>)' . "\n+" . '</div>' . "\n+" . '%ms';
if ( preg_match( $tocpattern, $tabtocraw, $tabtocmatches ) === 1 ) {
wfDebugLog( 'headertabs', __METHOD__ . ': generated toc for tab' );
$tabtocraw = $tabtocmatches[0];
$tabtoc = $tabtocraw;
if ($parser->mOptions->getNumberHeadings () == true) {
$itempattern = '/<li class="toclevel-[0-9]+"><a href="(#[^"]+)"><span class="tocnumber">[0-9.]+<\/span> <span class="toctext">(<span><span>[0-9.]+<\/span>([^<]+)<\/span>[^<]+)<\/span><\/a>/';
} else {
$itempattern = '/<li class="toclevel-[0-9]+"><a href="(#[^"]+)"><span class="tocnumber">[0-9.]+<\/span> <span class="toctext">(<span>([^<]+)<\/span>[^<]+)<\/span><\/a>/';
}
if ( preg_match_all( $itempattern, $tabtocraw, $tabtocitemmatches, PREG_SET_ORDER ) > 0 ) {
foreach ( $tabtocitemmatches as $match ) {
$newitem = $match[0];
if ( count( $matches ) == 4 ) {
$titleLink = str_replace(" ", "_", trim( $match[3] )); // remplacement des espaces insécables
$titleLink = '#' .str_replace(" ", "_", $titleLink );
if (array_key_exists($titleLink, $titleCount)) {
$titleCount[$titleLink] = $titleCount[$titleLink] + 1;
$titleLink = $titleLink . "_" . $titleCount[$titleLink];
} else {
$titleCount[$titleLink] = 1;
}
$newitem = str_replace( $match[1], $titleLink, $newitem );
$newitem = str_replace( $match[2], trim( $match[3] ), $newitem );
}
$tabtoc = str_replace( $match[0], $newitem, $tabtoc );
}
$content = $tabtoc . $content;
}
}
Class 'OOUI\TabPanelLayout' not found
[edit]tried version 2.0 for the first time om MW 1.31 and get this error
[X@CRKp0hUbgJtA6mJBGcLAAAAA8] /User:Admin Error from line 239 of ..extensions/HeaderTabs/includes/HeaderTabs.php: Class 'OOUI\TabPanelLayout' not found
Backtrace:
#0 ../extensions/HeaderTabs/includes/HeaderTabsHooks.php(47): HeaderTabs::replaceFirstLevelHeaders(Parser, string, array)
#1 ..includes/Hooks.php(177): HeaderTabsHooks::replaceFirstLevelHeaders(Parser, string)
#2 ../includes/Hooks.php(205): Hooks::callHook(string, array, array, NULL)
#3 ../includes/parser/Parser.php(1428): Hooks::run(string, array)
#4 ../includes/parser/Parser.php(446): Parser->internalParseHalfParsed(string, boolean, boolean)
#5 ../includes/content/WikitextContent.php(323): Parser->parse(string, Title, ParserOptions, boolean, boolean, integer)
#6 ../includes/content/AbstractContent.php(516): WikitextContent->fillParserOutput(Title, integer, ParserOptions, boolean, ParserOutput)
#7 ../includes/poolcounter/PoolWorkArticleView.php(144): AbstractContent->getParserOutput(Title, integer, ParserOptions)
#8 ../includes/poolcounter/PoolCounterWork.php(123): PoolWorkArticleView->doWork()
#9 ../includes/page/Article.php(604): PoolCounterWork->execute()
#10 ../includes/actions/ViewAction.php(68): Article->view()
#11 ../includes/MediaWiki.php(500): ViewAction->show()
#12 ../includes/MediaWiki.php(294): MediaWiki->performAction(Article, Title)
#13 ../includes/MediaWiki.php(818): MediaWiki->performRequest()
#14 ../includes/MediaWiki.php(524): MediaWiki->main()
#15 ../index.php(42): MediaWiki->run()
#16 {main} Krabina (talk) 12:15, 21 December 2020 (UTC)
- Yes, version 2.0 only supports MediaWiki 1.33 and higher, unfortunately. Yaron Koren (talk) 15:13, 21 December 2020 (UTC)