Dear Gavick,
Could you please help me to add buttons to the slideshow? I need to replace the slide title with the "Read More" button and another button with external link.
Thank you in advance.
Cyberek wrote:Edit slideshow module, and in slide's field named url enter:
[Button text]http://mydomain.com
to create button labelled Button text linking to mydomain.com
Cyberek wrote:Oh, sorry - I was 100% sure You was writing about creativity template .
But even with eSport:
1. login into administrator
2. go to extensions -> module manager
3. edit module named slideshow
4. select your slides on the right and edit slides title and link
after changing entire image becomes a link.
Adding a secondary link would require to rewrite of the module, and that is a customization that we do not support.
// creating slide title
$title = htmlspecialchars(($this->config['image_show_data'][$i]->type == "text") ? $this->config['image_show_data'][$i]->name : $this->articles[$this->config['image_show_data'][$i]->art_id]["title"]);
// creating slide link
$link = ($this->config['image_show_data'][$i]->type == "text") ? $this->config['image_show_data'][$i]->url : $this->articles[$this->config['image_show_data'][$i]->art_id]["link"];
$link = str_replace('&', '&', $link);
// parsing custom texts
$link_match_text = array();
if(preg_match('@^\[(.*?)\]@mis', $link, $link_match_text) == 1) {
$link = preg_replace('@^\[.*?\]@mis', '', $link);
$link_text = $link_match_text[1];
} else {
$link_text = JText::_('MOD_IMAGE_SHOW_CREATIVITY_READMORE');
}
// slide iterator
$num = 0;
?>
<div
class="gkIsSlide figure slide<?php echo ++$num; ?>"
<?php if(preg_match('@^#[0-9a-fA-F]{3,6}$@mi', $path) == 0) : ?>
style="background-image: url('<?php echo $path; ?>');"
<?php else : ?>
style="background-color: <?php echo $path; ?>;"
<?php endif; ?>
data-link="<?php echo $link; ?>"
>
<div class="figcaption slide<?php echo $num; ?>">
<div>
<h2 data-anim="<?php echo $title_anim; ?>"><?php echo $title; ?></h2>
<h1 data-anim="<?php echo $content_anim; ?>"><?php echo $content; ?></h1>
</div>
<a href="<?php echo $link; ?>" class="gkLearnMore" data-anim="slidedownbtn"><?php echo $link_text; ?></a>
</div>
</div>
Cyberek wrote:You were close, let me propose You another solution. In same view file modify the code to get:
- Code: Select all
// parsing custom texts
$link_match_text = array();
if(preg_match('@^\[(.*?)\]@mis', $link, $link_match_text) == 1) {
$link = preg_replace('@^\[.*?\]@mis', '', $link);
$link_text = $link_match_text[1];
} else {
$link_text = JText::_('MOD_IMAGE_SHOW_CREATIVITY_READMORE');
}
// slide iterator
$num = 0;
?>
<div
class="gkIsSlide figure slide<?php echo ++$num; ?>"
<?php if(preg_match('@^#[0-9a-fA-F]{3,6}$@mi', $path) == 0) : ?>
style="background-image: url('<?php echo $path; ?>');"
<?php else : ?>
style="background-color: <?php echo $path; ?>;"
<?php endif; ?>
data-link="<?php echo $link; ?>"
>
<div class="figcaption slide<?php echo $num; ?>">
<div>
<h2 data-anim="<?php echo $title_anim; ?>"><?php echo $title; ?></h2>
<h1 data-anim="<?php echo $content_anim; ?>"><?php echo $content; ?></h1>
</div>
<a href="<?php echo $link; ?>" class="gkLearnMore" data-anim="slidedownbtn"><?php echo $link_text; ?></a>
</div>
</div>
(i have attached patched file also if it will help).
This way each slide has fixed class 'slide$' and it can be used with css to show or hide some of the elements.
Hope this solution helped.view.php.zip
Cyberek wrote:Well, this code doesnt add another button - it makes each slide accessible via CSS.
Cyberek wrote:Well, this code doesnt add another button - it makes each slide accessible via CSS.
Cyberek wrote:Ok, please create exact wireframe where this additional button should appear basing on Financial Business Template version of Image Show Pro GK4.
// creating slide title
$title = htmlspecialchars(($this->config['image_show_data'][$i]->type == "text") ? $this->config['image_show_data'][$i]->name : $this->articles[$this->config['image_show_data'][$i]->art_id]["title"]);
// creating slide link
$link = ($this->config['image_show_data'][$i]->type == "text") ? $this->config['image_show_data'][$i]->url : $this->articles[$this->config['image_show_data'][$i]->art_id]["link"];
Cyberek wrote:Ok, please create exact wireframe where this additional button should appear basing on Financial Business Template version of Image Show Pro GK4.