• Document Up to Date
  • Updated On 4.2.2

Adding a Default Screenshot to a Project/Site

CrafterCMS uses a default path (YOUR_SANDBOX/.crafter/screenshots/default.png), to look for a default representative image of a project/site, as seen in the Projects screen:

*Projects screen with default screenshots*

Projects/sites without a default screenshot are displayed in the Projects screen with just the project name and a red background like below for the project named Ed:

*Projects screen with no default screenshot for project Ed*

To add or change the default screenshot of your project/site, there are two options:

  1. Directly accessing the sandbox folder to create the default file location and then committing it using git

    First, you’ll need to create the folder structure/path that CrafterCMS uses to check for a default screenshot, /host/path/to/projects/repos/sites/SITENAME/sandbox/.crafter/screenshots/, if it doesn’t exist yet. Next, you’ll need to add your default screenshot named default.png.

    After adding default.png under the directory structure you just created, you’ll need to add and commit your changes by using git so Studio is aware of the changes made. To commit your changes , head to /host/path/to/projects/repos/sites/SITENAME/sandbox to git add your default screenshot file, then commit your changes like below:

    cd /host/path/to/projects/repos/sites/SITENAME/sandbox/
    git add .crafter/screenshots/default.png
    git commit -m "<the commit’s description>"
    

    Refresh your browser and you should now be able to see the default image you just committed in the Projects screen.

  2. Pushing the project/site into a remote repository and create the default image file in remote, committing it, and then pulling it back to Studio, using Studio’s Git project tool.

    To push your project into a remote repository using Studio’s Git project tool, follow the instructions for adding a remote bare git repository in the Studio Administration section. Your project should now have a remote repository listed in the Remote Repository tab of the Git project tool screen. The next step is to push the project to the remote repository by clicking on the Push button (button with the up arrow) next to the remote repository. In the remote repository, create the file .crafter/screenshots/default.png and commit the change. Finally, back in Studio’s Git project tool, pull the changes in to Studio from the remote repository by clicking on the Pull button (button with the down arrow).

    Refresh your browser and you should now be able to see the default image you committed in the remote repository in the Projects screen.