Contents |
How to convert a page
- The first part is changing the header. How the two sites do the header is a bit different, so you'll have to make some changes. In the new site, after in include_once('header.php'), you have to call print_header($html_title, $body_title) to print the page header. $html_title is the title that will appear in the title bar, and $body_title is the one that will appear on the page. If you leave $body_title blank, it defaults to $html_title (this is the right behavior for most cases.
- print_header prints everything from the opening <html> tag until the point where you can start putting page content (so all the navbars, sidebars, page title, etc are printed). This is different from the old donut site- so you will have to rip out all of the html that the old donut site has in these locations. See Bagel_header_example for an example.
- Then you have to change the old tables-based layout to a new css one with appropriate changes. There aren't any hard-and-fast rules for this- use your best judgment.
SVN
- The branch for the code we're working on is at file:///var/svn/bagel/branches/bagel-2007/trunk . The old donut code is at file:///var/svn/bagel/trunk
- If you run `svn checkout file:///var/svn/bagel/branches/bagel-2007/trunk bagel` in your home directory, you will able to access it at bagel.caltech.edu/~yourname
- After you've made changes, you can commit stuff by running 'svn commit' in the directory where you have changes. It will prompt you for a message- you will be editing it in vi. Save the file and quit vi for the commit to proceed.
- You can update your copy so that changes other people made take affect by running 'svn update'. This will also wipe out any changes you have made.
- Merging different changes- I haven't ever had to do this, I'll put stuff here when I do.
Setting up the site
The below section is no longer necessary- there is code in header.php that will auto-detect this if it is not set.
After you check a copy of the code out (see above), you need to edit some stuff to make it work. Right now, you just need to edit lib/config.php and change $config_path['root'] to have your username in it instead of mine (jdhutchin). After you do that, you can see it at http://bagel.caltech.edu/~your_username/
Other Server Items
Sometimes it is useful to have multiple copies of the bagel code being served, or maybe you want to have a clean directory to work on something else. Put things in bagel-string/data/ (you may use bagel-string/lib/ for includes) and it will be served at http://bagel.caltech.edu/~username-string/. Contact (htam) if you have trouble with this one.
Back to Bagel Development