adding external libraries into kentico

hassan kalach asked on August 9, 2017 13:01

whats the correct way to add files of a slider or what ever plugin we wont to use inside a kentico website

Recent Answers

Trevor Fayas answered on August 9, 2017 14:06

if it's JavaScript just add it through the JavaScript module on the site, include any css through the css module and upload the files for the css either through the themes tab on the css or through the media library and update the style sheets reference to those files to the new location.

if you need to add an library, you should use a nuget package, but just make sure to backup site first as sometimes nuget packages change drivers Kentico uses and can require extra steps.

0 votesVote for this answer Mark as a Correct answer

hassan kalach answered on August 9, 2017 14:27

the thing is when you have a plugin all files should be in a same place css javascript and eaven images for the slider ( loader buttons...) so cant i simply add an entire folder ?!

0 votesVote for this answer Mark as a Correct answer

Trevor Fayas answered on August 9, 2017 15:34

Very rarely do you need to have all the files in the same place, and even when it is configured as such you can still open up the javascript / css and change where things are pointing to.

But, if you absolutely need all hte things to be in the same location, if you add .js, .css, and whatever other file extensions the plugin uses into your allowed Media Content (through Kentico settings), then you can create the folder structure and upload all the files into your media library.

Downside of course is you can't modify the css / javascript through the portal if you are just uploading the files, it is best to put them in their correct spots and just modify the references (which are usually just in the css, search the css for 'url' to find where it's referencing files)

0 votesVote for this answer Mark as a Correct answer

Suneel Jhangiani answered on August 11, 2017 13:41

I think a better way of handling this is to use a Custom Web Part and then store the Javascript, CSS and Images in a "WebPartName_files" sub-folder. This is also how Kentico have structured some of their web parts (look in the 'CMSWebParts\Viewers\Effects' folder as an example).

If you are using the same Plugin in multiple web parts then it would be better to follow Trevor's answer.

1 votesVote for this answer Mark as a Correct answer

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