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

The stranger in Pain

I have just returned from Malaysia today. After a 3 months stay in Singapore, I could finally make it to Malaysia, Kuala Lampur. Just a small 3 days trip with my friends. On the second day of our trip, we had decided to visit the Genting Highlands. Early morning we started off for the adventurous trip, only three of us- Sree Lakshmi(my room mate in Singapore), Nishita(my co-scholar from SCMS-UG) and me. We boarded our bus to Genting. Sree and Nishi sat together and I sat alone, taking a window seat. After a while, an elderly uncle, Indian looking, of about the age of 60+, occupied the vacant seat next to mine.  He initiated the conversation by asking me which country I am from. After I answered that I was from India, he said he was from Sri Lanka. My thinking of him being an Indian was proven wrong. He was a very friendly man. After the initial ice breaking, we started speaking about ourselves and our lives. He told that he had finished conquering the entire globe with just some 4 co