I'm sure i have selected the perfect title for this however, if someone can come up with a better title, feel free to edit.

Anyway, I am having a slight issue integrating a combination of functions using P&T switch. I am currently using the Jquery plugin fancybox for my gallery [Click here][2] when you click on the image it meant to open a pop window.

I am using P&T switch as the gallery will feature both images and videos, In the expression control panel have created variables that look like the followingclick here This will enable the user to select a video or image, The video will navigate to the template {'pop/video'} and the images will navigate to {'pop/video-pop'}.

In order for me to a achieve this i have attempted to apply the following code to my gallery, however it's not working

<div class="am-container" id="am-container">
        {exp:low_reorder:entries set="gallery_set" channel="gallery" disable="pagination|member_data|trackbacks"}
            <a class="various" href="{if video_switch == "image"}{path='pop/index/{url_title}'}{/if}{if video_switch == "video"}{path='pop/video-pop/{url_title}'}{/if}">
            <img onmouseover="removeFilter(this)" onmouseout="addFilter(this)" src="{g_image}" alt="{url_title}" class="filter"></a>

Can someone please guide me in the right direction..?

  • If my answer below helped you, would you be so kind as to mark it as the correct answer (with the "check" to the left of it)? Thanks!
    – Steven
    Feb 21 '13 at 8:47

I've looked at your link and can't see from looking at the front-end what would be the issue. What always helps for me is adding "debug" info to my HTML. You could for example try this:

{exp:low_reorder:entries set='gallery'}
    <!-- {video_switch} -->

To output the value of this field for your entries. If the output is what you expect it, you could test further like so:

{exp:low_reorder:entries set='gallery'}
    {if '{video_switch}' == 'image'}
        <!-- this must be an image -->
    {if '{video_switch}' == 'video'}
        <!-- this ought to be a video -->

It might be a typo or something. If you need further assistance set up a page that has code along these lines and please share the code and the url.

Good luck!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.