Custom Button on Slideshow

GK User
Mon Jul 15, 2013 4:15 pm
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.
User avatar
Gold Boarder

GK User
Mon Jul 15, 2013 4:37 pm
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
User avatar
Moderator

GK User
Mon Jul 15, 2013 4:47 pm
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


Hi Cyberek,

Thanks for the fast reply. Could you please right down the file name as well for me?

Thank you in advance.
User avatar
Gold Boarder

GK User
Mon Jul 15, 2013 8:19 pm
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.
User avatar
Moderator

GK User
Wed Jul 17, 2013 2:18 am
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.



Cyberek,

Thanks for getting back to me. I understand that you do not support customization.

I found in view.php a piece of code that controls the title:

Code: Select all
// 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);


I need to show the button just on the first slide and not the other ones. Could you please give a me a hint on how to accomplish this?

I'd really appreciate if you could help.

Thanks.
User avatar
Gold Boarder

GK User
Tue Jul 23, 2013 7:57 pm
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
User avatar
Moderator

GK User
Thu Jul 25, 2013 8:21 pm
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


Hi Cyberek. Thank you for your solution. I decided to go for financial business slideshow and wanted to implement your solution, but couldn't do so as I am not a developer. Could you please help? I just need to have another button on the first slide.

Thank you so much.
User avatar
Gold Boarder

GK User
Thu Jul 25, 2013 9:41 pm
Well, this code doesnt add another button - it makes each slide accessible via CSS.
User avatar
Moderator

GK User
Thu Jul 25, 2013 11:38 pm
Cyberek wrote:Well, this code doesnt add another button - it makes each slide accessible via CSS.

I understand. Is there any way you could help me out with this one as well?

Thank you in advance.
User avatar
Gold Boarder

GK User
Mon Jul 29, 2013 6:28 pm
Cyberek wrote:Well, this code doesnt add another button - it makes each slide accessible via CSS.

Hi Cyberek,

I hope you are doing well. Do you still consider helping me out?:)

I'd really appreciate if you could help me out to rewrite you solution based on financial bus. slideshow.

Thank you in advance.
User avatar
Gold Boarder

GK User
Mon Jul 29, 2013 9:38 pm
Ok, please create exact wireframe where this additional button should appear basing on Financial Business Template version of Image Show Pro GK4.
User avatar
Moderator

GK User
Tue Jul 30, 2013 5:16 am
Cyberek wrote:Ok, please create exact wireframe where this additional button should appear basing on Financial Business Template version of Image Show Pro GK4.

Cyberek,

Once again thanks for helping me out. I am not exactly sure what you mean by "wireframe," but here's the code we need to change:

Code: Select all
// 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"];   


Thank you in advance.
User avatar
Gold Boarder

GK User
Fri Aug 02, 2013 3:02 am
Cyberek wrote:Ok, please create exact wireframe where this additional button should appear basing on Financial Business Template version of Image Show Pro GK4.

Hi Cyberek,

Did you get a chance to look into this?

Thanks.
User avatar
Gold Boarder

GK User
Fri Aug 02, 2013 9:26 am
Wireframe is a screenshot or drawing of an element. You can put Your aditional button there, so I can see where exactly should it appear on working module.
User avatar
Moderator


cron