DocIcon for PDFs and upload multiple text

Forums vLooup for SharePoint DocIcon for PDFs and upload multiple text

Viewing 5 reply threads
  • Author
    Posts
    • #7387
      t614
      Participant

      Hi Alexander,

      I ran into an issue with DocIcon as a column in vLookup, it shows a blank white page for PDFs instead of the usual Adobe icon (I added the icon myself: http://support.microsoft.com/en-us/kb/832809)

      It is pointing to the generic icon: /_layouts/images/icgen.gif
      Instead of what shows in the document library: /_layouts/images/pdf16.png

      I was also wondering if this could be a feature in the future, or how to add it to the current one:
      Having an option to hide or remove the “Upload multiple files” text when using the add button from the parent. This is counter intuitive if pre-populating since upload multiple skips the edit page, resulting in a bunch of files with no association.

      Thanks!

    • #7389
      Alexander Bautz
      Keymaster

      Hi,
      By default vLookup expects a gif icon for pre SP2013 and png icon for SP2013 when handling PDF files.

      Does this explain the issue?

      Regarding the upload multiple issue: are you using SP2010?

      Alexander

    • #7394
      t614
      Participant

      I am using SP2010,

      I replaced the png with a gif, updated the xml and restarted iis, the gif is showing in my normal document folders but still getting white generic icon in the vlookup areas

    • #7395
      Alexander Bautz
      Keymaster

      Oh, I forgot – the vLookup script will sense the pdf document type, but will try to add a link to an icon named “icpdf” of type gif for SP2007/10 and type png for SP2013.

      If you change the name of your icon to icpdf.gif it should work.

      If this is cumbersome, you can override the function that puts in the icgen icon like this (put this below where you include the vLookup script):

      spjs.vLookup.imgErr = function(img){
      	if(spjs.$(img).attr("src").match(/pdf\./)){
      		spjs.$(img).attr("src","/_layouts/images/pdf16.gif"); // ensure the path is correct
      	}else{
      		spjs.$(img).attr("src","/_layouts/images/icgen.gif");
      	}
      }

      Hope this helps,
      Alexander

    • #7396
      t614
      Participant

      That did the trick, renamed the icon to icpdf and they look great!

      Now I just have to figure out the upload multiple files.., I was able to remove it from all document libraries(from the uploadx.aspx in layouts) but really I just need it for the one being used with vlookup so I reverted the change for now.

    • #7397
      Alexander Bautz
      Keymaster

      Hi,
      The only way I can think of is to add this code to the master page of the site – put it at the BOTTOM, right before the closing </body> tag:

      <script type="text/javascript">
      	if(location.pathname.toLowerCase() === "/_layouts/upload.aspx"){
      		if(GetUrlKeyValue("List").toLowerCase() === "4c886136-1a92-4e8f-bf80-17880df177ab"){ // Change GUID to match your library
      			document.getElementById("ctl00_PlaceHolderMain_ctl01_ctl05_UploadMultipleLink").style.display = "none";
      		}
      	}
      </script>

      Change the path “/_layouts/upload.aspx” to include any subsites – like “/sites/mysite/_layouts/upload.aspx”, (note that the url is in lower case letters) and change the GUID to the library. You may also want to check that the ID of the upload link is correct.

      Hope this helps,
      Alexander

Viewing 5 reply threads
  • You must be logged in to reply to this topic.