adding a slider

Heather Aluma asked on December 16, 2021 19:42

Hi. I've been working on adding a JS slider (Slick Slider) to a page. I am able to get the JavaScript working on a page without components, but once I make a page type and add that type to a repeater on my page template the slider no longer works. It appears to be enacting half of the JS only. I found a promising Answer on this forum at https://devnet.kentico.com/questions/change-banner-into-slider-banner, however, the comments for the thread are closed. I figured I would shout out to the general community.

My first question pertains to the last entry. For step 2 it says "Bind it with a repeater (Not basic repeater)". Why not a basic repeater/what would be better to use?

I think that if I could see a video like the one described in the first answer that it may help me pinpoint what I am doing incorrectly. The video, however, it private.

Thank you for any pointers that you can give.

Recent Answers


Juraj Ondrus answered on December 17, 2021 06:39

For basic repeater you will need to have a data source web part or other source of the data specified.

0 votesVote for this answer Mark as a Correct answer

Heather Aluma answered on December 17, 2021 17:49

That makes sense, and if I haven't explicitly selected a data source web part for my repeater, is the default for a basic repeater web part data source or not?

One thing that I am noticing is that on my page I have a repeater that is a list of a Web Part Container, and I am not sure what type of Web Part is used within the container. Here is another question. Using Kentico 11, what would be the best pieces to use to set up my page template? In the end what I want is page that has rows of cards that use a slider. Each row is it's own container. Would the card be a web part, the row a repeater (which type I'm not sure) and then the page would contain multiple repeaters? I think that I will begin to build again with the new understanding that I have.

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on December 20, 2021 06:03

If you do not set data source for your normal repeater web part, you need to configure the properties properly so it know where to look for the data. For the second question - this really depends on dozen of variables and details and there is no right, one and only answer. You could build your fully custom web part which will contain the data source control, repeater and whatever controls you want. Or, it could be something which is using custom JavaScript, jQuery or other scripts - the web part will just load the data - e.g. based on a repeater and then the rest will be done by the scripts. Or, there is also a repeater with effect available - this one has property to specify the JS.
If you want to go with a repeater, you can just use appropriate transformation HTML code and make the rows and columns as you want. With multiple repeaters, each would have to be set differently so they will not display the same data.

0 votesVote for this answer Mark as a Correct answer

Heather Aluma answered on December 21, 2021 13:17

Above is said, "If you do not set data source for your normal repeater web part, you need to configure the properties properly so it know where to look for the data." If I have a regular repeater, do the transformations that I write for the repeated web part function in this way? (The transformations pull content from the database.)

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on December 21, 2021 13:29

I am sorry but it does not make much sense. The transformation is basically just the look and feel, how the data should be displayed by the repeater on the page. At first, the repeater needs to know where to look for the data. So it can load the items into its dataset. And then, the transformation comes to the game and repeater adds the items from the dataset one by one to the page using the code from the transformation.

0 votesVote for this answer Mark as a Correct answer

Heather Aluma answered on December 23, 2021 21:05

Thank you for your help, Juraj. The Slick Slider is working now, and I think that the issue has nothing to do with setting up the JS and more to do with memory or how components are being saved to the database. I am new to developing in Kentico and junior to development in general, but none of the other repeaters on our site (a couple of them a different slider) referred to a data source. Yesterday while working with the page type I noticed something weird so I made a new page type and worked with it a little differently. I then added JS to the repeater I made with the new page type.

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on December 25, 2021 07:54

I am glad it is working now. I do not know how your site is designed and developed. I was just explaining things in general.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.