[verb (dictionary form)] + ため(に) [noun] + の + ため(に) [verb (plain)] + ため(に) [i-adj] + ため(に) [na-adj] + な + ため(に) [verb (dictionary form)] + ための + [noun] [noun] + の + ための + [noun]
ために has two meanings. After a dictionary-form verb, or a noun with の, it gives a purpose: "in order to", "for the sake of". After a verb in the past, or an adjective, it gives a cause: "because of", "due to".
For a purpose, the verb is in the dictionary form and the same person does both halves: you do the second thing so that the first will happen. The second half is something done on purpose.
A past verb before ために never gives a purpose. If you see one, it is a cause.
ために needs a verb the subject can simply decide to do. A potential verb, or a change nobody controls (なる, わかる, みえる見える), takes ように instead, and so does a purpose where the two halves have different subjects.
For a cause, ために follows a verb in any plain form, an い-adjective, a な-adjective with な, or a noun with の. The result is something that happened, often a problem, and the two halves can have different subjects.
This use belongs to writing, news and announcements, which often drop the に: あめ雨のため, こうじ工事のため. In conversation, a reason takes から or ので.
A noun with のために can go either way, and the second half decides.
ため is a noun, so it can do more than join two clauses. Before another noun it takes の: "a … for …". At the end of a sentence with だ, it gives the reason for, or the purpose of, what came before.