Last modified: 2012-12-20 13:30:07 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 T23273, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 21273 - A "do not transclude semantic properties outside of these namespaces" configuration option would be nice
A "do not transclude semantic properties outside of these namespaces" configu...
Status: REOPENED
Product: MediaWiki extensions
Classification: Unclassified
Semantic MediaWiki (Other open bugs)
unspecified
All All
: Lowest enhancement (vote)
: ---
Assigned To: Markus Krötzsch
http://dungeons.wikia.com
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-10-25 02:14 UTC by Morgon Kanter
Modified: 2012-12-20 13:30 UTC (History)
1 user (show)

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


Attachments

Description Morgon Kanter 2009-10-25 02:14:03 UTC
I run a decent sized wiki (linked in the URL), and we often set semantic properties via infobox templates and general formatting templates, as I think is a pretty standard and useful practice. However, these pages (we'll call one "foo") that use these templates (we'll call one "bar") occasionally get transcluded into other pages (which we'll call "foobar") whose purpose is to compile a large number of foo-pages. However, this brings up a bit of a problem where the properties that are on page foo start showing up on page foobar, which we don't want. However, all those properties are set in template bar, and we also need the formatting aspects from template bar to show up on page foobar, so we can't just surround the inclusion call to bar on page foo in noinclude tags -- then we wouldn't get the information we need onto page foobar. As a result all the properties set by bar show up on foobar -- something we don't want to happen.

To get around this, we kindly request that a new configuration option be added to Semantic MediaWiki, one that says something like "don't transclude properties from pages unless they're in these namespaces". The way it would work would be that if a template (that is in a transclude-okay namespace) gets put onto another page the properties go with it, but if that other page (that is not in a transclude-okay namespace) gets put into another page the properties set by the template do *not* go with it.
Comment 1 Markus Krötzsch 2009-10-25 21:40:55 UTC
Due to the architecture of MediaWiki and SMW, it is not possible to distinguish between transcluded and directly inserted texts at the time when SMW properties are collected during the processing of a page. I think this would be very hard to change.

Various other options are possible, however:
* You can generally disable SMW data for some namespace (as already done for templates). The relevant configuration option is explained at [http://semantic-mediawiki.org/wiki/Help:Configuration#smwgNamespacesWithSemanticLinks].
* You can construct a parser function "#if" that checks the current namespace (there is also a parser function for obtaining it) and that controls whether or not SMW annotations are set based on this information. The disadvantage is a higher number of parser function calls which could hurt performance. If this is not an issue, then yuo could even wrap this intelligence into a template that takes an SMW property name and a value, and that is used instead of SMW syntax in all templates. But large numbers of nested template calls can really be a performance issue.
* Maybe you can use SMW's format=embed with #ask to make the lists at foobar automatically instead of creating them manually? This format takes care of preventing transclusion of properties (it uses a hack right now, but it does the job, and future versions are very likely to still solve the issue, maybe without the hack).
* You can also use the hack directly: put [[SMW::off]] ... [[SMW::on]] around any piece of wiki text for which SMW links should be ignored. As I said, this is an undocumented hack, and it will go away without notice or regret as soon as we have time for building a better solution.

I hope that some of the above will be of some use to you. We will not do anything else about the issue for now, as I have no idea how to implement a special handling for transcluded code in a clean way (if this is possible at all).
Comment 2 Morgon Kanter 2009-11-12 01:16:06 UTC
Could we get [[SMW::off]] and [[SMW::on]] as a documented and persistent feature instead of a hack that might go away? That would be incredibly useful.
Comment 3 Andre Klapper 2012-12-20 13:30:07 UTC
[Removing RESOLVED LATER as discussed in http://lists.wikimedia.org/pipermail/wikitech-l/2012-November/064240.html and announced in https://sourceforge.net/mailarchive/forum.php?thread_name=CALFVSbXkiffYy6HkhEWE0RtRrJ%2B2ebPz3g00gsr%2Bdz%2B1nZWsDA%40mail.gmail.com&forum_name=semediawiki-devel . Reopening and setting priority to "Lowest". For future reference, please use either RESOLVED WONTFIX (for issues that will not be fixed), or simply set lowest priority. Thanks a lot!]

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


Navigation
Links