Can I use multiple if statement in with with same validation?
What's jumping out at me is this line:

elseif page.footer_first or page.footer_first or footer_third


It's checking page.footer_first twice, and footer_third, which based on the code you've shown is not a valid variable, it should be page.footer_third. I'm guessing this should be more like:

elseif page.footer_first or page.footer_second or page.footer_third