Last modified: 2013-03-25 15:02:31 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T18624, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 16624 - Requesting hooks for start and end of the sections
Requesting hooks for start and end of the sections
Status: NEW
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
unspecified
All All
: Low enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-12-13 04:58 UTC by Robert Pilawski
Modified: 2013-03-25 15:02 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Robert Pilawski 2008-12-13 04:58:42 UTC
I want to write extension that will show advertisement units called by hooks. Lot of website place ads units in the middle of text, for example just after first paragraph or section, but it is not possible with MediaWiki (or maybe it is?). The hooks should be like Section1Start, Section2End and so on (with section 0 as well).

One of idea of extension with these hooks is to allow to place one of ads units in the middle of article. We're taking number of section, and if there's 4 or more sections, we place ads on the end of ((number of sections / 2) round 0) section.

Hooks shouldn't couse any trouble. Action registred with nonexisting hook and nonexisting section just will not be proceed. That could be even usefull for showing ads depending on text long (I'm also planning to show no ads on too short pages to avoid breaking the Google's TOC and other providers conditions).
Comment 1 Karun 2010-02-06 10:22:03 UTC
Do you have any examples of what you want to do? I dont know if too many people use Mediawiki with advertisements. The Wikipedia project certainly doesnt.
This is likely not too easy.
Comment 2 Bawolff (Brian Wolff) 2010-02-07 03:06:36 UTC
You can sort of already do this in a limited way with the DoEditSectionLink hook (However any inserted html would be in the <h2> and it wouldn't work for any pages with __NOSECTIONEDIT__ on, and determining which section number you're at might be difficult if some of the sections are transcluded), or the ParserBeforeStrip hook (To look for sections, and add an extension tag or something in the appropriate place). Neither of those hooks would be ideal though for what you are trying to do.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links