Developer forum

Forum » PIM » Export product URLs from PIM

Export product URLs from PIM

Jonas Nielsen
Reply

Hi,

Is there a way to export a complete list of all product URLs from PIM per language?

We need them for making redirects from our old sites to the new. 


Replies

 
Justin Sjouw Dynamicweb Employee
Justin Sjouw
Reply

Hey Jonas,

You can probably just work with the sitemaps generated by dw? Here is some documentation for dw 10: https://doc.dynamicweb.dev/documentation/tutorials/Implementing/sitemaps.html

and here for 9: https://doc.dynamicweb.com/documentation-9/content/apps/sitemaps

Cheers,

Justin

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

You can also get a good list by adding this parameter to your solution: ?showurlindex=true

That will give you a long list that you can get into excel and then edit there.

BR Nicoali

 
Jonas Nielsen
Reply

Thank you for both responses. However, it doesn't fully resolve my challenge: I need to have a reference that I can match the products against, such as a product number.

I have an Excel sheet with a couple of thousand products. Here, I have a product number and the old product URL. I would like to match this against the new product URL. Therefore, I need a list that shows the product number and the URL.

I had hoped this could be done in a query, but I don’t see "product URL" as an available option.

I hope this makes sense.

 
Jonas Nielsen
Reply

Tried the Sitemap feature, and followed the documentation, but I get this error:

File not found (XSLT: 'D:\dynamicweb.net\Solutions\Dynamicweb\T3L.cloud.dynamicweb-cms.com\files\templates\SitemapV2\SitemapV2.xslt' (/files/templates/SitemapV2/SitemapV2.xslt))

 

 
Justin Sjouw Dynamicweb Employee
Justin Sjouw
Reply

Hey Jonas, 

Then the URL index is probably the way to go. In there you will see both the path, and a querystring based url which includes the Product (and variant) ID

 
Jonas Nielsen
Reply

Unfortunately, it only displays the DW product ID instead of our product numbers. This prevents us from matching it with the products in our Excel file, which is exported from another database that contains only our unique product numbers.

 
Justin Sjouw Dynamicweb Employee
Justin Sjouw
Reply

Alright, I guess you would need to do a little excel magic then (or Access if you are more adept at that maybe) by merging two lists.

I would say

1: Put the result of the ?showurlindex=true page into an excel

2: Install the Excel Provider in the App Store

3: Create an Integration activity that will export ProductId, ProductVariantID, LanguageId, ProductNumber for all products

4: Merge the sheet from step 1 with the sheet from step 4 on the ProductId, VariantId, LanguageId (might be more tricky depending on how you work with language url's) as a key , which will  then give you both ProductId and ProductNumber in on line for all products

 

 
Jonas Nielsen
Reply

Okay, it's a bit beyond my skills with excel etc. I was hoping for a much simpler solution, where a list of product SKUs and URL could simply be generated. 

Not sure how to move on from here and we have many 1st position rankings with Google that we would like to keep

 
Michael Knudsen
Reply

Hello Jonas,

- if you use a PIM XML feed, it would be possible with a bit of XSLT to create a output to Excel where you have two columns: ProductNumber + URL.

I have with success used the msxsl script below in my XSLT:

<msxsl:script language="C#" implements-prefix="twoday">
<msxsl:assembly name="netstandard"/>
<msxsl:assembly name="Dynamicweb"/>
  <![CDATA[  
  public string friendlyUrl(string url)
  {
url = url.Replace("&amp;", "&");
string urlStr = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(url);
return urlStr;
}
  ]]>
</msxsl:script>
 
<xsl:template name="producturl">
<xsl:element name="Url">
<xsl:if test="VariantId != ''">
<xsl:variable name="varianturl" select="concat('default.aspx?ID=',$product-catalog-page-id,'&amp;ProductId=', Id, '&amp;VariantId=', VariantId)" />
<xsl:value-of select="concat($domain-name, twoday:friendlyUrl($varianturl))" />  
  </xsl:if>
<xsl:if test="VariantId = ''">
<xsl:variable name="producturl" select="concat('default.aspx?ID=',$product-catalog-page-id,'&amp;ProductId=', Id)" />
<xsl:value-of select="concat($domain-name, twoday:friendlyUrl($producturl))" />
</xsl:if>
</xsl:element>
</xsl:template>
 
Br. Michael Knudsen

 

You must be logged in to post in the forum