If I have a product "Pottery 2 (Tuesday 1:45pm-2:45pm) 2011/S1" with a path: /products/enrichment-2011-12-fall/pottery-2-tuesday-1-45pm-2-45pm-2011-s1
The csv file export path is: /admin/store/reports/getcsv/who_bought_pottery_2_tuesday_145pm245pm_2011s1/1
How do I derive the "pottery_2_tuesday_145pm245pm_2011s1" from the title and/or path programatically? The end result is I will be re-writing a views display field to show this link. It looks like spaces become underscores, and dashes and slashes are dropped? What other rules?
Thanks,
Todd
Comments
Comment #1
cayenne commentedI am embarrassed to say that I do not recall. I inherited this code from the original author and it just works. It makes use of another chunk of code's path generation. It also includes security so that one cannot guess the csv path and get all that good data unless one is logged in as the correct user.
I have, for my own uses, adapted the code to display a list of buyers in an arbitrarily-created format, with their attributes. That could be csv. Would that be helpful?