Pergunta

I was wondering if it is possible to somehow create a new itemstyle which has a link to the library where the items in the content query is located?

Example:

  1. First ListItem
  2. Second ListItem
  3. Third ListItem
  4. Fourth ListItem
  5. Fifth ListItem

View all items <-- this being the link to the library

Is this possible?

Foi útil?

Solução

Just add the anchor tag with a dynamic link to the bottom of your itemstyle xsl and then wrap it with an xsl:if statement to check the position to see if the last list item is last.

<xsl:if test="position() =last()">
   <a href="link.aspx">View all items</a>
</xsl:if>

If you want to make the href dynamic, find a source for the link in your XML somewhere and use:

<a href="{@source}">View all items</a>

You may have to use XSL to remove formatting after a certain character to achieve the path to the libary from another link

Licenciado em: CC-BY-SA com atribuição
Não afiliado a sharepoint.stackexchange
scroll top