XF 2.2 Lightslider and Media Albums


Active member
At the top of my forum, I have a Lightslider that is pulling images from a Media Album that I have set up in the Media. They are all thumbnails. There is one aspect that I would like to modify if possible.
Whenever one of those 'thumbnails' are clicked on, of course, it takes you to that particular image in the Media Album. I wish I could change that whenever someone clicks on 'any' image in the slider, they will be taken to another webpage. Is this possible? I looked at these templates below and cannot find that I can add my own URL instead of the images being linked back to the Media Gallery.
xfmg_widget_album_slider XenForo Media Gallery
xfmg_widget_media_slider XenForo Media Gallery


If a user clicks on any image, they are referred to the Media Gallery. I would like to modify so that if any image is clicked on, they will go to a URL.


Active member
I was wondering if anyone is willing or has any knowledge on how to modify so that if "any" image is clicked on, I can change the URL to my choosing.


XenForo moderator
Staff member
The content is actually populated using the xfmg_album_list_macros and xfmg_media_list_macros templates.

You can edit those to change the URL but you will likely need to use a conditional statement to ensure the URL is only changed in the slider.


Active member
Thank you Brogan !!!

I edited these lines, and it worked. This is what I wanted ....No matter where you hover your mouse over within the slider, I can now link to a page I have set up. However, probably overkill as I probably can go back and see which one is actually performing the task. I did not edit the album_list_macros as I wanted to leave the standard Media alone for users and not have any embedded stuff there.
I am not sure about any conditional statements (as I am not a programmer), but I will keep my eye on this to see if it causes any other problems.

From ('media' to a link to my own site)

115  <a href="{{ link('media', $mediaItem) }}" class="js-lbImage"
121  data-lb-caption-href="{{ link('media', $mediaItem) }}">
196  <a href="{{ link('media/comments', $item.LastComment) }}
209  <a href="{{ link('media', $mediaItem) }}">
244  <a href="{{ link('media', $mediaItem) }}">{$mediaItem.title}</a>


115  <a href="{{ link('https://anysitedotcom/../', $mediaItem) }}" class="js-lbImage"
121  data-lb-caption-href="{{ link('https://anysitedotcom/../', $mediaItem) }}">
196  <a href="{{ link('https://anysitedotcom/..//comments', $item.LastComment) }}
209  <a href="{{ link('https://anysitedotcom/../', $mediaItem) }}">
244  <a href="{{ link('https://anysitedotcom/../', $mediaItem) }}">{$mediaItem.title}</a>