I’ve got two quick questions for two different things I want to do:
#1: First thing is that I want my folders to be non-entities on my modx site (in other words, I want somebody when they type in
http://www.my-website.com/about/ for it to go to
http://www.my-website.com/about/index.html). So, I thought of created a unique template for folders called "For Folders" which included access to a snippet [[for_folders]] and then would output a php header() command to go to the index of the given folder. The problem I had though is that the variable I need to create the forward url is the url inputted into the web browser. I tried using a php
but that alas just gives me the true index.php page. The other thing I tried was using MODx’s [(site_url)] variable, but apparently this only outputs "
http://www.my-website.com/" -- and nothing else. Any ideas? This is a remarkably simple thing. Another route I took was rather than using a snippet (since I really don’t know how to input MODx variables into a snippet anyways), and use the meta http-equiv tag in the folder template to do something like this:
<meta http-equiv="Refresh" content="1; URL=[(site_url)][*alias*]/index.html"/>
But alas this only works for first-level folder roots, and it does client-side forwarding something that I didn’t really want to do.
#2: The other thing I wanted to do was to create a "this page last edited" value on the bottom of every page displayed on the site. So, what I did was put this in the html of the template:
[center]
This page was last edited on: [[lastedited]]
[/center]
The unfortunate thing that this did was produce a number which counts the number of seconds since Jan. 1st, 1970 until the time the document was published. Is there another MODx value that I can use to output the actual date, or do I need to write the php program to convert these seconds into an actual date through a snippet? If I need to write one, has one already been written?
Thanks,
-Andy