Let me know, Max, if you still need a .zip archive which cannot be opened on a Mac. I have one made with Zip 0.7.1 running on an ExpressionEngine 1.6.8 install which will not open on a MacBook Pro running Mac OS X 10.6.3. I was able to open it with the third-party app, The Unarchiver, but that isn’t ideal.
Have you experimented with alternatives, Mark? Any that will open on Macs?
After using The Unarchiver to open the .zip, I compressed the unzipped folder using the built-in archive feature on Snow Leopard.. The difference in file size was a mere 8 KB – that is 152 KB for the MX Zip version and 160 KB for the Snow Leopard compressed version.
Now that I’m at the stage of my project where I use this, beyond just confirming the archives will unzip properly, I’m running into a dead end.
I’m trying to use MX Zip to create a bundle of PDF files. The bundles are compiled through the PDF Group weblog. The PDF Group contains one FF Matrix 1.3.5 field – {content_pdf_menu} – which uses a Playa 3 dropdown menu – {pdf_file} – to pull the PDFs from a separate PDF weblog where individual PDF files are uploaded via the nGen File Field.
The code I have below works – that is it goes to the {content_pdf_menu} and archives the PDF file from the {pdf_file} drop down. However, it only archives the last item. That is, in my PDF Group entry, I have three PDF files: one.pdf, two.pdf, and three.pdf. When I loop through the FF Matrix / Playa field, only three.pdf is zipped.
In the top block, the code which generate the PDF, you’ll notice I also use the Find and Replace 1.3 plugin to remove the leading slash from the directory name. I found that if I don’t use that plugin what is returned is a 22 B (yes, byte) zip archive which expands into a zip.cpgz document.
The second block outputs a list of the three PDF files stored in the FF Matrix. Since the top block does archive a related entry, sourced from the FF Matrix / Playa combination, I’m guessing this is an error that results from MX Zip not handling loops very well?
exp:weblog:entries weblog="pdf_group" limit="1" disable="categories|member_data|trackbacks"}
{content_pdf_menu} {!-- FF Matrix --}
{exp:zip direct_output="no" folder="pdf/bundles" filename="{url_title}.zip" store_full_path="no"}
{pdf_file} {!-- Playa custom field within FF Matrix --}
{zip:files}
[{exp:replace find="/pdf" replace="pdf"}{content_pdf}{/exp:replace}]
{/zip:files}
{/pdf_file}
{/exp:zip}
{/content_pdf_menu}
<a href="/pdf/bundles/{url_title}.zip">Download Bundle</a>
{!-- output list of PDF files contained within the {content_pdf_menu} field frame --}
{content_pdf_menu}
{pdf_file}
{exp:replace find="/pdf" replace="pdf"}{content_pdf}{/exp:replace}
{/pdf_file}
{/content_pdf_menu}
{/exp:weblog:entries}try to change your code this way
exp:weblog:entries weblog="pdf_group" limit="1" disable="categories|member_data|trackbacks" parse="inward"}UPDATE and did you try to change this way?
{!-- FF Matrix --}
{exp:zip direct_output="no" folder="pdf/bundles" filename="{url_title}.zip" store_full_path="no"}
{content_pdf_menu}
{pdf_file} {!-- Playa custom field within FF Matrix --}
{zip:files}
[{exp:replace find="/pdf" replace="pdf"}{content_pdf}{/exp:replace}]
{/zip:files}
{/pdf_file}
{/content_pdf_menu}
{/exp:zip}Max, thanks again for helping out…
Same outcome in both cases, just one file was archived. Only difference was which file was archived… in your version the first item was the one zipped; in mine it was the third item. Adding the parse=inward parameter to the exp:weblog:entries tag didn’t alter the output in either version..
sorry, I was little bit disoriented with tags, try this way
{exp:zip direct_output="no" folder="pdf/bundles" filename="{url_title}.zip" store_full_path="no"}
{zip:files}
{content_pdf_menu}
{pdf_file} {!-- Playa custom field within FF Matrix --}
[{exp:replace find="/pdf" replace="pdf"}{content_pdf}{/exp:replace}]
{/pdf_file}
{/content_pdf_menu}{/zip:files}
{/exp:zip}Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.