I'm new with WonderCMS and try build my own theme.
Trying adding static blocks and follow this steps for wcms 3.0.0+
https://github.com/robiso/wondercms/wik ... ble-blocks
So adding a functions.php to my theme-folder.
After adding
Code: Select all
<?=sectionleft()?>
Next step remove
Code: Select all
<?=sectionleft()?>
Code: Select all
<?= $Wcms->block('sectionleft') ?>
Here is my functions.php:
Code: Select all
<?php
function sectionleft() {
global $Wcms;
// Check if the sectionleft area is already exists, if not, create it
if (empty($Wcms->get('blocks','sectionleft'))) {
$Wcms->set('blocks','sectionleft', 'content', 'Your content here.');
}
// Fetch the value of the sectionleft from database
$value = $Wcms->get('blocks','sectionleft','content');
// If value is empty, let's put something in it by default
if (empty($value)) {
$value = 'Empty content';
}
if ($Wcms->loggedIn) {
// If logged in, return block in editable mode
return $Wcms->block('sectionleft');
}
// If not logged in, return block in non-editable mode
return $value;
}
?>