How to you create a breadcrumb in SharePoint online. I heard this is not available on SharePoint online?.
is there any work around ? and custom code that can enable the master pages ?
Create Custom
Enable Breadcrumb
<div class="ms-breadcrumb-dropdownBox" style="display:none;">
<div class="ms-breadcrumb-dropdownBox" style="display:none;">
<SharePoint:AjaxDelta id="DeltaBreadcrumbDropdown" runat="server"> <SharePoint:PopoutMenu
Visible="true"
runat="server"
ID="GlobalBreadCrumbNavPopout"
Icon="/_layouts/15/images/spcommon.png?rev=23"
That's it. We're almost done.
Apply Custom Master Page
If the icon didn't appear then you need to set/apply the Custom Master page to the site.
Now navigate to site pages and you'll see Breadcrum ("Navigate Up") icon. :)
Different solution are in Google for Reference:
Create a modern breadcrumb navigation on SharePoint
SharePoint 2013 Branding: Show folder breadcrumbs as an inline breadcrumbs navigation
you can use jQuery code to do that.
A demo:
$.ajax(
{
url: _spPageContextInfo.webAbsoluteUrl + “/_api/web/parentweb”,
method: “GET”,
headers: {“Accept”: “application/json; odata=verbose”},
success: function(data)
{
if (data.d.ServerRelativeUrl)
{
console.log(‘Parent site title: ‘ + data.d.Title)
var upSiteUrl = “”;
upSiteUrl += “<span class=’upLink’>”
upSiteUrl += “<a href='” + data.d.ServerRelativeUrl + “‘ title=’Back up to > ” + data.d.Title + “‘>”
upSiteUrl += “<img src=’/sites/global/SiteAssets/IMG/up16.png’>”
upSiteUrl += “</a>”
upSiteUrl += “</span>”;
$(‘#zz11_RootAspMenu’).before(upSiteUrl);
}
}
});
https://clouddeveloper.space/2017/04/07/breadcrumb-for-office-365-sharepoint-online/
For custom breadcrumbs use this code below
1 – Go to the library where you want to add breadcrumb navigation
2 – From the landing page of the library, place the page in edit mode
3 – Add a script editor web part to the page, and paste the markup into the editor
4 – Save and close the page, and voila!
<script type="text/javascript">
// Variable to store the text used by SharePoint to generate the breadcrumb separator arrows
var SeparatorArrow = '<span id="onetidPageTitleSeparator"><span><span style="height:11px;width:11px;position:relative;display:inline-block;overflow:hidden;"><img src="/_layouts/images/fgimg.png" alt=":" style="border-width:0px;position:absolute;left:-0px !important;top:-585px !important;" /></span></span> </span>';
var baseURL = (document.location).toString();
baseURL = baseURL.substring(0,baseURL.indexOf(".aspx")+5);
var url = baseURL;
url = baseURL + '?RootFolder=';
var rootFolder = unescape(GetUrlParameter('RootFolder'));
var path = GetFolderPath(rootFolder);
rootFolder = rootFolder.substring(0,rootFolder.indexOf(path));
document.write('<div style="background: #ffff99; padding: 5px; border-radius: 4px; border: 1px solid #cccccc; margin-bottom:-10px;"><b>Folder Location:</b>');
document.write(SeparatorArrow);
if(path.length > 0)
{
var folders = path.split('/');
for(var i=0; i < folders.length; i++)
{
if(i==0)
url += encodeURIComponent(rootFolder.substring(0,rootFolder.length-1));
url += encodeURIComponent('/' + folders[i]);
if(i<folders.length-1)
{
//Add the folder link and separator arrows if more than one folder level deep
document.write('<a href="' + url + '&FolderCTID=' + GetUrlParameter("FolderCTID") + '&View=' + GetUrlParameter("View") + '">' + folders[i] + '</a>');
document.write(SeparatorArrow);
}
else
{
if(folders.length>1)
document.write(folders[i]);
}
}
}
document.write('</div>');
// Gets the value of the requested URL Parameter
function GetUrlParameter( name )
{
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regexS = "[\\?&]"+name+"=([^&#]*)";
var regex = new RegExp( regexS );
var results = regex.exec( window.location.href );
if( results == null ) return "";
else return results[1];
}
// Gets the name of the library
function GetFolderPath(rootFolder)
{
var domain = window.location.hostname;
var web = baseURL.substring(baseURL.indexOf(domain)+domain.length);
var path = rootFolder.substring(GetFirstBreakIndex(web, rootFolder));
return path;
}
// Gets the first different character occurrence index
function GetFirstBreakIndex(a, b)
{
var slashIndex = -1;
var equalsReturnCode = -1;
if (a && b)
{
var longest = b.length > a.length ? b : a;
var shortest = a.length > b.length ? b : a;
for(var i=0; i < shortest.length; i++)
{
// Get location of each / as a breakpoint if
// the first break index is part way into the string
if(shortest.charAt(i) == '/')
slashIndex = i;
if(shortest.charAt(i) != longest.charAt(i))
{
if(i-slashIndex == 1)
return i;
else
return slashIndex + 1;
}
}
}
else
{
return equalsReturnCode;
}
}
</script>
Link reference: http://robertmcquaig.com/sharepoint/document-library-breadcrumbs/