Difference between revisions of Template:Divbox/doc

Viceroy Sam (talk | contribs)
Viceroy Sam (talk | contribs)
Making new divbox styles: remove as to advanced for EM
Line 124: Line 124:
That is, choose your style and title as usual (or omit the title with two pipes), but instead of actual content, write "DUMMYCONTENT". Then, save the page and reopen it for editing. You'll see the box code in all its gory detail, and the placeholder DUMMYCONTENT, followed by the HTML division closing tag. Now, you may simply '''replace''' DUMMYCONTENT with '''your content''', save, and move on. Since almost anything may be placed within division tags, this should not break no matter what you do.
That is, choose your style and title as usual (or omit the title with two pipes), but instead of actual content, write "DUMMYCONTENT". Then, save the page and reopen it for editing. You'll see the box code in all its gory detail, and the placeholder DUMMYCONTENT, followed by the HTML division closing tag. Now, you may simply '''replace''' DUMMYCONTENT with '''your content''', save, and move on. Since almost anything may be placed within division tags, this should not break no matter what you do.


== Making new divbox styles ==
I'd rather hope you were able to find joy within the existing set of styles, but if not, you can create new ones. Follow these instructions to be sure your new style will "play nice" with {{[[template:divbox|divbox]]}}. Note that this requires some understanding of [[Cascading Style Sheets|CSS]].
# Experiment in a drawing program, such as [[GraphicConverter]] or [[Adobe Photoshop]], and decide what colors you want for your new box style. You need to find out the HTML color codes for each color.
# Open an existing box style template, such as {{[[template:divbox/style/red|divbox/style/red]]}}. Copy out the code.
# Create a new box style template page. It '''must''' be located in main Template namespace and '''must''' be named <code>Template:divbox/style/XXXXX</code>, where "XXXXX" is your new style name.
# Paste in the "borrowed" code and replace the color codes with your new, chosen colors. Save the new template.
# Return to ''this'' Talk page and add your new style to ''this'' documentation. Remember, a job's not over until the paperwork is done!
Note that you ''may'' even change the division box margins and paddings. '''This is not recommended.''' There are a couple of good reasons for specifying these values, and in these units. Most users who "roll their own" make choices with unintended consequences; {divbox} is meant to help you avoid these pitfalls.