cancel
Showing results for 
Search instead for 
Did you mean: 

Add categories in share details view

titanikoktf
Champ in-the-making
Champ in-the-making
Hi everybody,

I am trying to extend the details view adding some of my aspect and properties changing the file documentlist-min-js. I have done succesfully when I add some custom properties but I am not able to add categories.
In custom aspect I have done this:
if(typeof(record.scFuente) != 'undefined'){
desc += '<div class="detail">';
desc += '<span class="item"><em>' + scope.msg("details.modified.on") + '</em> ' + $date(record.modifiedOn) +  </span>';
desc += '<span class="item"><em>' + scope.msg("details.modified.by") + '</em> ' + $userProfile(record.modifiedByUser, record.modifiedBy) + '</span>';
desc += '<span class="item"><em>' + scope.msg("details.version") + '</em> ' + record.version + '</span>';
desc += '</div><div class="detail">';
desc += '<span class="item"><em>A+o de publicacion</em> ' + record.scAnopublicacion + '</span>';
desc += '<span class="item"><em>Tipo documento</em> ' + record.scTipodocumentos+ '</span>';
desc += '<span class="item"><em>Fuente</em> ' + record.scFuente + '</span>';
desc += '<span class="item"><em>Proyecto/Producto/Empresa</em> ' + record.scProyectoproductoempresa + '</span>';
desc += '</div><div class="detail">';
desc += '<span class="item"><em>' + scope.msg("details.description") + '</em> ' + $links($html(description)) + '</span>';
desc += '</div>';
}

And the code for adding tags is:
tags = record.tags;
desc += '<div class="detail"><span class="item tag-item"><em>' + scope.msg("details.tags") + '</em> ';                     if (tags.length > 0)
{
     for (i = 0, j = tags.length; i < j; i++)
      {
       tag = $html(tags[i]);
       desc += '<span class="tag"><a href="#" class="tag-link" rel="' + tag + '" title="' + tags[i] + '">' + tag + '</a></span>' + (j - i > 1 ? ", " : "");
       }
}
else
{
     desc += scope.msg("details.tags.none");
}

I am not able to change this code for showing the categories. Anybody gets this thing!

Thanks in advance and sorry about my english.
Best regards!

Jose A. Lopez
3 REPLIES 3

titanikoktf
Champ in-the-making
Champ in-the-making
Anybody has done it?? Anybody can help me??

Thanks in advance and regards!

titanikoktf
Champ in-the-making
Champ in-the-making
Hi again!

I am trying to change in documentlist-min.js this code


tags = record.tags;
desc += '<div class="detail"><span class="item tag-item"><em>' + scope.msg("details.tags") + '</em> ';
if (tags.length > 0)
{
    for (i = 0, j = tags.length; i < j; i++)
         {
               tag = $html(tags[i]);
               desc += '<span class="tag"><a href="#" class="tag-link" rel="' + tag + '" title="' + tags[i] + '">' + tag + '</a></span>' + (j - i > 1 ? ", " : "");     }
}
else
{
         desc += scope.msg("details.tags.none");
}

Using this other:


categories = record.categories;
desc += '<div class="detail"><span class="item tag-item"><em>' + scope.msg("Categorias:") + '</em> ';
if (categories.length > 0)
{
    for (i = 0, j = categories.length; i < j; i++)
             {
                 category = $html(categories[i]);
                desc += '<span class="tag"><a href="#" class="tag-link" rel="' + category + '" title="' + categories[i] + '">' + category + '</a></span>' + (j - i > 1 ? ", " : "");
        }
}
else
{
     desc += scope.msg("details.tags.none");
}

But it is not working properly! The search if you click in one of the categories is not working well.
How can I use it??????

Regards and thanks in advance!

mikeh
Star Contributor
Star Contributor
Copy the code from repo-documentlist.js. Or get 3.5.a which has category support for Site-based document libraries already.

Thanks,
Mike