Okay
  Public Ticket #296616
Removing the view larger button when image isn't available?
Closed

Comments

  • James started the conversation

    So, sometimes I don\'t have a larger image associated with a portfolio item... but the "View Larger" button still shows up, and when a user clicks it, it throws an error.  This isn\'t really very clean or user friendly and I\'d like to fix it.

    Is there a way to remove the button when there\'s not an image behind it? 

    Alternatively, is there a way to just remove the button all together from the child theme (so that I don\'t have to make a change after every update)?

    Thanks!

  •  8,454
    Tahir replied

    Hey!

    To remove the button from all of them, Add this into the Custom CSS box located in your Salient Options panel :

    body .portfolio-items .col .work-item .work-info a:first-child {
        display: none !important;
    }
    

    Thanks


    ThemeNectar Support Team 

  • Dale replied

    Hi - this is great for removing the first button - whether it is VIEW LARGER or VIEW VIDEO... unfortunately I'd love to keep the VIEW VIDEO button when I have a video but not show VIEW LARGER (default button) if I don't have a video. Is this possible?

    Also, can you help point me in the direction of where I can change the button text from 'MORE DETAILS' to 'CLIENT WEBSITE'?

    Thanks!

  •  8,454
    Tahir replied

    Hey Dale!

    Sure simply change the first-child to last-child :

    body .portfolio-items .col .work-item .work-info a:last-child {
        display: none !important;
    }

    To change the text you will have to edit it in php file : "Salient/nectar/tinymce/shortcode-processing.php" . 

    Thanks 


    ThemeNectar Support Team 

  • Dale replied

    Hi Tahir - thanks for this CSS snippet and the direction on where to change the button text.

    What I had meant in my question was whether it was possible to hide the first-child when there *isn't* a video embed for that project? Currently if there isn't a video embed, that first-child button becomes VIEW LARGER - which pops up a lightbox with the featured image in it. Ideally if I don't have a video embedded, I'd only like the last-child button (MORE DETAILS) but if I do have a video embedded, I would like both buttons WATCH VIDEO and MORE DETAILS.

    Sorry - hope this makes some sense :)

  •  8,454
    Tahir replied

    ok so you want to hide View Larger irrespective of what option is selected ?. If yes use this css selector :

    body .portfolio-items .col .work-item .work-info a[rel*="prettyPhoto"] {
        display: none !important;
    }
    

    Thanks 


    ThemeNectar Support Team 

  • Dale replied

    Sorry - this didn't work but I'm not sure I've explained myself clearly. I apologize.

    Currently on the portfolio, it overlays 2 buttons.

    Button 1: VIEW LARGER or WATCH VIDEO (depending whether there is a video embed code present - if there is no video embed code, then it shows VIEW LARGER with a link to the Featured Image)

    Button 2: MORE DETAILS

    I want to keep button 2 all the time (as I use external links) but ONLY want button 1 if there is a video present (WATCH VIDEO). If the project has no video, I don't want it to show VIEW LARGER.

    Sorry again for the confusion. Based on what I see, I'm not sure that it is possible to do this.

    Thanks!

  •  8,454
    Tahir replied

    Hey!

    Add this into the Custom CSS box located in your Salient Options panel :
    body .portfolio-items .col .work-item .work-info a[href*="jpg"] {
        display: none !important;
    }
    
    Thanks 


    ThemeNectar Support Team 

  • Dale replied

    Wow - worked perfectly!!! Thank you so much!