Skip to main content
added 144 characters in body; edited tags
Source Link
Alex Angas
  • 6k
  • 9
  • 50
  • 89

I'm trying to build a menu from a sharepointSharePoint list as you can see below but iI need to group the main menu'smenus and then add links to the appropiate appropiate main menus.I I have seperatedseparated the links using the LinkType column if it is a header or a header with a link. But what i

What I need help with is to kind of get the distinct of the Group columns or how to group the groups columns.

My data lookslooks like this:

Title URL LinkType Groups Test http://Test Header Link Comms Test2d http://Test2 Header Marketing Test3 http;//Test3 Header Comms Test4 http://test4 Header Plans Test5 http://Test5 Header Link Marketing

Any help would be appreciated.Thanks


Title   URL             LinkType        Groups
Test    http://Test     Header Link     Comms
Test2d  http://Test2    Header          Marketing
Test3   http://Test3    Header          Comms
Test4   http://test4    Header          Plans
Test5   http://Test5    Header Link     Marketing
$().SPServices({
  operation: "GetListItems",
  async: false,
  listName: "Menu",
  CAMLViewFields: "<ViewFields></ViewFields>",
  completefunc: function (xData, Status) {
    $(xData.responseXML).find("[nodeName=z:row]").each(function() {
      var title= $(this).attr("ows_Title");
      var groups = $(this).attr("ows_Groups");
      var LinkType = $(this).attr("ows_LinkType");

var HTMLmarkup = ''; $(".sf-menu").each(function(){

if (LinkType == 'Header') {

HTMLmarkup += '' + groups + ''; HTMLmarkup += '

    '; HTMLmarkup += '
  • ' + title+ '
  • '; HTMLmarkup += '
'HTMLmarkup += ' ';$(".sf-menu").append(HTMLmarkup);}else if(LinkType == 'Header Link'){//HTMLmarkup += '' + groups + '';HTMLmarkup += '' + groups + '';HTMLmarkup += '
    '; HTMLmarkup += '
  • ' + title+ '
  • '; HTMLmarkup += '
'HTMLmarkup += ' ';$(".sf-menu").append(HTMLmarkup);}

});

      var HTMLmarkup = '';
      $(".sf-menu").each(function() {
        if (LinkType == 'Header') {
          HTMLmarkup += '<li class="current"><a href=#>' + groups + '</a>';
          HTMLmarkup += '<ul>';
          HTMLmarkup += '<li><a href="#">' + title+ '</a></li>';
          HTMLmarkup += '</ul>'
          HTMLmarkup += '</li>';
          $(".sf-menu").append(HTMLmarkup);
        } else if (LinkType == 'Header Link') {
          //HTMLmarkup += '<li class="current"><a href="#a">' + groups + '</a>';
          HTMLmarkup += '<li class="current"><a href=' + title + '>' + groups + '</a>';
          HTMLmarkup += '<ul>';
          HTMLmarkup += '<li><a href="#">' + title+ '</a></li>';
          HTMLmarkup += '</ul>'
          HTMLmarkup += '</li>';
          $(".sf-menu").append(HTMLmarkup);
        }
      });
    });
  }
});

});

});

I'm trying to build a menu from a sharepoint list as you can see below but i need to group the main menu's and then add links to the appropiate main menus.I have seperated the links using the LinkType column if is a header or a header with a link. But what i need help with is to kind of get the distinct of the Group columns or how to group the groups columns

My data looks like this:

Title URL LinkType Groups Test http://Test Header Link Comms Test2d http://Test2 Header Marketing Test3 http;//Test3 Header Comms Test4 http://test4 Header Plans Test5 http://Test5 Header Link Marketing

Any help would be appreciated.Thanks

$().SPServices({
operation: "GetListItems",
async: false,
listName: "Menu",
CAMLViewFields: "<ViewFields></ViewFields>",
completefunc: function (xData, Status) {
  $(xData.responseXML).find("[nodeName=z:row]").each(function() {
    var title= $(this).attr("ows_Title");
    var groups = $(this).attr("ows_Groups");
    var LinkType = $(this).attr("ows_LinkType");

var HTMLmarkup = ''; $(".sf-menu").each(function(){

if (LinkType == 'Header') {

HTMLmarkup += '' + groups + ''; HTMLmarkup += '

    '; HTMLmarkup += '
  • ' + title+ '
  • '; HTMLmarkup += '
'HTMLmarkup += ' ';$(".sf-menu").append(HTMLmarkup);}else if(LinkType == 'Header Link'){//HTMLmarkup += '' + groups + '';HTMLmarkup += '' + groups + '';HTMLmarkup += '
    '; HTMLmarkup += '
  • ' + title+ '
  • '; HTMLmarkup += '
'HTMLmarkup += ' ';$(".sf-menu").append(HTMLmarkup);}

});

  });
}

});

});

I'm trying to build a menu from a SharePoint list but I need to group the main menus and then add links to the appropiate main menus. I have separated the links using the LinkType column if it is a header or a header with a link.

What I need help with is to get the distinct of the Group columns or how to group the groups columns.

My data looks like this:


Title   URL             LinkType        Groups
Test    http://Test     Header Link     Comms
Test2d  http://Test2    Header          Marketing
Test3   http://Test3    Header          Comms
Test4   http://test4    Header          Plans
Test5   http://Test5    Header Link     Marketing
$().SPServices({
  operation: "GetListItems",
  async: false,
  listName: "Menu",
  CAMLViewFields: "<ViewFields></ViewFields>",
  completefunc: function (xData, Status) {
    $(xData.responseXML).find("[nodeName=z:row]").each(function() {
      var title= $(this).attr("ows_Title");
      var groups = $(this).attr("ows_Groups");
      var LinkType = $(this).attr("ows_LinkType");
      var HTMLmarkup = '';
      $(".sf-menu").each(function() {
        if (LinkType == 'Header') {
          HTMLmarkup += '<li class="current"><a href=#>' + groups + '</a>';
          HTMLmarkup += '<ul>';
          HTMLmarkup += '<li><a href="#">' + title+ '</a></li>';
          HTMLmarkup += '</ul>'
          HTMLmarkup += '</li>';
          $(".sf-menu").append(HTMLmarkup);
        } else if (LinkType == 'Header Link') {
          //HTMLmarkup += '<li class="current"><a href="#a">' + groups + '</a>';
          HTMLmarkup += '<li class="current"><a href=' + title + '>' + groups + '</a>';
          HTMLmarkup += '<ul>';
          HTMLmarkup += '<li><a href="#">' + title+ '</a></li>';
          HTMLmarkup += '</ul>'
          HTMLmarkup += '</li>';
          $(".sf-menu").append(HTMLmarkup);
        }
      });
    });
  }
});
deleted 131 characters in body
Source Link
Patrick
  • 664
  • 2
  • 12
  • 26

I'm trying to build a menu from a sharepoint list as you can see below but i need to group the main menu's and then add links to the appropiate main menus.I have seperated the links using the LinkType column if is a header or a header with a link. But what i need help with is to kind of get the distinct of the Group columns or how to group the groups columns

My data looks like this:

Title   URL             LinkType        Groups

TestTitle URL LinkType Groups Test http://Test Header Link Comms Test2d http://Test2 Header Marketing Test3 http;//Test3 Header Comms Test4 http://test4 Header Plans Test5 http://Test5 Header Link Marketing

Any help would be appreciated.Thanks

$(document).ready(function() { $().SPServices({ operation: "GetListItems", async: false, listName: "Menu", CAMLViewFields: "", completefunc: function (xData, Status) { $(xData.responseXML).find("[nodeName=z:row]").each(function() { var title= $(this).attr("ows_Title"); var groups = $(this).attr("ows_Groups"); var LinkType = $(this).attr("ows_LinkType"); //For testing $("#print").append(title); var HTMLmarkup = '';
$().SPServices({
operation: "GetListItems",
async: false,
listName: "Menu",
CAMLViewFields: "<ViewFields></ViewFields>",
completefunc: function (xData, Status) {
  $(xData.responseXML).find("[nodeName=z:row]").each(function() {
    var title= $(this).attr("ows_Title");
    var groups = $(this).attr("ows_Groups");
    var LinkType = $(this).attr("ows_LinkType");
$(".sf-menu").each(function(){ if (LinkType == 'Header') { HTMLmarkup += '' + groups + ''; HTMLmarkup += '

var HTMLmarkup = ''; $(".sf-menu").each(function(){

if (LinkType == 'Header') {

HTMLmarkup += '' + groups + ''; HTMLmarkup += '

    ';    HTMLmarkup += '
  • ' + title+ '
  • ';    HTMLmarkup += '
'    HTMLmarkup += ' ';    $("".sf-menu"menu").append(HTMLmarkup); }else if (LinkType == 'Header Link'){    //HTMLmarkup += '' + groups + '';    HTMLmarkup += '' + groups + '';    HTMLmarkup += '
    ';    HTMLmarkup += '
  • ' + title+ '
  • ';    HTMLmarkup += '
'    HTMLmarkup += ' '; $("".sf-menu"menu").append(HTMLmarkup); } }); }); } }); });

});

  });
}

});

});

I'm trying to build a menu from a sharepoint list as you can see below but i need to group the main menu's and then add links to the appropiate main menus.I have seperated the links using the LinkType column if is a header or a header with a link. But what i need help with is to kind of get the distinct of the Group columns or how to group the groups columns

My data looks like this:

Title   URL             LinkType        Groups

Test http://Test Header Link Comms Test2d http://Test2 Header Marketing Test3 http;//Test3 Header Comms Test4 http://test4 Header Plans Test5 http://Test5 Header Link Marketing

Any help would be appreciated.Thanks

$(document).ready(function() { $().SPServices({ operation: "GetListItems", async: false, listName: "Menu", CAMLViewFields: "", completefunc: function (xData, Status) { $(xData.responseXML).find("[nodeName=z:row]").each(function() { var title= $(this).attr("ows_Title"); var groups = $(this).attr("ows_Groups"); var LinkType = $(this).attr("ows_LinkType"); //For testing $("#print").append(title); var HTMLmarkup = ''; $(".sf-menu").each(function(){ if (LinkType == 'Header') { HTMLmarkup += '' + groups + ''; HTMLmarkup += '
    ';  HTMLmarkup += '
  • ' + title+ '
  • ';  HTMLmarkup += '
'  HTMLmarkup += ' ';  $(".sf-menu").append(HTMLmarkup); }else if (LinkType == 'Header Link'){  //HTMLmarkup += '' + groups + '';  HTMLmarkup += '' + groups + '';  HTMLmarkup += '
    ';  HTMLmarkup += '
  • ' + title+ '
  • ';  HTMLmarkup += '
'  HTMLmarkup += ' '; $(".sf-menu").append(HTMLmarkup); } }); }); } }); });

I'm trying to build a menu from a sharepoint list as you can see below but i need to group the main menu's and then add links to the appropiate main menus.I have seperated the links using the LinkType column if is a header or a header with a link. But what i need help with is to kind of get the distinct of the Group columns or how to group the groups columns

My data looks like this:

Title URL LinkType Groups Test http://Test Header Link Comms Test2d http://Test2 Header Marketing Test3 http;//Test3 Header Comms Test4 http://test4 Header Plans Test5 http://Test5 Header Link Marketing

Any help would be appreciated.Thanks

$().SPServices({
operation: "GetListItems",
async: false,
listName: "Menu",
CAMLViewFields: "<ViewFields></ViewFields>",
completefunc: function (xData, Status) {
  $(xData.responseXML).find("[nodeName=z:row]").each(function() {
    var title= $(this).attr("ows_Title");
    var groups = $(this).attr("ows_Groups");
    var LinkType = $(this).attr("ows_LinkType");

var HTMLmarkup = ''; $(".sf-menu").each(function(){

if (LinkType == 'Header') {

HTMLmarkup += '' + groups + ''; HTMLmarkup += '

    ';  HTMLmarkup += '
  • ' + title+ '
  • ';  HTMLmarkup += '
'  HTMLmarkup += ' ';  $(".sf-menu").append(HTMLmarkup); }else if (LinkType == 'Header Link'){  //HTMLmarkup += '' + groups + '';  HTMLmarkup += '' + groups + '';  HTMLmarkup += '
    ';  HTMLmarkup += '
  • ' + title+ '
  • ';  HTMLmarkup += '
'  HTMLmarkup += ' '; $(".sf-menu").append(HTMLmarkup); }

});

  });
}

});

});

Source Link
Patrick
  • 664
  • 2
  • 12
  • 26

Buidling menu from a list - need how to group columns/distinct

I'm trying to build a menu from a sharepoint list as you can see below but i need to group the main menu's and then add links to the appropiate main menus.I have seperated the links using the LinkType column if is a header or a header with a link. But what i need help with is to kind of get the distinct of the Group columns or how to group the groups columns

My data looks like this:

Title   URL             LinkType        Groups

Test http://Test Header Link Comms Test2d http://Test2 Header Marketing Test3 http;//Test3 Header Comms Test4 http://test4 Header Plans Test5 http://Test5 Header Link Marketing

Any help would be appreciated.Thanks

$(document).ready(function() { $().SPServices({ operation: "GetListItems", async: false, listName: "Menu", CAMLViewFields: "", completefunc: function (xData, Status) { $(xData.responseXML).find("[nodeName=z:row]").each(function() { var title= $(this).attr("ows_Title"); var groups = $(this).attr("ows_Groups"); var LinkType = $(this).attr("ows_LinkType"); //For testing $("#print").append(title); var HTMLmarkup = ''; $(".sf-menu").each(function(){ if (LinkType == 'Header') { HTMLmarkup += '' + groups + ''; HTMLmarkup += '
    '; HTMLmarkup += '
  • ' + title+ '
  • '; HTMLmarkup += '
' HTMLmarkup += ''; $(".sf-menu").append(HTMLmarkup); }else if (LinkType == 'Header Link'){ //HTMLmarkup += '' + groups + ''; HTMLmarkup += '' + groups + ''; HTMLmarkup += '
    '; HTMLmarkup += '
  • ' + title+ '
  • '; HTMLmarkup += '
' HTMLmarkup += ''; $(".sf-menu").append(HTMLmarkup); } }); }); } }); });