Extension talk:TagAsCategory

hookEvent is not defined
Hi. Get a "hookEvent is not defined" in the error console. It was ok with 1.16. Looks like it's called to early, before wikibits to be loaded, but have no idea how to fix that. --180.183.188.157 06:25, 6 September 2011 (UTC)

Hi. I'm with the same problem ("hookEvent is not defined"). Have you been solved this case? Thanks.

Input box + button don't show up
TagAsCategory doesn't even show an Error Message in my Wiki (1.17.0). Installation of the extension is only visible in Special:Version. Doesn't show up on any pages. --82.135.105.34 11:03, 18 October 2011 (UTC)
 * At first, I thought it might be because the div id is called 'mw-normal-catlinks' in vector skin (see comment at ). However, even when I change the div id 'catlinks' to 'mw-normal-catlinks' in tagascategory.php it does not show up (unaltered html source code). Any other idea? --82.135.105.34 09:49, 21 October 2011 (UTC)

Problem
The links created by the extension are wrong in my wiki. Instead linking to "http://wiki.example.com/index.php?title=Special:Categories" it links to "http://wiki.example.com/Special%3ACategories" with "%3A" instead of ":" and without "index.php?title=" this does not work.

Similar Problem on Wiki V1.14
I get the following error page when I try to add a tag. --Mark Weiser 10:27, 13 May 2009 (UTC) The action specified by the URL is invalid. You might have mistyped the URL, or followed an incorrect link. This might also indicate a bug in the software used by MTSGWiki.

Will take a look
Thanks for the heads-up - I'll take a look. I believe our blog is running in the mode that rewrites URLs. There's probably a way to build a link programmatically through the API that will be compatible with both URL syntaxes. --Gbarnett 22:06, 7 August 2007 (UTC)

Same Problem on Wiki v1.15.1
I echo the issue of the original problem. I still use "index.php?title=" which breaks the extension. In other words, clicking on 'Tags' returns the URL "http://wiki.example.com/Special%3ACategories" with "%3A" instead of ":" and without "index.php?title=" this does not work. --SomaticJourney 08:44, 6 February 2010 (UTC)
 * Anyone? --SomaticJourney 15:57, 13 February 2010 (UTC)

File called ArticleTagger.php??
Should the file actually be called ArticleTagger.php? If the require functionis looking for extensions/TagAsCategory/TagAsCategory.php, shouldn't you then have to cretae a directory in extensions called TagAsCategory and then in that directory, name your file TagAsCategory.php?

Yes, should be called TagAsCategory.php
Sorry, the extension used to be called "ArticleTagger", but we renamed it to "TagAsCategory" because we felt it was more descriptive.

I've replaced the references to "ArticleTagger" in the extension page with "TagAsCategory" -- sorry about the typo.

--Gbarnett 13:23, 10 August 2007 (UTC)

A function I would like to see.
A very nice feature would be to have a drop-down list of all your categories appearing, or an AJAX auto complete feature showing existing categories as you type.

Deleteing tags
How do you delete a wrongly named Tag ?
 * I just edit the article and manually remove the tag from the article.  This extension simply makes it easy to inject the category tags into articles... removing them is still through the normal means.  --Brianadkins 21:53, 13 September 2007 (UTC)

Thanks I am New to this. see also Project talk:Categories

Note for people running a custom skin
You need the "catlinks" div to exist in your skin.

essentially //name of div identifying categories the page belongs to if (document.getElementById('catlinks')) {   document.getElementById('divLocationForTagForm').appendChild(document.getElementById('tagform')); }

You can just rename the div if you've ignored / heavily modified monobook.

Neilkt 01:53, 16 September 2007 (UTC)

example sites?
Anyone have any example sites running this extension? I would like to see it in action.

--Smarbin 07:09, 19 September 2007 (UTC)


 * Yes: Esopedia This is one --Claudio Carli 01:37, 22 January 2009 (UTC)

Localized message for "Add tag"
For those who haven't figured it out, you can localize the "Add tag" button in the TagAsCategory.php file.

Example with danish text: $wgMessageCache->addMessages(       array ( 'addtag' => 'Tilf&oslash;j kategori', 'notags' => '(none)' -- Kirjapan 10:33, 17 October 2007 (UTC)
 * 1) add localized messages for the "Add Tag" and "(none)" interface strings

How to prevent it appearing on defined pages?
Hello, I've tried this excellent script and think it is very helpful for the user to easy add 'tags' to the page. However, I would really like to be able to prevent this add-tag form from appearing on certain defined pages, ie: Main_Page | Foos_Feet etc. It would also be very handy to be able to prevent the add-tag from appearing on all the pages in a certain NameSpace, as well as preventing it from appearing on Category pages. Would this be possible? Another feature that would be great is for non-registered readers to not even see the add-tag form at all. Sadly my coding skills are zeroish so I can't hack it ZooHoo 01:25, 7 December 2007 (UTC)


 * I have zero coding skills, but would like to exclude the tag as category for at least the main page... anyone? --Mark Weiser 02:11, 4 July 2008 (UTC)


 * I have changed it to be called by tag placed at the and of page, so you can add it only to the pages that need it. Here it is:

Parhom 12:40, 4 August 2009 (UTC)

Refresh Issue & Possible Fix
Hi,

Greate extension. However, I came across an issue. Whenever I used the Add Tag feature, the tag wouldn't show up until I refreshed the browser, changed articles or edited the article. HOWEVER, when I edited the article, I found that the Tag had been added every time I hit refresh.

I.e.
 * I hit Add Tag, then refresh so I can see it. Refresh once more, again and finally once more.  I then hit EDIT.  The tag now appears four times in the page text (it still only displays once when you view the article).

I fixed this by making a few tweaks to the last section of TagAsCategory.php, as detailed below.

-- AerosAtar

--

Actually, it looks like the issue with strpos not correctly identifying the category string is a really silly bug in the code. should actually be: The ' surrounding $newCategoryString are causing it to try to find the string "$newCategoryString" in $content, rather than the value of $newCategoryString. -- 65.209.146.242 16:11, 19 August 2010 (UTC)


 * I actually came across a slight issue with the code change I made above, in that the header path should not be explicit (if you're not using localhost, it doesn't work). A slightly more elegant solution is to do the following:

--AerosAtar

Code Modification: Multiple tags at once
I love this extensions, but wanted to ability to add multiple tags at one time. So I updated the code to do this. I changed the form used to add tags (to make it larger) and modified the tagAction function to allow multiple tags. Here's the updated code:

-JCamozzi
 * Why split on space? This means that you can't have categories with spaces. Would make more sense to split on a comma, or somesuch. - 220.233.239.174 09:20, 27 May 2008 (UTC)

Prevent appearance on main_page?
How to prevent it from appearing on certain pages like main_page?

Problems with HTML rewrite on 0 category case
The div containing "Tags: (none)" and the "Add Tag" form are not controllable via main.css (monobook shows a box around the category section of a page). I would appreciate a solution to this. BTW: I have checked with IE6 and IE7. --82.113.113.82 09:07, 11 March 2009 (UTC)

I found a solution for this: It was a CSS-referencing problem only - just don't create the attribute "id" to the div-tag, but the attribute "className", value "catlinks". This works fine and we do not need id "catlinks", since effectively, there exists no catlink.

Warning: Cannot modify header information
headers already sent by (output started at /opt/lampp/htdocs/wiki.lan/wiki/extensions/TagAsCategory/TagAsCategory.php:188) in /opt/lampp/htdocs/wiki.lan/wiki/includes/WebResponse.php on line 16

I got that error in MW 1.14.0.

Problem when tagging
I get this message when tagging a page :

Warning: Illegal offset type in isset or empty in /www/htdocs/w00845b3/nvcwiki.com/fr/includes/Title.php on line 128

Warning: Illegal offset type in /www/htdocs/w00845b3/nvcwiki.com/fr/includes/Title.php on line 150

Using MW 1.11.2

Thanks anyway for this very usefull extension !

--Dieudo 08:23, 24 August 2009 (UTC)

specify to users that tag creation is case sensitive
I made a quick modification to the extension. When you add a tag/category it is case-sensitive, so why not inform the user of that issue to save the admin less clean up work. Edit extensions/TagAsCategory/TagAsCategory.php and customize the 'Add Tag' variable. As you can see below, I added (Note:case sensitive) to it.

(hint hint nudge nudge): It would be awesome to have some type of AJAX suggest list of tags to choose from when typing a tag in to the input box that can translate case-insensitivity to the correct tag/category.

Thanks for the awesome extension! --SomaticJourney 09:01, 6 February 2010 (UTC)

Language variables not substituted
Since Mediawiki 1.16, I am getting literally "&amp;lt;notags&amp;gt;" and " " instead of "Add Tag" and "(none)", see this screenshot

This happens in English as well as in German. It worked fine in previous MediaWiki verions. Does anyone know a fix for this?

Harald, 22:14, 7 January 2011 (UTC)

The solution is to add the text messages along with the corresponding language:

$wgMessageCache->addMessages(       array ( 'addtag' => 'Add Tag', 'notags' => '(none)' ),       'en'    ); $wgMessageCache->addMessages(       array ( 'addtag' => 'Tag hinzufügen', 'notags' => '(keine)' ),       'de'    );

91.66.77.149 12:13, 23 May 2011 (UTC)

Only shows in pages with categories
The "add tag" template only appears on pages that already have Categories attached to them. Is there any way to make it so that every page has the template appear?

Nabil Boutaleb, 17:43, 27 April 2011 (UTC)

Reason for this is that a CSS-class ".catlinks-allhidden" sometimes prevents it from showing up. One solution is to change some part of the javascript to move the tag-form outside of the category-div. Instead of document.getElementById('catlinks').appendChild(document.getElementById('tagform')); write: document.getElementById('catlinks').parentNode.appendChild(document.getElementById('tagform'));

Doesn't look as nice though.. 91.66.77.149 12:17, 23 May 2011 (UTC)
 * I'd also love to see this extension on pages that don't have categories yet. Will this be implemented anytime soon? Cheers --Fxk2 10:34, 8 June 2011 (UTC)

Exception
Got "PHP Fatal error: Call to a member function addMessages on a non-object in /var/www/extensions/TagAsCategory/TagAsCategory.php on line 75" --85.142.26.224 10:48, 6 August 2012 (UTC)