Jump to content

Welcome, Guest!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

  • 0
Theo

Please help: BaseURL Question: Use $base_dir or $base_uri? + Image Path in CMS question

Question

Posted (edited)

Hi 

As I'll be moving the site from Local to Staging to Live, and do not want to use hardcoded static URLs for my links and images, I need to use some sort of baseURL (from what I can gather).

I've noticed that smarty has $base_dir, $base_dir_ssl and $base_uri?
As the different environments have different SSL setups (some with and some without), should I not just use base_uri?

What exactly is base_uri and can I use it as a good baseURL identifier that changes according to the domain the site is on?

Also, if the user adds an image to a CMS page on one environment (the normal way by using TinyMce and not a baseUrl 'enchancement'), does that path need to be updated again manually when the site is moved to another domain?

Edited by Theo

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

In smarty use $content_dir variable

Regarding CMS pages, or links in RTE in general -- I'm afraid there's not any easy solution here. There are no dynamic placeholders you can use here that would be automatically replaced during runtime. You can enter only static urls. Most people do this by using relative links like /en/blog/100-my-blog-page.html -- but that doesn't really work if your local installation is in subfolder. Alternative is to use relative urls like ../../blog/100-my-blog-page.html - this would survive even in subfolder, but it's just plain ugly

 

  • Thanks 1

Share this post


Link to post
Share on other sites
  • 0

Thanks for the feedback and variable, datakick...
Static URLs... it's like being back in the 90's... 😓

TB is a great eCommerce platform (like amazing) from what we can tell so far, but not so great in terms of CMS functionality (fairly dated and primitive CMS component and RTE - imo)...
Especially in terms of content maintenance and being compared to a platform like Joomla (with regards to CMS) oh... and Module Positions! (let's not even think of comparing the ease of creating new module positions and placing modules anywhere in Joomla vs TB)... {loadposition anymodulehere}. And no, Joomla sucks at being a vanilla eCommerce platform (without plugins like VirtueMart). Because it isn't one.. so no comparison there, but in terms of its CMS functionality... it's pretty advanced... It makes life easier for both the developer as well as the 'site runner' content person...

We were so focused on evaluating the eCommerce functionality of TB and making sure that the platform suited our needs, that we didn't think to consider the fact that the CMS component could be lacking...
Especially in terms of link and image maintenance. We just assumed (lol, my bad, ouch) that the CMS functionality would be on par and modern... 
If the site is ever moved to another domain... ah the pain... 🤨

Unfortunately static URLs won't do. I've been trying to work on a 'solution' / workaround that I will be sharing shortly if it works. But not ideal, no... 
I wonder if this magical problem affects the FileManager as well... ah sh*t it does... 😭

 

Edited by Theo

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...