Image banner control/webpart in master page

I am getting started with sp2010 dev and I am looking to build a visual web part(sandboxed) image banner, which will loop through user specified image library. The image changes on page refresh.My questions are,
1) Is there is a similar control out there which i could reuse or modify to my specifics so I need not reinvent the wheel. If not could give me a little insight on the approach please?
2) I would like some input on how to add the control to Master Page (v4.Master).
Thanks and Appreciate your help and replies :)

Hi batllesmith,
I've created a prototype sandbox webpart for specific requirement 
here goes the steps
create new Empty sharePoint solution 
Add new Webpart and use the below code 
using System;
using System.ComponentModel;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
namespace CarouselWebparts.CarouselWebpart
[ToolboxItemAttribute(false)]
public class CarouselWebpart : WebPart
private string _listName = string.Empty;
[WebBrowsable(true)]
[Personalizable(PersonalizationScope.Shared)]
public string ListName
get
return _listName;
set
_listName = value;
protected override void Render(HtmlTextWriter writer)
try
string html = string.Empty;
//first inject the css and js needed
html += @"<link rel='stylesheet' href='/NivoCustomModule/css/default/default.css' type='text/css' media='screen' />
<link rel='stylesheet' href='/NivoCustomModule/css/nivo-slider.css' type='text/css' media='screen' />
<link rel='stylesheet' href='/NivoCustomModule/css/style.css' type='text/css' media='screen' />
<script type='text/javascript' src='/NivoCustomModule/scripts/jquery-1.7.1.min.js'></script>
<script type='text/javascript' src='/NivoCustomModule/scripts/jquery.nivo.slider.js'></script>
<script type='text/javascript'>
$(window).load(function () {
$('#slider').nivoSlider();
</script>
//start the html markup of the slider itself
html += @"<div id='wrapper'>
<div class='slider-wrapper theme-default'>
<div id='slider' class='nivoSlider'>";
//call the helper function get Images
foreach (SPFile file in getImages())
html += "<img src=\"" + file.ServerRelativeUrl + "\" alt=\"" + file.Title + "\"/>";
html += "</div></div></div>";
writer.Write(html);
base.Render(writer);
catch (Exception ex)
finally
#region Helpers
/// <summary>
/// get images uses an absoute url to a folder
/// </summary>
/// <returns></returns>
private SPFileCollection getImages()
try
//both properties has to be set
if(ListName.Equals(string.Empty))
return null;
SPWeb web = SPContext.Current.Web;
SPList list = web.GetList(ListName);
SPQuery query = new SPQuery();
query.Query = @"<Where>
<Eq>
<FieldRef Name='FSObjType'/>
<Value Type='Number'>1</Value>
</Eq>
</Where>
<OrderBy>
<FieldRef Name='Created' Ascending='FALSE' />
</OrderBy>";
query.RowLimit = 1;
SPListItemCollection items = list.GetItems(query);
if (items != null)
SPFolder rootFolder = items[0].Folder;
return rootFolder.Files;
return null;
catch (Exception ex)
return null;
#endregion
3. Add new module Element and add the nivo folder contains css and javascript required (or any other Jquery library you prefer)
4. Notice that the Library the Webpart Loads the images from is  configurable using editor part ( Miscellaneous) section  with  ListName parameter
for further question don't hesitate to reply back

Similar Messages

  • Custom master page applying on Publishing site template not in my site template?

    Hi,
    i have created a custom master page based on Publishing template Using Design manager (means converted html to aspx page) and then set all other control on the master page. now problem is master page applying only on Publishing site template not my site
    template. any one know why its happening, and how can resolve this issue?
    Thanks
    Mohammad

    Feature Stapling may be a solution - Please check -
    http://sharepointologic.blogspot.in/2013/04/branding-sharepoint-2013-my-sites-with.html
    http://www.codeproject.com/Articles/42129/Creating-branded-my-site-in-sharepoint
    Thanks
    Ganesh Jat [My Blog |
    LinkedIn | Twitter ]
    Please click 'Mark As Answer' if a post solves your problem or 'Vote As Helpful' if it was useful.

  • How do I 'assign a higher layer to the object on the master' (page numbers on master) I understand the layer needs to be at the top to show above placed images on pages but how do I do this?

    I've added the page numbers to my master pages. They are displaying on the pages but I have images on the individual pages that are covering the numbers. I understand I need to assign a higher layer to the object but I don't understand how to do that. Please help me? Please explain a simply clearly as possible, I've read other answers but still don't understand. Wish it was as simple as select object, right click, edit layer!
    Many thanks!

    Layers panel;
    Create new layer
    Switch to Master page
    Make sure new layer is on top in the Layers panel, if not drag the layer on top in the Layers panel.
    Select (click once on) that top layer (pen symbol appears behind that layer in the Layer panel)
    Now draw your page numbers etc on the Mastet page
    From now on, select (click once on) any Layer in the Layers panel that is below the layer you used on your Master page items and create new objects in your document pages.
    If you accidently created objects on a 'wrong' layer:
    Select those objects
    You will see a square behind the layers name in the Layers panel
    Click and hold the mouse on that square and drag it behind the name of the layer you want to move the objects to.
    Buy a book about InDesign and start learning these basic principles!

  • Keynote 6.0 isnt loading master page background image

    I made a kaynote in Keynote 5.3 and my coworker opened it in keynote 6.0 but the master pages background image fill was not loading and came up blank.  On several other laptops with keynote 5.3, the background images loaded properly.
    why and how do i fix this?

    One of the most common causes of Mavericks problems appears to be If the hard drive was not wiped clean before installing Mavericks as remnants of incompatible software remain.
    I would back up then clean install the OS.

  • Any ideas on keeping images on master pages consistently high quality display when exporting to pdf?

    Any ideas on keeping images on master pages consistently high quality display when exporting to pdf?

    Set up the Preflight panel so it checks image resolution. Ask your printer what the appropriate resolution is for your printing process, and set that in Preflight.

  • How can I use a vector image to stretch with the backgrounds in Muse master pages?

    How can I use a vector image to stretch with the backgrounds in Muse master pages?

    Maybe there's a bug.  I think it's only showing it when it wants to because look:

  • Master page not picking up images associated in ISF file

    Hi
    I am using FM11. RH10 as part of TCS4.
    Last year I had created a master page and settings file (ISF). We are now revising it.
    Some of our styles have images associated with them (Style name > Format > Borders and Shading > Shading > Pattern).
    My workflow:
    1.   Open a blank RH project.
    2.   Link FM book. All the FM files are imported. But there are no images in the Project Manager pod > Images folder yet.
    3.   Associate and apply the ISF file. Images show up in the Images folder. But they have this X mark against them. So I assume they are just some sort of placeholders yet. I check the topic where these images are used. They are empty as well.
    4.   Import the master page. I get a message that images are also imported. The X mark against the images are gone and they show up in the topic as well.
    That is how it worked in the previous version, which was correct.
    Now, that is not happening. Steps 1 to 3 work fine. But when I import the master page (Step 4), The confirmation message does not mention anything about the images.
    In both cases, the ISF file, master page, and the images are all in the same folder. Now the only way to get the images work is by manually copying all the images to the RH project folder.
    Can somebody please tell me why this is not working the way it used to work? From what I see, I am not doing anything different. I have even opened the master page in an XML editor and checked. I did not see any difference.
    Sreekanth

    Thanks for your quick reply, Jeff.
    Tried that, still no luck.
    Sreekanth

  • I inserted a HTML5 video in page, when I test it in a Browser, I see the poster image and controls, But when I click play button the video goes white, slider moves like its playing, but just white picture. There was no audio included in video. Please help

    I inserted a HTML5 video in page, when I test it in a Browser, I see the poster image and controls, But when I click play button the video goes white, slider moves like its playing, but just white picture. There was no audio included in video. Please help

    Without a link, it's anybody's guess.
    It could be a problem the video rendering itself.  Which software did you use?
    Did you export to the 3 file types -- MP4, OGG and WEBM to support all browsers?
    Does your web server support those 3 MIME file types?
    Nancy O.

  • Indesign master page putting the images on the master in teh middle of some of my pages but not all

    indesign master page putting the images on the master in teh middle of some of my pages but not all =[

    We'll need some more information, and probably a few screen shots, like the master page and one of your pages where the image is not showing.

  • Using Master pages with image placeholders

    I've created a masterpage that contains image placeholder and header, and body copy text fields...but I can't seem to figure out how to use them once I'm inside of a page. In InDesign you can override a master object, but I can't seem to figure it out. Is this even possible??
    Let me know and thanks!

    The content placed in a Master page can only be selected/edited in the Master page and not in the associated content pages. A Master Page in Muse allows you to apply common elements like headers, footers, logos, and navigation to multiple pages in your site. A way around this would be create an overlapping object in the content page so as to hide the Master object placing it behind the overlapping object using Layers feature.
    Hope this helps, let me know if that is not exactly what you were looking for.
    Thanks,
    Vinayak

  • Background image of custom master page just shows for 1 second.

    Hi, 
    I have created a custom master page from a html code and I have applied to it on my site collection, but when I open it on the web browser the background image just show up for a second or less and then the background turns white.
    I'll aprecciate any suggestions in order to solve this.
    Regards.

    Hi,
    According to your post, my understanding is that Background image of custom master page just shows for 1 second.
    I recommend to change the class to use .main-content.
    .main-content
    background-color:#F4F2E5;
    background: url('/Style%20Library/Images/image.png');
    background-repeat: no-repeat;
    background-;
    You can also use a contol called cssregistration. Add a line that looks something like this, right below the existing csslink:
    < SharePoint:CssLink runat="server" Version="4" /> (under this you add:)
    < SharePoint:CssRegistration runat="server" name="/Style%20Library/Scripts/style.css" After="coreV4.css" />
    Here is a similar thread for you to take a look at:
    http://social.technet.microsoft.com/Forums/en-US/929c9fe6-a222-43a9-9551-985c0f20756d/background-image-in-sharepoint-2010-master-page?forum=sharepointcustomizationprevious
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • Report Viewer Webpart is Blank in Custom Master Page

    Dear Experts ,
    Recently my team created a new master page to replace seattle default page in Sharepoint 2013. Things were fine till the moment we accessed one of site page containing a Report Viewer Web Part to load SSRS rdl. The web part is blank
    with just standard SSRS toolbar and parameter. To isolate the problem, I have confirmed that the same page works fine in seattle master. I notice that something could be missing in our site (though I am clueless on what those are). There is one post online
    from someone with potentially similar issue, but it does not help in our case. Some pointers from will be appreciated. Cheers.
    http://blogs.msdn.com/b/selvar/archive/2013/11/28/using-reporting-service-web-part-with-sharepoint-custom-master-pages.aspx

    Hi,
    Please try to add AsyncPostBackTimeout="0" inside the ScriptManager code in your master page.
    <asp:scriptmanager id="ScriptManager" runat="server" enablepagemethods="false" enablepartialrendering="true" enablescriptglobalization="false" asyncpostbacktimeout="0" enablescriptlocalization="true" />
    If the issue still exists, I suggest you provide some error messages or code for further research.
    Thanks,
    Dennis Guo
    TechNet Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Dennis Guo
    TechNet Community Support

  • Master Pages to Control Body Text Styles?

    I think I must not understand Master Pages.
    I want to create a set of text frames on every page in my book. I'd like the frames to be the same on every page, with the same font, size, justification, etc. for each frame (and I'm not threading the text frames from page to page).
    If I try to use Master Pages to set all this up, and then override the master page by pasting different text on each page, I lose the ability to change fonts, font sizes, etc. on all pages at once. Since I've overridden the Master for that text frame, changing the Master no longer affects that text.
    Should I be using a different way to set the font, font size, justification, etc. in the frames on all pages at once? (I'd also like to resize or move those text frames on all pages at once, too, but just pasting text into an overridden Master frame seems to leave me the ability to alter the frame itself.)
    Any ideas?
    Thanks for any help.

    Yes, of course. Thanks. When I refered to the text frames, I meant the size and shape and placement of the frames.
    So I can manipulate all the font and text attributes through Paragraph Styles, and I can manipulate all the text frames by changing the Master Page.
    Perfect. (I have the latest ID on a Mac running Mountain Lion.)

  • Is there a way / script to change an image in all master pages of files in a InDesign book

    I have about 30 InDesign Files that are contained within a book. I am looking for a simple way to replace a logo in the master files without doing it one by one. Is there a script or process to do this easily?

    Master pages can be synchronized through the Book panel.

  • Image not arranging to top on pages, only on master

    The master shows the logo placed on top of a rectangle shape, but on all the pages it is behind it. Tried deleting and replacing it and it is still the same. The arrange option is correct, but not displaying correct. WHY?!

    Hello,
    Any content on the Master page is always locked on the pages and is always on the back layer. The master page objects cannot be brought in front or no other object on page can be sent behind the Master page objects.
    A feature request has already  been logged regarding this by other Muse users : http://forums.adobe.com/ideas/1444
    http://forums.adobe.com/ideas/2330
    I would suggest you to please Vote and add your valuable comments to the posts.
    Regards,
    Sachin

Maybe you are looking for

  • Load a second video into an applet: resize - stretch problem

    Hello! I have an applet that loads a movie (call it film_a.mov). The size of the movie is 320 x 240. Since I want to show it bigger, I use a BorderLayout that stretches the video depending on the size given by the applet. In my case I set the applet

  • SQL Query to Join by Comma  - Help an assistance

    Hi, Thanks for your help in advance. Requirement is as follows. Table1 ======= Col1 Col2 ============ 1 John 2 Jocky 3 Silk Table2 ======== Col1 Col2 ========= 1 John, Marry, Joseph 2 Silk, David 3 Jocky, Prem I need an sql query where the join condi

  • PR is must to create PO

    Hi Can any one tell me what are all the settings needed to keep PR mandatory to create PO. Thanks in advance srini

  • How can I stop iTunes installing Dupes?

    I am cleansing and consolidating my entire MP3 collection to one external hard drive. All was going well until I had about 75GB of MP3s transferring from one drive into iTunes when it quit at about 90% for no apparent reason. So I now do not know wha

  • Ati tv wonder

    I installed aa ATI tv wonder pro.When I run the pc check in multimedia center configuration I get an error that says that my sound card did not pass the test: the clock accuracy is less than .2%. I downloaded the latest drivers for my audigy eax soun