开发者

MediaWiki : is it possible to add an edit link in a template?

I have a template on my wiki, kind of a box template.

Then, there is this page where I use it several times.

Can I add an edit link to each of the boxes so I don't have to edit the whole page in order to modify one of the boxes?

开发者_运维百科

The boxes contain only text, not other templates.

Thanks!

Edit: Actually there's an easier way to ask my question:

Let's say I have a page without sections defined (namely without == titles ==):

content A content B content C

Is there a way to open an edit form only for content B?


"Is there a way to open an edit form only for content B?" - in standard mediawiki - no, but you can do sth like this

Main page will look like this:

{{/subpageA}}
{{/subpageB}}
{{/subpageC}}

subpageA will contain link to edit subpageA etc

But it is worse than sections in every possible way.


If I understand your question, and I'm not sure I do, I'm assuming your box is a div or table of some sort? If so, you could add id="{{{1|Some identifying parameter}}} to it.. Now, similar to if you had used == header 2 == you will be able to link to that section of the page with [[{{PAGENAMEE}}#{{{1|Some identifying parameter}}}]]. The only trick is to edit that section. You would likely have to set up a <span class=plainlinks>[http://somewiki.com/edit/{{PAGENAMEE}}&section={{{1|Some identifying parameter}}}]</span> Although, I'm not sure using the section name will work on your wiki, it works on only one of four that I edit. The other three require the section number, which may be harder to figure out, or at very least is beyond my pay-grade atm..


Not sure what you're asking here. Do you want to edit the template from the referring page?

Update:

One: The ugly but simple solution:
Add the following code above the text you want to edit:

=== ===

This will create a section with no name, but with an edit link. If you make four or more of these links, you will create a TOC in the page. You can suppress this with:

__NOTOC__

Two: The neat but extensive solution:
Make your wiki semantic and use Semantic_Forms to edit the page using a form.


Not with the standard installation.

But, I'm sure you could write an extension to do this. Eg. Right click on the page and it will start editing there.


It is possible to add link to edit template, so you can make ugly hack and create separate templates/subpages for every single box.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜