Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-3468

Document information shows documents for each language for childrens and backlinks

    XMLWordPrintable

Details

    • macros.vm informationinline.vm
    • Easy
    • N/A
    • N/A

    Description

      Site odo.lv has several pages (documents) which are translated in 3 languages.
      Document information tab shows several entries for the same document for each language for childrens and backlinks.

      Here is proposed workaround for /webapps/xwiki/templates/macros.vm (not optimized for speed):

      ...
      #macro(displayDocumentList $docNames $displaySpaces $blacklistedSpaces)
        #set($prevspace=true)
        #set($prevdoc=true)
        #set($documentList = $util.getArrayList())
        #foreach($docName in $docNames)
          #if($xwiki.hasAccessLevel("view", $context.user, $docName))
            #set($document = $xwiki.getDocument($docName).getTranslatedDocument())
            #if(!$blacklistedSpaces.contains($document.getSpace()))
              #if($prevspace!=$document.getSpace())      
                #set($discard = $documentList.add($document))
      	#else
                #if($prevdoc.name!=$document.name)
                  #set($discard = $documentList.add($document))
      	  #end
      	#end  
            #end
            #set($prevspace=$document.getSpace())
            #set($prevdoc=$document)      
          #end
        #end
        #if($documentList.size() > 0)
      ...
      

      Probably to speed it up informationinline.vm macro should be fixed.

      Attachments

        1. backlinks.png
          10 kB
          Ecaterina Moraru (Valica)
        2. XWiki-3468_SeleniumTest.patch
          4 kB
          Arun Reddy
        3. XWiki-3468.patch
          0.7 kB
          Arun Reddy

        Issue Links

          Activity

            People

              vmassol Vincent Massol
              valdisvi Valdis Vitolins
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: