Robin S Posted March 17, 2022 Share Posted March 17, 2022 12 hours ago, CalleRosa40 said: I put the declarations into separate files for better overview (_init.php would get rather lengthy if I didn't) I'm surprised you have so many template variables to declare. You might like to take a look at Markup Regions because that should greatly reduce the number of variables you need to hold markup. 12 hours ago, CalleRosa40 said: Here's the the essential part of my _init.php (which is automatically prepended to all my template files): include_once('_func.php'); include_once('_header.php'); include_once('_sidebar.php'); include_once('_footer.php'); include_once('_buttons.php'); Does the below work? (P.S. parentheses are redundant for include, include_once, etc because they are expressions rather than functions) include_once './_func.php'; include './_header.php'; include './_sidebar.php'; include './_footer.php'; include './_buttons.php'; 2 Link to comment Share on other sites More sharing options...
bernhard Posted March 17, 2022 Share Posted March 17, 2022 11 minutes ago, Robin S said: P.S. parentheses are redundant for include, include_once, etc because they are expressions rather than functions Thanks for making me aware of something that I've done wrong for about 20 years ? 2 1 Link to comment Share on other sites More sharing options...
CalleRosa40 Posted March 21, 2022 Share Posted March 21, 2022 This works. Great. Thanks a lot, @Robin S! (But I still don't get why my content variables get dropped when the files holding them are pulled in with include_once ...) Link to comment Share on other sites More sharing options...
CalleRosa40 Posted March 21, 2022 Share Posted March 21, 2022 On 3/17/2022 at 10:28 PM, Robin S said: I'm surprised you have so many template variables to declare. You might like to take a look at Markup Regions because that should greatly reduce the number of variables you need to hold markup. It's not the number of variables that makes my code lengthy but rather the amount of (conditional) HTML I have to put inside them. Thanks anyway! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now