Friday, February 26, 2010 1:43 AMOk so I am wanting to do this:
Read a webpart and generate the data to the carousel.
I will include a style that will hide the webpart from the screen. So therefore the carousel is the only thing left.
I think it is possble in theory... but anyone have any information or direction for me?
- Edited by Mike Walsh FIN Friday, February 26, 2010 4:39 AM - help removed from Title. NEVER write "Help" in a Title. It is not a problem description.
Friday, February 26, 2010 4:26 AMIt sounds like you want to use jQuery and jCarousel to display something in a webpart. Here is how you can do that:
First, let's assume that you will be displaying image thumbnails from images that are stored in a picture library. Go ahead and create a picture library and upload several sample images to your picture library so you have some data to work with. Picture Libraries automatically generate thumbnails, and those would be good to use in a jCarousel. Browse to the picture library so that you can see the thumbnails in your web browser, and for each image, right click on each thumbnail, copy the thumbnail's URL, and paste the URL in notepad. You want to end up with several URLs to thumbnails. We'll use them later.
Second, create a generic webpart. Override the Render function, outputting generic 'hello world' HTML, deploy the webpart, and add the webpart to your page. Make sure the web part shows 'hello world' before moving on to the next step.
Fifth, replace the static HTML in the onrender function with dynamically generated HTML. For Example, if you want to display all the images in a picture library, use the Sharepoint APIs to get URLs to the images in the list. At this point you can filter or sort using C# code to display whatever particular images you want. After adding this code, be sure to redeploy the web part.
If all goes well, you should be done.
Does this provide you with enough guidance? I've tried to break it apart into separate steps so you can work on one thing at a time until you get that one item figured out, then move on to the next. That way you can avoid having 2 or 3 things to troubleshoot at once.
FYI, I've never worked with jCarousel before, so I can't tell you exactly how to implement it, but they seem to have a decent amount of documentation and samples at their website (http://sorgalla.com/jcarousel/).
- Marked As Answer by Chengyi Wu Friday, March 05, 2010 3:30 AM
Monday, April 19, 2010 11:33 AM
There article is clear expect one thing for me:
"Second, create a generic webpart. Override the Render function, outputting generic 'hello world' HTML, deploy the webpart, and add the webpart to your page. Make sure the web part shows 'hello world' before moving on to the next step."
How do you create à "generic webpart"? can you be more specific and give a step by step.
How can you edit and see the code of the Render funtion?
Thanks a lot
Monday, April 19, 2010 12:43 PM
There are already a plethora of very good articles written about how to create a webpart, so rather than write another one myself, I'll link to some: