OK Here’s a big update on what has been going wrong with my blog and how to fix it.
- My website (because it’s been up for ever) was using php 7.2
- php 8 needed to be enabled for my website by the web host. At that point the main blog page started to work but linked files were still not found.
- That turns out to be a path error problem that needs correction on my end. According to the tech I was speaking with, the path “was looking one folder to far” for the files. He edited the files on his end by removing one ../ and everything started working.
The original heading that does not work is below and looks like this:
require_once _DIR_ . ‘/../../../rw/elements/com.realmac.corepack/api/vendor/autoload.php’;
}
// Ensure the CMS helper functions are available
if (!function_exists(‘cms’)) {
require_once DIR . ‘/../../../rw/elements/com.realmac.corepack/api/cms.php’;
}
// Include centralized Twig setup
require_once DIR . ‘/../../../rw/elements/com.realmac.corepack/api/twig-setup.php’;
// Immediately Invoked Function Expression (IIFE) to encapsulate logic and avoid polluting global$
(function () {
// CMS Item Setup - Comprehensive logic for fetching item
$ECMS_Item_sourcePath = ‘../../../blog/cms/posts’ !== ‘’ ? ‘../../../blog/cms/posts’ : '../..$
$ECMS_Item_slug = null;
The edited version for the blog “post” file that does work looks like this:
require_once _DIR_ . ‘/../../rw/elements/com.realmac.corepack/api/vendor/autoload.php’;
}
// Ensure the CMS helper functions are available
if (!function_exists(‘cms’)) {
require_once DIR . ‘/../../rw/elements/com.realmac.corepack/api/cms.php’;
}
// Include centralized Twig setup
require_once DIR . ‘/../../rw/elements/com.realmac.corepack/api/twig-setup.php’;
// Immediately Invoked Function Expression (IIFE) to encapsulate logic and avoid polluting global$
(function () {
// CMS Item Setup - Comprehensive logic for fetching item
$ECMS_Item_sourcePath = ‘../../blog/cms/posts’ !== ‘’ ? ‘../../blog/cms/posts’ :
‘../../rw/elements/com.realmac.corepack/api/examples/content/blog’;
- My question to you is how do I set these paths up in Elements so it will continue to work after I upload new content?