-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'Include category folder' does not create folders #9
Comments
I suspect It's because there's no recursive lookup on the category; creating a path with two or more folders works to create the folder but reloading the chunk truncates the path to the immediate category name. |
Replicated issue on v2.5.7 |
It's not an elegant solution, but it is a solution that works for my site and allows me to have the nested directory paths preserved as I have them set for the respective category nesting in my Elements tab. I updated the staticsaver.js file in order to help me find out if the category has any parent categories. If the element has a category, then I send the category to a processor file on my site to write the category_folder variable in the staticsaver.js with what is returned from the processor. The processor file only goes a total of 4 levels deep, including the immediate category. getRequest function StaticSaver-master/assets/components/staticsaver/js/staticsaver.js
processor PHP code
|
I am finding that I have to save the element twice for the above code to work as expected because the initial save store the file in the root of the chunks directory. Subsequent saves to the element does create the nested directory structure desired and save a new file there, but you still have the original file save in the root of the chunk directory. So, you have to delete the file created from the initial save to not have duplicates on your server. |
After enabling staticsaver.include_category in the system settings, folders are not automatically created on disk. If I prefix the generated filename with "foldername/", the folder is created.
Replicated on v2.2.15 and 2.3.1
It seems that the following lines in staticsaver.js are the issue as if the condition is true only the chunk name is used:
The text was updated successfully, but these errors were encountered: