I would like to define two templates, one being a "start" template which contains <div style="bunch of stuff">
and the other containing just </div>
However, the "</div>" is being escaped by the MW engine, so appears verbatim in the page, rather than functioning as an HTML end tag.
Is there a way around this? I'm guessing the problem is that the MW engine doesn't see matching start and end divs when it parses the markup, and so decides that </div> should be interpreted literally rather than as HTML.
Defining just a single template that wraps the tags around the content is not an option; the stuff within the tags can be quite complex, and our experience is that the standard markup is just too fragile to be able to do that sort of thing.
We could of course just put literal divs into the pages, but that gets messy, and also means we can't change the style in the future.
Many thanks for your suggestions, Ken
Tables don't suffer from this limitation, so having a Template:start with:
{| |
and a Template:end with:
|}
should work just fine.
-- Jim R. Wilson (jimbojw)
On 5/29/07, Ken McDonald ken@pixologic.com wrote:
I would like to define two templates, one being a "start" template which contains
<div style="bunch of stuff">
and the other containing just
</div>
However, the "</div>" is being escaped by the MW engine, so appears verbatim in the page, rather than functioning as an HTML end tag.
Is there a way around this? I'm guessing the problem is that the MW engine doesn't see matching start and end divs when it parses the markup, and so decides that </div> should be interpreted literally rather than as HTML.
Defining just a single template that wraps the tags around the content is not an option; the stuff within the tags can be quite complex, and our experience is that the standard markup is just too fragile to be able to do that sort of thing.
We could of course just put literal divs into the pages, but that gets messy, and also means we can't change the style in the future.
Many thanks for your suggestions, Ken
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
I've thought of using tables, but they're not well suited for what we want to do. Entries in each column might themselves be quite complex, such as a paragraph containing sublists. Also, entries might have very different heights, which would leave vertical gaps in columns; we don't need or want vertical alignment between column elements, so this is highly undesirable.
I've tried <nowiki></nowiki> markup around the template contents, but that isn't working.
Are there any special character codes/patterns I can use to force '<' and '>' to appear in the generated HTML _without_ being escaped (converted to < etc.)?
Thanks for the suggestion, Ken
Jim Wilson wrote:
Tables don't suffer from this limitation, so having a Template:start with:
{| |
and a Template:end with:
|}
should work just fine.
-- Jim R. Wilson (jimbojw)
On 5/29/07, Ken McDonald ken@pixologic.com wrote:
I would like to define two templates, one being a "start" template which contains
<div style="bunch of stuff">
and the other containing just
</div>
However, the "</div>" is being escaped by the MW engine, so appears verbatim in the page, rather than functioning as an HTML end tag.
Is there a way around this? I'm guessing the problem is that the MW engine doesn't see matching start and end divs when it parses the markup, and so decides that </div> should be interpreted literally rather than as HTML.
Defining just a single template that wraps the tags around the content is not an option; the stuff within the tags can be quite complex, and our experience is that the standard markup is just too fragile to be able to do that sort of thing.
We could of course just put literal divs into the pages, but that gets messy, and also means we can't change the style in the future.
Many thanks for your suggestions, Ken
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Ken McDonald wrote:
I would like to define two templates, one being a "start" template which contains
<div style="bunch of stuff">
and the other containing just
</div>
However, the "</div>" is being escaped by the MW engine, so appears verbatim in the page, rather than functioning as an HTML end tag.
Is there a way around this?
This seems to work fine in the {{flatlist}}...{{endflatlist}} templates on Wikipedia (endflatlist consists of nothing but </div>). If there's a bug in the template(s) installed, the </div> shows up, but if all the bits are installed correctly, it's hidden. There could even be a bug in the CSS that causes it to muck up. Sorry I can't be more helpful than this - I tried to help someone with this same problem on mwusers.com forum recently, but he fixed it without revealing exactly what he did.
Mike
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Ken McDonald wrote:
I would like to define two templates, one being a "start" template which contains
<div style="bunch of stuff">
and the other containing just
</div>
However, the "</div>" is being escaped by the MW engine, so appears verbatim in the page, rather than functioning as an HTML end tag.
That's not legal in the current MediaWiki parser.
At the moment though it will "work" the way you want it if you enable the use of HTML Tidy as an HTML nesting sanitizer (install HTML Tidy and set $wgUseTidy) instead of the built-in tag balancing code.
This behavior will eventually be normalized one way or the other for both modes.
- -- brion vibber (brion @ wikimedia.org)
Sounds like the best way then is just to define some custom tags via PHP. Do you know if output from PHP tags is postprocessed in any way that would make this difficult?
Thanks, Ken
Brion Vibber wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Ken McDonald wrote:
I would like to define two templates, one being a "start" template which contains
<div style="bunch of stuff">
and the other containing just
</div>
However, the "</div>" is being escaped by the MW engine, so appears verbatim in the page, rather than functioning as an HTML end tag.
That's not legal in the current MediaWiki parser.
At the moment though it will "work" the way you want it if you enable the use of HTML Tidy as an HTML nesting sanitizer (install HTML Tidy and set $wgUseTidy) instead of the built-in tag balancing code.
This behavior will eventually be normalized one way or the other for both modes.
- -- brion vibber (brion @ wikimedia.org)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFGXb9YwRnhpk1wk44RAkNCAKCe3ZaBAyFb+92bmmmbIPHV0kwf3QCbBqCh U1ueEKO/vdj9Ubsl1G6/n/o= =Qpq1 -----END PGP SIGNATURE-----
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
mediawiki-l@lists.wikimedia.org