| File | Folder Link |
|---|---|
| M - Testimonial.php | \\SYNAS\Allan\DOCUMENTATION\Module\Testimonial\rckuc\wolf\app\models |
| V - all files | \\SYNAS\Allan\DOCUMENTATION\Module\Testimonial\rckuc\wolf\app\views |
| C - TestimonialController.php | \\SYNAS\Allan\DOCUMENTATION\Module\Testimonial\rckuc\wolf\app\controllers |
| backend.php | \\SYNAS\Allan\DOCUMENTATION\Module\Testimonial\rckuc\wolf\app\layouts |
| style.css | \\SYNAS\Allan\DOCUMENTATION\Module\Testimonial\rckuc\wolf\admin\themes\black_and_white |
| default.css | \\SYNAS\Allan\DOCUMENTATION\Module\Testimonial\rckuc\public\themes\rckuc\css |
| testimonial.js | \\SYNAS\Allan\DOCUMENTATION\Module\Testimonial\rckuc\wolf\admin\javascripts |
|
wolf_testimonial.sql |
\\SYNAS\Allan\DOCUMENTATION\Module\Testimonial |
Update: backend.php
<head>
<link href="<?php echo URI_PUBLIC; ?>wolf/admin/themes/<?php echo Setting::get('theme'); ?>/switch_button.css" id="css_theme" media="screen" rel="Stylesheet" type="text/css" />
...
<script type="text/javascript" src="<?php echo URI_PUBLIC; ?>wolf/admin/javascripts/testimonial.js"></script>
</head>
<!-- Add 'Testimonial' Tab -->
<body id="body_<?php echo $ctrl.'_'.Dispatcher::getAction(); ?>">
<ul>
<li id="page-plugin" class="plugin"><a href="<?php echo get_url('testimonial'); ?>"<?php if ($ctrl=='testimonial') echo ' class="current"'; ?>><?php echo __('Testimonial'); ?></a></li>
</ul>
</body>
<head>
<link href="<?php echo URI_PUBLIC; ?>wolf/admin/themes/<?php echo Setting::get('theme'); ?>/switch_button.css" id="css_theme" media="screen" rel="Stylesheet" type="text/css" />
...
<script type="text/javascript" src="<?php echo URI_PUBLIC; ?>wolf/admin/javascripts/testimonial.js"></script>
</head>
<!-- Add 'Testimonial' Tab -->
<body id="body_<?php echo $ctrl.'_'.Dispatcher::getAction(); ?>">
<ul>
<li id="page-plugin" class="plugin"><a href="<?php echo get_url('testimonial'); ?>"<?php if ($ctrl=='testimonial') echo ' class="current"'; ?>><?php echo __('Testimonial'); ?></a></li>
</ul>
</body>
Update: style.css
/* Testimonial */
/* star ratin */
.rating {
position: relative;
height: 2rem;
width: 10rem;
margin-top: 0.5rem;
}
#gold-star-list,
#gray-star-list {
display: flex;
flex-wrap: nowrap;
height: 2rem;
position: absolute;
top: 0;
left: 0;
cursor: pointer;
}
#gold-star-list > img,
#gray-star-list > img {
height: 2rem;
}
/* Testimonial */
/* star ratin */
.rating {
position: relative;
height: 2rem;
width: 10rem;
margin-top: 0.5rem;
}
#gold-star-list,
#gray-star-list {
display: flex;
flex-wrap: nowrap;
height: 2rem;
position: absolute;
top: 0;
left: 0;
cursor: pointer;
}
#gold-star-list > img,
#gray-star-list > img {
height: 2rem;
}
Update: wolf\plugins\ckeditor -> index.php
To enable Ckeditor
Update: function ckeditor_filter_setup()
in $controllers add one more field for "|testimonial"
function ckeditor_filter_setup() {
$config_path = (USE_MOD_REWRITE) ? 'ckeditor/' : '../../?/wolf/plugins/ckeditor/';
$controllers = '(page|snippet|donate|story|volunteer|project|documentation|source_code|announcement|form_builder|portfolio|testimonial|client|portfolio_section|portfolio_highlight)';
$actions = '(add|edit|create|view|table)';
$pattern = '/^'.ADMIN_DIR.'\/'.$controllers.'\/'.$actions.'/';
if (preg_match($pattern, CURRENT_URI)) {
Plugin::addJavascript('ckeditor', 'scripts/ckeditor/ckeditor.js');
Plugin::addJavascript('ckeditor', 'scripts/init.js');
/* nasty way of including scripts */
Plugin::$javascripts[] = $config_path.'ckeditor_config.js';
// load it AFTER ckeditor_config!
// Plugin::addJavascript('ckeditor', 'scripts/user/config.js');
}
}
function ckeditor_filter_setup() {
$config_path = (USE_MOD_REWRITE) ? 'ckeditor/' : '../../?/wolf/plugins/ckeditor/';
$controllers = '(page|snippet|donate|story|volunteer|project|documentation|source_code|announcement|form_builder|portfolio|testimonial|client|portfolio_section|portfolio_highlight)';
$actions = '(add|edit|create|view|table)';
$pattern = '/^'.ADMIN_DIR.'\/'.$controllers.'\/'.$actions.'/';
if (preg_match($pattern, CURRENT_URI)) {
Plugin::addJavascript('ckeditor', 'scripts/ckeditor/ckeditor.js');
Plugin::addJavascript('ckeditor', 'scripts/init.js');
/* nasty way of including scripts */
Plugin::$javascripts[] = $config_path.'ckeditor_config.js';
// load it AFTER ckeditor_config!
// Plugin::addJavascript('ckeditor', 'scripts/user/config.js');
}
}
Add New Snippet: featured-testimonial
<?php $testimonials = Testimonial::findAllFeatured(); ?>
<?php foreach ($testimonials as $testimonial) :
$client = Client::findById($testimonial->client_id);
?>
<div class="tt-container">
<div class="detail">
<div>
<div class="quote">“</div>
<div><?php echo $testimonial->testimonial; ?></div>
</div>
<div class="rating">
<div id="gray-star-list">
<img src="<?php echo URL_PUBLIC ?>public/themes/rckuc/images/gray-star.png" alt="gray-star" />
<img src="<?php echo URL_PUBLIC ?>public/themes/rckuc/images/gray-star.png" alt="gray-star" />
<img src="<?php echo URL_PUBLIC ?>public/themes/rckuc/images/gray-star.png" alt="gray-star" />
<img src="<?php echo URL_PUBLIC ?>public/themes/rckuc/images/gray-star.png" alt="gray-star" />
<img src="<?php echo URL_PUBLIC ?>public/themes/rckuc/images/gray-star.png" alt="gray-star" />
</div>
<div id="gold-star-list" style="width :<?php echo $testimonial->rating * 20 . '%'; ?>">
<img src="<?php echo URL_PUBLIC ?>public/themes/rckuc/images/gold-star.png" alt="gold-star" />
<img src="<?php echo URL_PUBLIC ?>public/themes/rckuc/images/gold-star.png" alt="gold-star" />
<img src="<?php echo URL_PUBLIC ?>public/themes/rckuc/images/gold-star.png" alt="gold-star" />
<img src="<?php echo URL_PUBLIC ?>public/themes/rckuc/images/gold-star.png" alt="gold-star" />
<img src="<?php echo URL_PUBLIC ?>public/themes/rckuc/images/gold-star.png" alt="gold-star" />
</div>
</div>
</div>
<div class="tt-user">
<div class="client-photo">
<img src="<?= URL_PUBLIC.'public/testimonial/image/'.$testimonial->id.'/'.$testimonial->image ?>">
</div>
<div>
<p class="tt-name"><?php echo $testimonial->name . ' - ' . $testimonial->position; ?></p>
<i><?php echo $client->name; ?></i>
</div>
</div>
</div>
<?php endforeach; ?>
<?php $testimonials = Testimonial::findAllFeatured(); ?>
<?php foreach ($testimonials as $testimonial) :
$client = Client::findById($testimonial->client_id);
?>
<div class="tt-container">
<div class="detail">
<div>
<div class="quote">“</div>
<div><?php echo $testimonial->testimonial; ?></div>
</div>
<div class="rating">
<div id="gray-star-list">
<img src="<?php echo URL_PUBLIC ?>public/themes/rckuc/images/gray-star.png" alt="gray-star" />
<img src="<?php echo URL_PUBLIC ?>public/themes/rckuc/images/gray-star.png" alt="gray-star" />
<img src="<?php echo URL_PUBLIC ?>public/themes/rckuc/images/gray-star.png" alt="gray-star" />
<img src="<?php echo URL_PUBLIC ?>public/themes/rckuc/images/gray-star.png" alt="gray-star" />
<img src="<?php echo URL_PUBLIC ?>public/themes/rckuc/images/gray-star.png" alt="gray-star" />
</div>
<div id="gold-star-list" style="width :<?php echo $testimonial->rating * 20 . '%'; ?>">
<img src="<?php echo URL_PUBLIC ?>public/themes/rckuc/images/gold-star.png" alt="gold-star" />
<img src="<?php echo URL_PUBLIC ?>public/themes/rckuc/images/gold-star.png" alt="gold-star" />
<img src="<?php echo URL_PUBLIC ?>public/themes/rckuc/images/gold-star.png" alt="gold-star" />
<img src="<?php echo URL_PUBLIC ?>public/themes/rckuc/images/gold-star.png" alt="gold-star" />
<img src="<?php echo URL_PUBLIC ?>public/themes/rckuc/images/gold-star.png" alt="gold-star" />
</div>
</div>
</div>
<div class="tt-user">
<div class="client-photo">
<img src="<?= URL_PUBLIC.'public/testimonial/image/'.$testimonial->id.'/'.$testimonial->image ?>">
</div>
<div>
<p class="tt-name"><?php echo $testimonial->name . ' - ' . $testimonial->position; ?></p>
<i><?php echo $client->name; ?></i>
</div>
</div>
</div>
<?php endforeach; ?>
Update: default.css
Specially design for Ilead's website
#pf-testimonial {
background-color: var(--color-blue);
}
#pf-testimonial > .wrapper {
padding-bottom: var(--wrapper-padding-bottom);
}
#pf-testimonial > .wrapper > p {
color: white;
}
#pf-testimonial .tt-container {
display: flex;
flex-direction: column;
align-items: center;
gap: 2rem;
box-sizing: border-box;
}
#pf-testimonial .tt-container .detail {
display: flex;
flex-direction: column;
align-items: center;
gap: 2rem;
}
#pf-testimonial .tt-container .detail > div:first-child {
color: white;
font-size: 20px;
display: flex;
align-items: flex-start;
gap: 1rem;
text-align: center;
}
#pf-testimonial .tt-container .detail div.quote {
color: var(--color-pink);
font-size: 10rem;
line-height: 8rem;
height: 2rem;
font-family: Georgia, "Times New Roman", serif;
}
#pf-testimonial .tt-container .rating {
position: relative;
height: 2rem;
width: 10rem;
}
#pf-testimonial .tt-container #gold-star-list,
#pf-testimonial .tt-container #gray-star-list {
display: flex;
flex-wrap: nowrap;
height: 2rem;
position: absolute;
top: 0;
left: 0;
}
#pf-testimonial .tt-container #gold-star-list > img,
#pf-testimonial .tt-container #gray-star-list > img {
height: 2rem;
}
#pf-testimonial .tt-container #gold-star-list {
width: 0;
overflow: hidden;
}
#pf-testimonial .tt-container .tt-user {
display: flex;
gap: 2rem;
align-items: center;
justify-content: center;
}
#pf-testimonial .tt-container .client-photo {
width: 10rem;
}
#pf-testimonial .tt-container .client-photo > img {
width: 100%;
border-radius: 50%;
}
#pf-testimonial .tt-container .tt-user > div:nth-child(2) {
color: white;
font-size: 16px;
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
}
#pf-testimonial .tt-container .tt-name {
color: var(--color-pink);
font-size: 1.2rem;
font-weight: bold;
text-align: center;
}
@media only screen and (max-width: 768px) {
#pf-testimonial .tt-container .detail div.quote {
font-size: 6rem;
line-height: 5rem;
}
#pf-testimonial .tt-container .tt-user {
gap: 0.5rem;
justify-content: space-between;
}
#pf-testimonial .tt-container .client-photo {
width: 6rem;
}
#pf-testimonial .tt-container .tt-name {
font-size: 0.9rem;
}
#pf-testimonial .tt-container .tt-user > div:nth-child(2) {
font-size: 0.75rem;
}
}
#pf-testimonial {
background-color: var(--color-blue);
}
#pf-testimonial > .wrapper {
padding-bottom: var(--wrapper-padding-bottom);
}
#pf-testimonial > .wrapper > p {
color: white;
}
#pf-testimonial .tt-container {
display: flex;
flex-direction: column;
align-items: center;
gap: 2rem;
box-sizing: border-box;
}
#pf-testimonial .tt-container .detail {
display: flex;
flex-direction: column;
align-items: center;
gap: 2rem;
}
#pf-testimonial .tt-container .detail > div:first-child {
color: white;
font-size: 20px;
display: flex;
align-items: flex-start;
gap: 1rem;
text-align: center;
}
#pf-testimonial .tt-container .detail div.quote {
color: var(--color-pink);
font-size: 10rem;
line-height: 8rem;
height: 2rem;
font-family: Georgia, "Times New Roman", serif;
}
#pf-testimonial .tt-container .rating {
position: relative;
height: 2rem;
width: 10rem;
}
#pf-testimonial .tt-container #gold-star-list,
#pf-testimonial .tt-container #gray-star-list {
display: flex;
flex-wrap: nowrap;
height: 2rem;
position: absolute;
top: 0;
left: 0;
}
#pf-testimonial .tt-container #gold-star-list > img,
#pf-testimonial .tt-container #gray-star-list > img {
height: 2rem;
}
#pf-testimonial .tt-container #gold-star-list {
width: 0;
overflow: hidden;
}
#pf-testimonial .tt-container .tt-user {
display: flex;
gap: 2rem;
align-items: center;
justify-content: center;
}
#pf-testimonial .tt-container .client-photo {
width: 10rem;
}
#pf-testimonial .tt-container .client-photo > img {
width: 100%;
border-radius: 50%;
}
#pf-testimonial .tt-container .tt-user > div:nth-child(2) {
color: white;
font-size: 16px;
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
}
#pf-testimonial .tt-container .tt-name {
color: var(--color-pink);
font-size: 1.2rem;
font-weight: bold;
text-align: center;
}
@media only screen and (max-width: 768px) {
#pf-testimonial .tt-container .detail div.quote {
font-size: 6rem;
line-height: 5rem;
}
#pf-testimonial .tt-container .tt-user {
gap: 0.5rem;
justify-content: space-between;
}
#pf-testimonial .tt-container .client-photo {
width: 6rem;
}
#pf-testimonial .tt-container .tt-name {
font-size: 0.9rem;
}
#pf-testimonial .tt-container .tt-user > div:nth-child(2) {
font-size: 0.75rem;
}
}
Copy all related files to your project and import sql table