Where does it save changes to default.php
Permalink
Hi C5 community, I'm a newbie at this, but loving how it works so far, and looking forward to getting my hands dirtier with this CMS.
The query I have is:
I have developed my theme, and discovered I would like to have an editable area with content already added on each page. I created the content area within my global scrapbook, then added that to my default.php page type through the Dashboard>Pages & Themes. This now gives me an area with content that I can edit if required, where the changes will be site-wide. :)
Q: Is all this information stored in the database, because looking at my 'default.php' via ftp shows no changes at all. Also, if I make a 'hard coded' html change to default.php and upload via ftp, will my Global Scrapbook change still be there?
Q: Is there a way to 'Hard Code' this sort of thing into my theme before uploading?
Thanks for your attention :)
The query I have is:
I have developed my theme, and discovered I would like to have an editable area with content already added on each page. I created the content area within my global scrapbook, then added that to my default.php page type through the Dashboard>Pages & Themes. This now gives me an area with content that I can edit if required, where the changes will be site-wide. :)
Q: Is all this information stored in the database, because looking at my 'default.php' via ftp shows no changes at all. Also, if I make a 'hard coded' html change to default.php and upload via ftp, will my Global Scrapbook change still be there?
Q: Is there a way to 'Hard Code' this sort of thing into my theme before uploading?
Thanks for your attention :)
Yes, all information about the content itself is stored in the database -- none of the files on your server will ever change as a result of people using the website to manage content (with the exception of the "files" directory, which is where uploaded images are saved to -- but you wouldn't have code in there so it's a moot point).
Depending on the change you make to your default.php file, the content may or may not still be there. As long as you leave the "Area" in your template with the same area name -- probably something like this:
(although may have a different area name than 'Main' depending on which area you added the default content to).
So if you leave that code in your default.php file, then the content will stay. If you remove that code, the content will disappear. Any other changes you make to the file are irrelevant to the display of that content (unless you did something silly like put a div around that area and made it invisible with CSS).
For your last question about if there's a way to "hard-code" this sort of thing into your theme before uploading: yes and no. There is a way to hard-code global scrapbook blocks, by adding the following code to your template file (e.g. default.php):
...but this achieves a slightly different purpose than using the "Page Defaults" as you did above, because doing it this "hard-coded" way means that the block will always be displayed in that spot on the template and the user will never be able to move it around. Whereas with Page Default content, those default blocks are put on the page when it's first created, but the user has the flexibility to move it around within the area or to remove it entirely.
So it's really a design decision about how much flexiblity you want to give to the people editing the site. I usually stick to "hard-coded" global scrapbook blocks myself, but you can only do that if you know exactly where that block should be on the page all the time and you don't want it to ever be removed from pages. It's ideal for site footers I've found, whereas it doesn't always work as well for sidebars because users often want to shuffle sidebar content around.
-Jordan