Help:Custom Edittools: Difference between revisions

Jump to navigation Jump to search
Want an adless experience? Log in or Create an account.
No edit summary
m (Text replacement - "{{CURRENTUSER}}" to "{{#username:}}")
 
Line 1: Line 1:
If there's a complex bit of code that you find yourself copy/pasting a lot, or if you're trying to establish or conform to a consistent format, '''Custom Edittools''' allow you to insert prepared content with one click.  This is done through an additional "<u>'''Custom'''</u>" section at the bottom of the Edittools box below the edit window.  On some pages, such as Categories and Interviews, a "<u>'''Special'''</u>" section will appear at the top for commonly used code relating to those pages.
If there's a complex bit of code that you find yourself copy/pasting a lot, or if you're trying to establish or conform to a consistent format, '''Custom Edittools''' allow you to insert prepared content with one click.  This is done through an additional "<u>'''Custom'''</u>" section at the bottom of the Edittools box below the edit window.  On some pages, such as Categories and Interviews, a "<u>'''Special'''</u>" section will appear at the top for commonly used code relating to those pages.


==User:{{CURRENTUSER}}/Edittools==
==User:{{#username:}}/Edittools==
The Custom section of the Edittools includes whatever you have on your [[User:{{CURRENTUSER}}/Edittools]] page.  It will not include anyone else's page, your page will not be included for anyone else.  This is for your own personal use.
The Custom section of the Edittools includes whatever you have on your [[User:{{#username:}}/Edittools]] page.  It will not include anyone else's page, your page will not be included for anyone else.  This is for your own personal use.


'''How to construct your Edittools page:'''
'''How to construct your Edittools page:'''
Line 22: Line 22:
You can include as many of these as you want on your Edittools page, each within its own set of charinsert tags, separated by spaces.  Now, every time you edit a page, you can simply scroll down to the Custom Edittools and click on the text you want to add, and it will be inserted where your cursor is in the editing window.
You can include as many of these as you want on your Edittools page, each within its own set of charinsert tags, separated by spaces.  Now, every time you edit a page, you can simply scroll down to the Custom Edittools and click on the text you want to add, and it will be inserted where your cursor is in the editing window.


==User:{{CURRENTUSER}}/Macro==
==User:{{#username:}}/Macro==
One downside to Custom Edittools is that the entirety of the code or text appears in the Edittools, which can be cluttered and confusing.  In some cases it might be appropriate to add another layer to simplify the inclusion.
One downside to Custom Edittools is that the entirety of the code or text appears in the Edittools, which can be cluttered and confusing.  In some cases it might be appropriate to add another layer to simplify the inclusion.


===Macro===
===Macro===
To start, create the [[User:{{CURRENTUSER}}/Macro]] page.  Add whatever you want to be accessible through the Edittools, and this time surround it with "section" tags.  Place "'''<nowiki><section begin="id" /></nowiki>'''" at the beginning, and "'''<nowiki><section end="id" /></nowiki>'''" at the end, replacing '''id''' with a useful unique identifier to refer to that section.  For example:
To start, create the [[User:{{#username:}}/Macro]] page.  Add whatever you want to be accessible through the Edittools, and this time surround it with "section" tags.  Place "'''<nowiki><section begin="id" /></nowiki>'''" at the beginning, and "'''<nowiki><section end="id" /></nowiki>'''" at the end, replacing '''id''' with a useful unique identifier to refer to that section.  For example:
<pre><nowiki><section begin="Lipsum" />Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam et nulla orci. Duis ac viverra metus. Mauris quis lorem leo. Quisque odio leo, tristique at mollis sed, tempus sed arcu.<section end="Lipsum" /></nowiki></pre>
<pre><nowiki><section begin="Lipsum" />Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam et nulla orci. Duis ac viverra metus. Mauris quis lorem leo. Quisque odio leo, tristique at mollis sed, tempus sed arcu.<section end="Lipsum" /></nowiki></pre>


Line 32: Line 32:


===Edittools===
===Edittools===
Now, back to your [[User:{{CURRENTUSER}}/Edittools]] page, you need to transclude the sections from your Macro page.  The code for the example above would be:
Now, back to your [[User:{{#username:}}/Edittools]] page, you need to transclude the sections from your Macro page.  The code for the example above would be:
<pre><nowiki><charinsert>{{subst:#lst:User:Fi/Macro|Lipsum}}</charinsert></nowiki></pre>
<pre><nowiki><charinsert>{{subst:#lst:User:Fi/Macro|Lipsum}}</charinsert></nowiki></pre>
Replace "Fi" with "{{CURRENTUSER}}" and "Lipsum" with the id you defined on the Macro page.
Replace "Fi" with "{{#username:}}" and "Lipsum" with the id you defined on the Macro page.


This won't insert the text into the editing window, but it will add the code to ''substitute'' it into the article.  If you need to add to the inserted text, you'll have to save your work and start another edit.  It's not recommended to include templates that need to be filled out this way, as the extra edit(s) it requires clogs up the Recent Edits.  And is making two edits really more convenient than having a jumble of text at the bottom of the Edittools?
This won't insert the text into the editing window, but it will add the code to ''substitute'' it into the article.  If you need to add to the inserted text, you'll have to save your work and start another edit.  It's not recommended to include templates that need to be filled out this way, as the extra edit(s) it requires clogs up the Recent Edits.  And is making two edits really more convenient than having a jumble of text at the bottom of the Edittools?