Friday, May 27, 2016

Adding new item with plus in circle using Content Editor webpart

Adding new item with hyperlink like in the list form using content editor webpart.



Add the following content in the text file and call this text file in content editor webpart

<div align="right">

<table cellspacing="0" cellpadding="0" border="0" dir="none" id="Hero-WPQ2">
<tbody><tr><td class="ms-list-addnew ms-textXLarge ms-list-addnew-aligntop ms-soften">
<a title="Add a new item to this list or library." target="_self"    href="/MOM/Lists/MOM/NewForm.aspx" class="ms-heroCommandLink" id="idHomePageNewItem">
<span class="icon icon-add-new"></span>
<span>Add new MOM </span></a>
</td></tr></tbody></table>

</div>


<style>

/* css example with custom class */
/* img tag technique */


/* background technique */

.icon {
display: inline-block;
overflow: hidden;
vertical-align: middle;
}

.icon-add-new {
width: 22px;
height: 21px;
background: url('/_layouts/15/images/spcommon.png?rev=23') no-repeat -130px -134px;
}

</style>

Ref: 
http://ericoverfield.com/sharepoint-2013-spcommon-png-sprite-breakdown/
https://gist.github.com/empo/6380de9a10710646fd62

No comments: