Jump to content

Extension talk:Attachments

Add topic
From mediawiki.org
Latest comment: 9 months ago by ~2025-29948-09 in topic missing illustrations

Thanks for this!

[edit]

Just happened to be looking for something like this. Thanks! Postprefix (talk) 13:02, 27 June 2019 (UTC)Reply

Happy to hear that, I'm glad somebody else finds it useful. Gittenburg (talk) 17:42, 27 June 2019 (UTC)Reply

Job Runner?

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


I see that "It is recommended to set up a job runner". What job should be run? Postprefix (talk) 14:12, 27 June 2019 (UTC)Reply

Setting up a job runner should only be necessary if you add the parser functions of this extension using the API repeatedly and your wiki has few traffic. I guess I should update the README. Gittenburg (talk) 17:33, 27 June 2019 (UTC)Reply
I understand. I'm not sure it'll apply in my case, but thank you for explaining! Postprefix (talk) 13:49, 28 June 2019 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

go back to parent page

[edit]

I found this very usefull, thank you !


but...

*when I use {{FILEPREFIX:..}} a "-" is added at the end and leave the link unavailable.

*And how can I remove an attachment I create by error ? IBikette (talk) 20:49, 8 October 2019 (UTC)Reply

OK... when it's a media file, simply remove {{#attach... in the Description section of the file

IBikette (talk) 21:33, 8 October 2019 (UTC)Reply
The "-" that is added by {{FILEPREFIX}}, should also be added automatically when uploading a file via the Attach page action.
{{FILEPREFIX:..}} would for example be used on Foo/Bar, to embed a file you previously attached to Foo. Gittenburg (talk) 06:12, 2 November 2019 (UTC)Reply

Have the 'Attachments' tab at the top as a seperate page

[edit]

Hi, will this allow me to have attachments in specific pages, instead of the "Main" namespace?


Also, would it be possible (or is it planned) to have that 'attachments' tab at the top as a seperate section of a page, similar to how the 'Discussion' button takes you a new page of an article?


Moreover, are the files going to be displayed as they are now, or they could be more organised using a file browser (similar to this extension )? (or by maybe using this? Extension:FileList )

Essentially I want to have each page have a 'files' tab that will act like a file repository with a file browser, with write access only for the creator of the page.


Thank you. MavropaliasG (talk) 09:57, 4 December 2019 (UTC)Reply

Hi!
The attachments are attached to specific pages. You can enable the extension on a namespace by namespace basis.
  • This extension was designed for having attachments your users care about (hence they are displayed on the same page).
  • The extension was also designed for having many attachments on one page (hence the compact column layout).
  • The extension displays files, subpages and links together in the same list, sorted alphabetically.
Restricting access to the creator will not be implemented because MediaWiki also does not support it as it goes against the collaborative nature of a wiki.
This extension unfortunately does not cover your use case, I'll update the introduction to make the intended use case more clear.
You could try:
  • the Extension:VisualEditor which allows easily embedding files with "Insert -> Media"
  • MoinMoin Wiki, which supports attachments out of the box and displays them in a separate page
Good luck! Gittenburg (talk) 07:31, 7 December 2019 (UTC)Reply
Thank you very much! And thank you for making the extension :) MavropaliasG (talk) 09:00, 7 December 2019 (UTC)Reply

Translation

[edit]

Hi, thank you for really useful extension.

If you like to add Russian translation into your package, I'll be glad to share. Write me directly. Dmitry Karev (talk) 20:23, 18 September 2020 (UTC)Reply

[ZLCIAcd34bA5sLYhVLolUAAAAIY] 2023-07-13 23:25:54: Fatal exception of type "Error"

[edit]

I have updated from Mediawiki 1.39 to 1.40 with Attachments 0.1.0


When I try to entry principal page of my mediawiki:


[ZLCI61ZAIcCo1FLSUnDLlAAAAQU] /index.php/Manual:NOM-035-STPS-2018:V1.0Alpha:Procedimiento_General_de_la_NOM-035-STPS-2018 Error: Call to undefined method MediaWiki\Page\PageProps::getInstance()

Backtrace:

from /home/wwuni2/uni2porti.org/extensions/Attachments/includes/Attachments.php(73)

#0 /home/wwuni2/uni2porti.org/extensions/Attachments/includes/AttachmentsHooks.php(62): Attachments::getPages(MediaWiki\Title\Title)

#1 /home/wwuni2/uni2porti.org/includes/HookContainer/HookContainer.php(338): AttachmentsHooks::onBeforePageDisplay(OutputPage, MediaWiki\Skins\Vector\SkinVector22)

#2 /home/wwuni2/uni2porti.org/includes/HookContainer/HookContainer.php(137): MediaWiki\HookContainer\HookContainer->callLegacyHook(string, array, array, array)

#3 /home/wwuni2/uni2porti.org/includes/HookContainer/HookRunner.php(941): MediaWiki\HookContainer\HookContainer->run(string, array, array)

#4 /home/wwuni2/uni2porti.org/includes/OutputPage.php(2894): MediaWiki\HookContainer\HookRunner->onBeforePageDisplay(OutputPage, MediaWiki\Skins\Vector\SkinVector22)

#5 /home/wwuni2/uni2porti.org/includes/MediaWiki.php(941): OutputPage->output(boolean)

#6 /home/wwuni2/uni2porti.org/includes/MediaWiki.php(576): MediaWiki->main()

#7 /home/wwuni2/uni2porti.org/index.php(50): MediaWiki->run()

#8 /home/wwuni2/uni2porti.org/index.php(46): wfIndexMain()

#9 {main}


What can I do? Cesarhr (talk) 23:30, 13 July 2023 (UTC)Reply

Reviving the Attachments Extension

[edit]

After the original developer indicated that they would no longer maintain the Attachments extension, I decided to take over its maintenance. I attempted to reach out to the original author via this GitHub issue, but received no response. As a result, I forked the repository into a detached version to continue development independently. I'd like to express my appreciation to Gittenburg for their original work in creating this extension.

What's New?

[edit]
  • Detached Git repository for continued independent development.
  • Code updated for compatibility with currently supported MediaWiki versions: 1.43 LTS, 1.42, and 1.39 LTS.
  • Switched to a release branch compatibility strategy.
  • Dutch added as a supported language.
  • Improved translations across all supported languages.
  • Removed the outdated Minerva Neue integration, replaced with a new workaround for MediaWiki ≥1.39.
  • New configuration options introduced for UI behavior (MediaWiki ≥1.42):
    • $wgAttachmentsShowInNamespaces: Default true for 1.39, false for ≥1.42.
    • $wgAttachmentsShowInViews: Default true for 1.39, false for ≥1.42.
    • $wgAttachmentsShowEmptySection: Default false.
  • Removed hook ShowEmptyAttachmentsSection in favor of the new config setting.
  • Page property values now stored as JSON strings, as non-string values are obsolete (when querying via the API).
  • Added basic Selenium integration tests to verify extension functionality.
  • Fixed a bug with anchor translations.

What's Next?

[edit]
  • Ongoing maintenance and compatibility updates with future MediaWiki releases.
  • Support for uploading file attachments via VisualEditor.

Feedback and issues

[edit]

Feel free to submit a issue report over at the Github repository.

Shibe90(talk) 10:34, 13 May 2025 (UTC)Reply

Thank you. I don't personally use this, but as an admin on MediaWiki.org who's been watching extensions bitrot for a while it's nice to see things actually start working for a change. * Pppery * it has begun 16:33, 13 May 2025 (UTC)Reply

missing illustrations

[edit]

Rereading: adding a screenshot of the attachment at the end of a page, as the item in the upload dialog is welcomed for the reader to understand what he could expect. Thanks. -- Christian 🇫🇷 FR 🚨 (talk) 06:31, 27 July 2025 (UTC)Reply

Thank you for the feedback. I've updated the screenshot in the extension template instead. ~2025-29948-09 (talk) 12:30, 24 October 2025 (UTC)Reply