Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

Click to image Enlarge / Open in New Page*

stevejwinstevejwin New
edited January 2014 in Vanilla 2.0 - 2.8

We use a ton of images in my forum and I was wondering how to make these uploads clickable. I dug through the code a fairly decent amount but having a very hard time trying to figure out where to put the link, exactly. Any suggestions / guidance? Thank you!

Comments

  • Options

    There was an error rendering this rich post.

  • Options

    Thanks that was not quite what I was looking for. Basically I just need to hyperlink to the image ex fancybox or anything like that. Appreciate it though.

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited January 2014

    You can add the fancybox class or make them open in a new window. the images that are uploaded are linked via the thumbnail.

    $(document).ready(function() {
    //this will open in a new window
    $(".Attachment a").attr("target", '_blank');
    //this adds the class fancybox to the image link when the thumbnail is clicked fancybox opens image 
    $( ".Attachment a" ).addClass( "fancybox" );
    

    http://api.jquery.com/addclass/

  • Options

    I apologize here for all the fancybox talk but I did not put that in the title of this discussion - no idea how that got there. Click - open the image in a separate page would be fine. Regardless I appreciate the help. Thank you.

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited January 2014

    ok then simply use the one to open in a new window. You would add this to your default.master.php or tpl

    <script type="text/javascript"> 
            $(document).ready(function() {
            //this will open in a new window
            $(".Attachment a").attr("target", '_blank');
            $(".Message a img").attr("target", '_blank');
            </script>
    

    Forgot to mention that if it is a default.master.tpl you need to add the script between {literal}script goes here {/literal} tags...

  • Options

    @stevejwin said:
    I apologize here for all the fancybox talk but I did not put that in the title of this discussion - no idea how that got there.

    Yep, that was me... I took it out again.

    There was an error rendering this rich post.

Sign In or Register to comment.