Nationalism created rivalry and tension between European powers. Nationalism made European powers competitive with each other. Nationalism caused the war because of
a Serbian nationalist who assassinated Archduke Franz Ferdinand and his wife. This then caused Austria-Hungary to blame Serbia for the assassination, which Austria-Hungary used to justify their actions of settling the question of Slav nationalism once and for all. Serbia got support from Russia, Austria-Hungary had to delay their war until they got assurance that Germany would help them, this would then lead to the start of World War 1.
Nationalism was used in propaganda to help promote the war effort. Propaganda was made to justify the war and to try to recruit people into the armed forces. Propaganda was made first to appeal to one's honour, but then changed to shaming whoever wasn't enlisted in the war, which would probably make whoever wasn't in the war already want to enlist in it so they wouldn't be shamed. Another tactic they used to promote nationalism was iconic figures which might be real people that were mythologized and made into a hero or they used old myths or popular folklore to make an iconic figure. In conclusion the war happened because of nationalism, nationalism made the European powers want to prove that they had a better government and military strength than the other. Nationalism affected all the other causes of the war which made the war last as long as it did.