You are not logged in.
Pages: 1
Hello,
I've recently inherited a BigTree site form one of our new clients and having some trouble when updating from 4.2 to 4.4.7 with images. Specifically something going on with the {staticroot} prefix that's in the database, is no longer replaced by the correct image path. Is anyone able to shed some light here? Any tips appreciated
Here are examples of the image paths as they come through on the frontend / admin areas:
<img class="slide-img" src="{staticroot}files/callouts/crop_screenshot-2019-11-11-at-204238.png" alt="">
Many thanks
Offline
I don't believe there were any changes between 4.2 and 4.4 with how translation of staticroot functions but I could be wrong. Is $bigtree["config"]["static_root"] set in your environment.php file properly?
Offline
Hey timbuckingham,
Thanks for the reply! We have the below definition:
$bigtree["config"]["static_root"] = "/";
Note the database has the following string '{staticroot}' without the underscore, Im new to big tree so not sure if that's the norm. Are you able to give a brief description of how it works if you know? E.g the expected result is '{staticroot}' is replaced with $bigtree["config"]["static_root"] - currently learning the tools and patterns in BigTree and any info helps. And if by chance you know if there was a major update at some point for the static_root - I can look at those change logs to help us diagnose.
Thanks for the help
Offline
{staticroot} is the correct token to be stored in the database. There's a method of BigTreeCMS that replaces tokens ({wwwroot} {staticroot} and their variants for multi-domain setups) with the actual config value: https://www.bigtreecms.org/developers/c … ativeRoots
I usually have static_root set to the full domain path but in theory "/" should work fine as well. If the data is coming out of the database directly through a SQL query and isn't being run through a BigTreeModule method (e.g. "get", "getMatching", etc) then it's not going to have tokens decoded. You'll need to run BigTree::untranslateArray on the database record to get internal page links and tokens properly decoded for display.
Offline
Pages: 1