Skip to main content

Customizing your 'Citation template' for your WikiEditor


Anyone who has worked on the MediaWiki CMS, will probably know how difficult it is to handle this CMS at times. If you have ever edited Wikipedia pages (here I am referring mainly to the English Wikipedia i.e. http://en.wikipedia.org/), you will be aware of the 'Cite' option that you get at the right hand top corner of your editor. The 'citation' option is used for adding references in your document. You must be aware that when you create a new Wikipage on any Wikipedia, you need to add some relevant references against it. This is made very easy using the 'Cite' option. It gives the user, a template where the user can simply fill in some details to get the reference going, no need to worry about the tags (they are auto-generated).
This 'Cite' option which is present in the English Wikipedia is actually missing from most other Wikipedia(s). It is not at all an easy task to get the Citation option in place and working. You can read on how to get the 'Cite' option on the editor here.

Once you have the 'Cite' option in place, you might want to customize the template. If I want to get the 'Cite' option for my own language's Wikipedia, I will definitely want to have the template in my own language. To make such modifications, we have to work on a few JavaScript files like:
  • RefToolbarConfig.js
  • RefToolbarLegacy.js
  • RefToolbarMessages-en.js
The RefToolbar Messages-en.js file is responsible for the messages that are displayed in the template for the end user. If we want to customize our template in our own way, we need to first change the messages here. All messages here are hard coded, so we need to go into the code and simply change the strings. If we translate the strings to some other language, we will get the template ready for that language's Wikipedia or your own MediaWiki in that language.
Here I have given an example of how it can be done in Bengali.

Once we get the template customized, next we can go on to make a few changes in the remaining two files.
What I had done was a simple task. I had simply replaced the hard coded values in these files with variable names and assigned the variables some value. So, from next time, if some change needs to be done, we do not need to struggle through the entire piece of JavaScript, we can simply go ahead and make the changes in the variable's value. 


This way the citation template can be customized in our own required way.

Comments

Popular posts from this blog

Quarantining Alone - A Once in a Lifetime Opportunity

This Covid-19 virus has turned the entire world upside down. It has broken a lot of older habits and set a lot of new normals. Towards the early days of this lockdown, I had written a blog - An Extrovert in Isolation . The early lockdown days were extremely difficult for me. That was the phase of breaking old habits. An extrovert by nature, couldn't accept the sudden change of being locked alone inside my house. I am writing this blog again after being locked at home for more than 100 days now. Most of the older habits are broken by now. A few new habits have become a part of my new normal. What seemed to have been painful 100 days back has now turned to be blissful. Here, I am sharing my story of how quarantining alone has ended up being the greatest opportunity and a huge transformation in my life.  I have been struggling for years to fix my sleep patterns. Going to bed late and waking up late had been a habit for a really long time. My struggles to change this habit had...

RASCI model - the responsibility assignment matrix

In the last few days, both at my workplace as well as while dealing with a few activities around me, I have realized the importance of implementing a better responsibility assignment matrix, to get things done in a less messed up way. A few months back, during some random conversation, a friend of mine had introduced me to the RASCI model, one of the responsibility assignment matrices. Wikipedia says that the responsibility assignment matrix 'describes the participation by various roles in completing tasks or deliverables for a project or business process.'  In simple words, for any project, if we can divide each person's role and responsibility, it not only ensures a better end product, but also saves the time, otherwise lost in discussions (which organizations like to call as meetings). A RASCI implementation ensures that each person is responsible for only and only the task assigned to him (or her) and will not need to interfere with another person's task, un...

A lot can happen over coffee....only if you are allowed to sit at a CCD outlet!

Cafe Coffee Day is no more a new name for the youngsters in India. For a warm cup of coffee at an affordable price, thats where we generally go to! But more than the cup of coffee, its the atmosphere of Café Coffee Days which attracts all of us. An informal setup...good beverage and snacks...soothing music (most of the time)...complimentary wi-fi (at many outlets)...well, CCD always had a lot to offer its customers. Photo source - https://www.zomato.com/pune/cafe-coffee-day-2-koregaon-park For Siddhartha, coffee always used to be an experience to be offered...not just beans to be grown. I have had my job interview conducted at a CCD outlet. I have hosted and attended several community meetups at different CCD outlets across the country. I have even had my coffee dates at CCDs. Well, truely, a lot has happened in my life over coffee...at different CCD outlets. Once, Siddhartha himself had spent his new year's eve, serving customers at a Café Coffee Day (CCD) outlet near C...