Skip to content
View in the app

A better way to browse. Learn more.

Young Composers Music Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Template troubles

Featured Replies

Ok, so I created a template called {{Box Skeleton}}, {{Box header}} and {{Box footer}}

What I am trying to do is create formatted boxes that encapsulate text like so:

{{Box header|title goes here}}

text here

{{Box footer}}

I tried to mimic wikipedia to no avail. You can check out how Wikipedia does it here though: Portal:Arts - Wikipedia, the free encyclopedia

I can get the Box header to work with the title, but I cannot get the text to be encapsulated in the box. Box header should have an open div, and Box footer should have a closing div to account for this, but it is not working for some reason. Does anyone know what to do?

I have absolutely no idea how to solve the problem (other than blindly messing around), but exactly how did you plan on implementing this on YC? What are you thinking of using it for?

  • Author

This is an easier way then using tables and formatting each table every time for each page. This way if we ever decide to change the skin, all we'd have to do is change the template instead of worrying about each page. I plan to use these box's on portals as well.

I hope someone can help me figure it out, we really should use div templates from now on.

Remind self: come up with featured templates for homepage. Remind self. Remind self. Remind self. Tomorrow. Remind... slaaeee...ff..... *sleep*

Crud... now I forget what I meant about coming up with templates for the homepage featured things...

Why is that one template called "chord"? I really don't see the significance of... well... chords. Anyways... you keep applying a width attribute to the div and it's been giving me problems because it forces a line break in the content where line breaks aren't specified. For instance, it would say

* Relative minor: B

minor

and when we include modes...

* Relative minor

mode: E mixolydian

Y

  • Author

I named it "chord" because eventually I would like to place more attributes of the scales in that nav box to the right. I specified a width because I want it to look like a fixed nav....does that make sense?

For example, clicking between the pages, the box layout will remain constant, which is essential for aesthetics when navigating between those pages. Of course, if you want to make the width a little larger.....you can. But the width must be fixed.

I just think it will become too problematic to find a perfect size that isn't too wide for some short-lined boxes and too small for long single lines. Empty space... vs. unwanted line breaks... plus an uncertainty for monitor/window sizes between users, a percentage will always be unpredictable, an em specification would be too exact and limiting. I think it should be variable. It doesn't affect aesthetics that much.

  • Author

I was thinking the Chord attributes menu could follow something like this:

Clarinet - Wikipedia, the free encyclopedia

Probably when it is all built, we can decide what width would be suitable then.

In fact, I just checked, [[Profile:Hillary Chesher]] made use of this kind of template. I bet we could use that template for chord attributes, instrument attributes, etc.

Guess what, your link is broken. Gives me all the more reason to hate the profiles namespace... it made chopin slip up. HA! HA! *points fingers*

Yeah, I can see how a sort of menu like this would be useful, but then people would call us Wikipedia copycats by doing the same thing as they are doing. Plus much of the information we provide doesn't really fit in this kind of templates... I don't think it'd be worth the effort.

  • Author

Ugh, haha.

Anyway, we can worry about it if the content grows I suppose. It would just make each page more useful, and easier to navigate. I wouldn't view it as copying Wikipedia, I would view it as utilizing the power of Mediawiki with the use of templates.

I was gone a while but... did you purposely move the "who is online" box so that it appears at the bottom of every article before the footer? Was it always there?

It really looks horrible there.

Is there any way you could make it the same width as the footer and stick it either on top of or below it so that it looks like an integrated element? I know you said before that it was already a pretty iffy piece of code but... wow. :huh:

*actually reads page*

I remember that template... I made it at Letehn's request. If you can't get the hang of it based on the code for the one on my profile, I can make you a different one. Problem is, you can't make any of the fields optional since this wiki for some reason doesn't parse (this has been brought up a few times... if you need me to be more specific, I'll find the thread. I think the user Misha was talking about it too) but if you're just doing the border, header and a block of text in the box you shouldn't have too many issues since both fields are essential....

Where the crap did you get this from?

That doesn't make for a very effective template since I doubt the average user could figure out how to do scraggy all with it :blink:

Okay, here:

{| class="infobox bordered" style="width: 100%; position: inherit; vertical-align: top; text-align: left; font-size: 95%;" cellspacing="0" cellpadding="3"
| style="text-align:center; background-color: tan;" | '''{{{boxtitle}}}'''
|- 
| style="text-align:left; background-color: #fff; border: solid  1px tan;" | {{{text}}}
|- 
|}

Does this look alright? http://wiki.youngcomposers.com/Template:Box_Skeleton

Yours also somehow managed to have the online user box inside of it. Also, what are the "box skeleton caption" and the one listed below it for exactly? They show up blank to me.

{{{title}}}
  • Author
I was gone a while but... did you purposely move the "who is online" box so that it appears at the bottom of every article before the footer? Was it always there?

I'll see what I can do.

Your template change looks nicer, but it broke the [[D major]] box to the right. I copied that code from a portal page in Wikipedia.

If you can't get the hang of it based on the code for the one on my profile, I can make you a different one.

I can get the hang of it, in fact, I would like to encourage its use on other pages.

Yours also somehow managed to have the online user box inside of it.

The way this works, is that the header creates an open div tag, and the footer closes the div tag, so when you preview it, you preview it with the open tag, including the online user box. This way, instead of always creating

tags in the wiki code and attaching css styles to it, use the appropriate template instead. This is better, because if I ever decide to change the skin, layout and/or colors of the wiki/site, a simple template change is much easier to do, than to go through the pages and editing styles. This is why I encourage the use of templates for most formatting.
Also, what are the "box skeleton caption" and the one listed below it for exactly? They show up blank to me.

These are important. It is for lilypond output captions. See [[D major]] for an example. So should you want a caption underneath lilypond output, do this:

{{Lilypond header}}

lilypond code here

{{Lilypond footer|caption here}}

Reference [[Help:List_of_Templates]]

REALLY nice work with the whosonline box. Really looks like it belongs there now. I would have expected to see it BELOW the category path, but I'm not going to complain about where it is now - it looks good. Now a day or so before you fixed it up, you made a change that started a problem that's still occurring for me. Maybe you're not getting it on your system. When I run my mouse over any of the users online, the box that pops up onmouseover comes in BEHIND the actual text I pointed my mouse over... maybe you can quick fix that little slip up.

  • Author

It's the only thing I could do so that the popup box would disappear when you "mouse off". If you find it annoying I could revert my changes, but you then risk moving your cursor out of the user box area, and the "where am I box" will stay on the page. For example, the ONLY way the popup box will disappear, is if the cursor glides over it first, which is why I placed the popup box by default, over the curser using css.

This is an easier way then using tables and formatting each table every time for each page. This way if we ever decide to change the skin, all we'd have to do is change the template instead of worrying about each page. I plan to use these box's on portals as well.

I hope someone can help me figure it out, we really should use div templates from now on.

That can be useful for creating various types of boxes. By using parameters one could customise various aspects rather easily (and provide defaults if not specified). You could easily cascade box prototypes into templates, etc....

Could I suggest, as far as the skin goes, to use CSS classes instead of inlining the style data into the wiki code and templates? (A guide to the available CSS styles for use in the wiki itself would, of course, be essential to editors. Perhaps also a suggestion thread for new CSS classes - of course, you'd want to keep only the minimum amount, and keep the classes as versatile as possible, so as not to bloat the stylesheets too much.) It'd make skin changeovers all the easier, and coding anything in the first place much more so and wquicker as well.

I recall helping James (Enigmus) on the Pronunciation page by formatting a simple table, and we had to go and manually pick out a colour scheme and input the CSS. It's inconvenient for editing and it creates problems for skin/colour scheme changes. Heck, you couldn't even offer a second optional theme/scheme since it's all hardcoded...

Oh, this wiki doesn't have parser functions (re: Hillary)? {{{#if}}} etc.? I'd call those essential for any kind of templating system that's functional beyond reusable static code... isn't it relatively trivial to install?

  • Author

Hmm, yeah it should be easy to install, it should be an extension. Is the extension called called "parser functions" do you think?

Extension:ParserFunctions - MediaWiki

Also, if you're ever curious about extensions installed on another wiki, access Special:Version, which should have version info and a list of all extensions. (e.g. Version - Wikipedia, the free encyclopedia ) I used this to install some of my favourite features of Wikipedia onto a wiki I was setting up for a friend's project.

  • 7 months later...

Didn't we get a template to mark the YcMusicArticles group? Or didn't we? Cuz i can't see it :huh: (forgive me, i'm stll trying to get back into things)

I made {{closed}} we could adapt and use that.

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.