Posts

Showing posts from March, 2016

Creating Buttons from any Link Library in SharePoint 2013

Here's a fun little trick to create buttons from the contents of a SharePoint 2013 Link List. First here's the finished code. <script type="text/javascript" src="/SiteAssets/jquery-1.4.2.min.js"></script> <script type="text/javascript" src="/SiteAssets/jquery.SPServices-0.5.4.min.js"></script> <link rel="stylesheet" type="text/css" href="/SiteAssets/std_Buttons.css"/> <script language="javascript" type="text/javascript"> $(document).ready(function() {   $().SPServices({     operation: "GetListItems",     async: false,     listName: "Links",     CAMLViewFields: "<ViewFields><FieldRef Name='URL' /></ViewFields>",     completefunc: function (xData, Status) {       $(xData.responseXML).find("[nodeName='z:row']").each(function() { var urlstr =  $(this).attr("ows...

Creating SharePoint 2010/2013 themed buttons

Image
In my new job we are making use of the SharePoint 2013 themes.  This will allow us to quickly identify which SharePoint portal we are using at a glance.  I wanted to create a customized CSS button which would match the SharePoint theme. To do this, I needed to apply two styles to the same link; my own to create the button, and the Microsoft SharePoint style for color. First, my style: <style type="text/css"> .btn_1line_xSma{   padding:2px 2px 2px 2px; height:15px; margin:1px 5px 5px 5px; display: inline-block;  width:300px; font-family:Arial,sans-serif; text-align:center; text-transform:uppercase; float:none; color: white !important; font-weight:normal; font-size:13px; vertical-align:middle; text-decoration:none !important; opacity:1.0;  filter:alpha(opacity=100); } .btn_1line_xSma:hover{ color:#DCDCDC !important; opacity:0.85;  filter:alpha(opacity=85); } This creates a button that I find visuall...