Howdy, when I hit preview in Modx using mamp it takes me back to the modx manager page what am I overlooking?
Thanks in advance for your time!
-
☆ A M B ☆
- 24,524 Posts
Hit preview from what? To the same what?
I figured it out... I was hitting preview to view the page in modx. I had the database set up wrong in phpadmin. Do have one other question my images wont show when viewing my template. The files in the css point to ..\images I have tried ..localhost\images and a few others to no avail.
-
☆ A M B ☆
- 24,524 Posts
If the images are being used as background images by your .css, then the URL to the images must be relative to the .css file’s actual physical location.
For example, say your .css file is in assets/templates/mytemplate/site.css. Now if you have this in your .css file
body{background:url(images/bkg.png) top left repeat-y;}
then the image must be in assets/templates/mytemplate/images/bkg.png.
If the .css file says ../images, then the image must reside in an images folder one step up from the css file. Say the .css file is in assets/templates/mytemplate/css/site.css, then the image would still be in assets/templates/mytemplate/images/bkg.png.
Thanks your for the explanation Susan but I still dont see my template images when I preview the page. The text obviously shows now, but if my files are in the /assets folder so for example css is in /assets/templates/*site*/styles and the images are in /assets/templates/*site*/images what would the path be in my template file? Right now it points to ..assets/templates/*site*/styles and its not referencing the file. Am I missing something like ../localhost or what is a default path when running locally though MAMP? Thanks for helping my noob self.
-
☆ A M B ☆
- 24,524 Posts
No, these should all be relative URLs. Are you talking about images displayed via <img... /> tags, or images used by the .css file as backgrounds for various elements?
If you’re talking about images loaded in the page with <img> tags, then the URL needs to be relative to your site’s main index.php file - assets/templates/templatename/images/image.jpg or perhaps assets/images/image.jpg. I try to keep my image files separated; those used by the template .css files go in assets/templates/templatename/images, while images loaded via <img> tags are in various subdirectories as needed for organization in assets/images.
As I explained before, if they are used by your .css file, then the URL it uses is relative to that .css file’s physical location.
The .. should be read as "go up one level from here", then the rest of the path is followed.