An AnchorCMS theme for designers, artists, and dreamers.
anchor-install-path/themes/
Create site variables & custom fields
In the Extend section, select Custom Field. Create a new field with the following options:
Type: post
Field: image
Unique Key: thumbnail
Label: Your choice - I suggest article thumbnail 200x200
File types: .png, .gif, .jpg
Image max width: 200
Image max height: 200
fonts/
to brag-sheet/fonts
style.css
to /scss/partials/_icons.scss
class="icon-name"
on element in HTML or content: "\symbol-code"
in SASS. screen.scss
contains global imports & styles, which are written to screen.css
page-$name.scss
is the convention for page templates; e.g. page-about.css contains all styles for page-about.php
4 _variables.scss
contains style variables. Variable names usually describe styled element e.g. $comment-color, $comment-color-focus, $link, $link-hover.<main></main>
tags, which open in header.php and close in footer.php. posts.scss
& posts.php
control the blog roll, likewise article.scss
& article.php
control individual post views.page-portfolio.php
items require the following:
.portfolio-item
figcaption h2
& figcaption .fig-description
To correctly route the POST made on page-contact.php, copy add the following to the bottom of anchor/routes/site.php
- replace your@email.com with your own email address!:
// Necessary for form POST on page-contact.php
// http://forums.anchorcms.com/discussion/making-a-contact-form
Route::post('contact', function() {
$input = Input::get(array('contact-subject', 'contact-name', 'contact-email', 'contact-message'));
// Validator check...
$validator = new Validator($input);
$validator->check('contact-subject')
->is_max(1, "Subject is required!");
$validator->check('contact-name')
->is_max(2, "Name is required!");
$validator->check('contact-email')
->is_email("Email is required!");
$validator->check('contact-message')
->is_max(5, "Message is empty or too short!");
if($errors = $validator->errors()) {
Input::flash();
Notify::error($errors);
return Response::redirect('contact#error');
}
$me = "your@email.com"; // Your email address
$subject = $input['contact-subject'];
$message = $input['contact-message'];
$header = "From: " . $input['contact-email'] . " \r\n";
$header .= "Reply-To: " . $input['contact-email'] . " \r\n";
$header .= "Return-Path: " . $input['contact-email'] . "\r\n";
$header .= "X-Mailer: PHP \r\n";
if(mail($me, $subject, $message, $header)) {
Notify::success("Email sent!");
return Response::redirect('contact#sent');
} else {
Notify::error("Failed to send email!");
return Response::redirect('contact#failed');
}
});