Nationalism was a major contributor to World War I. It led to the desire for independence among the different ethnic groups, who shared the belief that they could create a new society among themselves. Their desire for independence and ultimately their desire to stand out as individual helped to fuel the events that led up to World War I.
No, I don't think that nationalism was one of the main reasons of World War 1. The changing economies and technologies of the time had lots of empires there just itching to expand their horizons (and of course, their borders) so they took advantage of it. But nationalism wasn't part of it.
The main cause that kicked off the first world war were the countries in Europe that were world powers at the time, and began to argue with each other, which ended up leading the world into war. Nationalism did not have a large part in starting or ending the war.
No, I do not think that nationalism was one of the main causes and effects of World War I, because there is nothing wrong with being patriotic in and of itself. But it was also not one of the effects of World War I, because war has no effect other than to destroy.
I am not sure of nationalism's role in the first World War, but one thing is for sure, it can not be both the cause and effect of the war. While nationalism may have promoted tensions to escalate violence to that level it surely can't also be the lasting effect since that would essentially mean the war was ended before the problem was resolved.