Custom theme on local environment
Permalink
Hello all,
I'm new to concrete5, with some Drupal and Wordpress experience plus a hobbyist enthusiasm for HTML/CSS, PHP, MySQL, JS. I'm developing a new section for my organization's website, and because of its size and scope I'm trying to set up a local environment first. I've been in contact with our hosting partners and got the database export and public_html, complete with a custom theme they developed for us. These very same files work swimmingly on the official website, but in my local build, it reads as if there's no CSS whatsoever. I've looked through the theme files as closely as I can but I can't find anything.
We're on 5.5.2.1 and I'm doing this via MySQL (managed through phpMyAdmin) and Apache on a brand new iMac with El Capitan. My process for setting up the localhost, after a lot of failed attempts, was:
Setup an empty MySQL database
Download standard 5.5.2.1
Edit config/db.xml so that none of the default timestamps were "0000-00-00" but instead "1000-01-01" (it wouldn't work otherwise, as I'm sure some others have suffered through)
Install 5.5.2.1
Drop all the new tables and import all of the extracted org site tables
Merge the public_html folder into the root folder, favoring org site files where conflicts occurred
I have deleted all the themes, then re-installed the custom theme, and it still doesn't work.
TL;DR: Custom theme works on live hosted site, won't work on local test environment.
I'm new to concrete5, with some Drupal and Wordpress experience plus a hobbyist enthusiasm for HTML/CSS, PHP, MySQL, JS. I'm developing a new section for my organization's website, and because of its size and scope I'm trying to set up a local environment first. I've been in contact with our hosting partners and got the database export and public_html, complete with a custom theme they developed for us. These very same files work swimmingly on the official website, but in my local build, it reads as if there's no CSS whatsoever. I've looked through the theme files as closely as I can but I can't find anything.
We're on 5.5.2.1 and I'm doing this via MySQL (managed through phpMyAdmin) and Apache on a brand new iMac with El Capitan. My process for setting up the localhost, after a lot of failed attempts, was:
Setup an empty MySQL database
Download standard 5.5.2.1
Edit config/db.xml so that none of the default timestamps were "0000-00-00" but instead "1000-01-01" (it wouldn't work otherwise, as I'm sure some others have suffered through)
Install 5.5.2.1
Drop all the new tables and import all of the extracted org site tables
Merge the public_html folder into the root folder, favoring org site files where conflicts occurred
I have deleted all the themes, then re-installed the custom theme, and it still doesn't work.
TL;DR: Custom theme works on live hosted site, won't work on local test environment.
hutman,
thanks for your reply. my browser just ate a long reply, so I apologize if this new one is unclear. I created a new database and imported the public_html folder to my localhost folder (I'm assuming this is what you mean by "local instance"). I imported the SQL dump to the blank database and modified the site.php so that it was accessing that database.
When I went to localhost/public_html in my browser, it presented me with an error about '0000-00-00' being an improper default timestamp, a known issue in 5.5.2.1. I dropped all the tables from the database. Then I did a find and replace in the dumped SQL file to turn all instances of "0000-00-00" to "1000-01-01" which I saw in a github thread about the error. Then I imported the slightly edited SQL file back into the newly blank database.
This time when I went to localhost/public_html in my browser, it redirected me to "http://officialsite.com/public_html," which provided me with a c5 page does not exist error and a link Home to "http://officialsite.com." I commented out the BASE_URL line in site.php. That turned localhost/public_html into a theme-less version of the official site, the same problem that brought me here. Anything I try to to change the base URL to gives me a "too many redirects" error.
So, in many ways, I'm back to where I started. What do you recommend I do from here?
thanks for your reply. my browser just ate a long reply, so I apologize if this new one is unclear. I created a new database and imported the public_html folder to my localhost folder (I'm assuming this is what you mean by "local instance"). I imported the SQL dump to the blank database and modified the site.php so that it was accessing that database.
When I went to localhost/public_html in my browser, it presented me with an error about '0000-00-00' being an improper default timestamp, a known issue in 5.5.2.1. I dropped all the tables from the database. Then I did a find and replace in the dumped SQL file to turn all instances of "0000-00-00" to "1000-01-01" which I saw in a github thread about the error. Then I imported the slightly edited SQL file back into the newly blank database.
This time when I went to localhost/public_html in my browser, it redirected me to "http://officialsite.com/public_html," which provided me with a c5 page does not exist error and a link Home to "http://officialsite.com." I commented out the BASE_URL line in site.php. That turned localhost/public_html into a theme-less version of the official site, the same problem that brought me here. Anything I try to to change the base URL to gives me a "too many redirects" error.
So, in many ways, I'm back to where I started. What do you recommend I do from here?
Mabye you "destroy" the relative links to the Css files. Use chrome inspector (if you use broken link you get - red-warning and the wrong path). Or test live site folder structure (again ispect - and sources tab).
The CSS has nothing to do with Database preferences, tables or local vs server (its relative path from the root -- \css\myfile.css). The css handle only the view (C5 is mvc framework)
You can write in deafult.php
<span class="red">Hello world</span>
And link to:
myCss.css
.red{
color:red;
}
The CSS has nothing to do with Database preferences, tables or local vs server (its relative path from the root -- \css\myfile.css). The css handle only the view (C5 is mvc framework)
You can write in deafult.php
<span class="red">Hello world</span>
And link to:
myCss.css
.red{
color:red;
}
UPDATE: I figured it out. In the theme files, the standard head elements file had paths leading to localhost/themes instead of localhost/public_html/themes. Thanks for helping me grapple with this, siton and hutman
Have you checked the /config/site.php to see if it has hard coded URLs or Directory Paths and the correct database settings?