Creating Shadow links

This page is Work in Progress! Keep following up...

A Shadow overlay is typically opened through a link.

As everything in Quanta is a node (including users, roles, statuses, etc.) you will find out that 99% of the cases you don't have to create a new Shadow form: it will be sufficient to use the default node manipulation qtags (ADD, EDIT, DELETE) and deciding widgets and components to display accordingly.

However, if you are doing something special and you decide you want to create a custom link, you can do it by using javascript, and implementing the openShadow function: 

// Edit Node link behavior.
$('.edit-link').off('click').on('click', function(e) {
    // TODO: select default components in a hook.
    var components = (($(this).attr('data-components') != undefined) ? ($(this).attr('data-components').split(',')) : ['node_form', 'file_form', 'manager_form', 'access_form', 'status_form']);
    var shadow = {
      module : 'node',
      context: 'node_edit',
      widget: $(this).data('widget'),
      components: components,
      node: $(this).data('rel'),
      redirect: $(this).data('redirect')
    };

    if ($(this).data('language') != undefined) {
      shadow.language = $(this).attr('data-language');
    }

    if ($(this).data('manager') != undefined) {
      shadow.manager = $(this).attr('data-manager');
    }
    openShadow(shadow);
    e.preventDefault();
});