Jump to content

Image and Video carousel using repeater field


countchocula
 Share

Recommended Posts

I have an image and video carousel that I want to use on a page and have it be editable via processwire. The problem is that the code for images and video is completely different. What is the best way to go about making one repeater field where you can pick either a video or image? I thought about having nested repeaters but not sure if that would work. I want it to be possible to order the slides so having them as separate repeaters wouldn't work either. I am a bit stumped. Any help would be great.

Images:

<div class="rsContent">
    <img class="rsImg" src="abc.jpg" alt="">
    <div class="infoBlock infoBlockLeftBlack">
      <h1>...</h1>
      <h3>...</h3>
      <h4>...</h4>
      <p>....</p>
      	etc etc
        
    </div>
    
  </div>

and for video is this:

<div class="rsContent">
    <a class="rsImg" href="abc.jpg" data-rsVideo="https://www.youtube.com/"></a>
  </div>

Thanks you

Link to comment
Share on other sites

PageTable would fit better here since you can use different templates and fields for output...

there is even a exented module for this to get the output rendered nice in the backend...

https://processwire.com/talk/topic/7459-module-pagetableextended/

good example how to use it:

https://processwire.com/talk/topic/7459-module-pagetableextended/#entry71972

regards mr-fan

  • Like 1
Link to comment
Share on other sites

PageTable would fit better here since you can use different templates and fields for output...

there is even a exented module for this to get the output rendered nice in the backend...

https://processwire.com/talk/topic/7459-module-pagetableextended/

good example how to use it:

https://processwire.com/talk/topic/7459-module-pagetableextended/#entry71972

regards mr-fan

thank you, i will take a look at that. 

carousel is not my choice.....thanks for the help though

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...