Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by rgaikema

  1. Thank you Spica! I will look into this
  2. Thank you @kongondo! My use case is to display a set of banners. Since the banners themselves are in fact small pages (containing a.html & css file, some images, and a couple of JavaScript files and sometimes web fonts), my approach was to upload a .zip file containing all these files. I made a template where I point to the uploaded folder to show the banner. I display it as an embedded iframe, for example "assets/843") and that works well, only if all the files are in the root folder of that .zip file. But sometimes there are subfolders in the .zip file where extra images, or other assets are stored and needed for the banner. You can imagine I don't want to manual adjust every banner by copying the files in the subfolder to the root and then adjust the .html and css file. So it would save a lot of time to have the ability to upload .zip files with the file structure intact, including subfolders. Any help is appreciated ?
  3. That's too bad. Is there any other way to make this work? For example with a template with http://php.net/manual/en/ziparchive.extractto.php or by creating a module?
  4. Hi all, Hopefully there's somebody who can help me with an issue while unzipping files. My goal is to show banners in a portfolio. In ProcessWire I have created a field, type 'Files', where I can upload the .zip files, one at a time. I've selected the option Decompress ZIP files, but any subfolder in the .zip somehow disappears. For example the 'assets' folder is gone after I uploaded the .zip file (see the attachment for the file structure). I'm curious, is there a way to preserve the file structure inside a .zip file after unzipping it? Kind regards, Remco
  5. Thank you @dragan! That looks like a quick solution. I will look into it and try to make it work.
  6. Hi everyone, Currently I'm struggling with a filter option and I hope somebody can help or advise me the right way to this. What I want is an index page where campaigns are shown and where I can filter the campaigns by year. Each campaign has a datetime field with the output set to "j F Y", so it shows "1 April 2016" in the frontend. The dates are unique for each campaign, but there can be multiple campaigns in the same year. The page structure is: -client --campaign-a --campaign-b --campaign-c --campaign-d This is the PHP code I use on the client page to display all the campaigns. $campaigns = $page->children("sort=sort"); foreach ($campaigns as $campaign) { if($campaign->campaign_description) { echo '<div class="campaign-description info">'; echo '<h2>' . $campaign->title . '</h2>'; echo '<p>' . $campaign->campaign_description . '</p>'; // Todo remove only for testing $campaignDate = $campaign->campaign_date; $campaignYear = substr($campaignDate, -4); echo '<i>' . $campaignDate . '</i>'; echo '</div>'; } } $campaignYear is where I see the years, 2015, 2016, 2017 and so on. Here I create the dropdown to show the unique years: if (count($campaigns)) { // Store unique Years $arr = array(); foreach ($campaigns as $campaign) { $campaignDate = $campaign->campaign_date; $campaignYear = substr($campaignDate, -4); $arr[] = $campaignYear; } $unique_years = array_unique($arr); // Show dropdown with unique years echo '<select id="campaign-date-select">'; foreach($unique_years as $year) { echo '<option value="' . $year . '">' . $year . '</option>'; } echo '</select>'; } I read a couple of articles, for example this: https://processwire.com/talk/topic/8513-sort-with-select-dropdown/ but I can't figure out how to dynamically change the output of the campaigns, based on the input of the select options. Maybe the datetime field is not the best option, or maybe I have to use URL segments and JavaScript to combine something... Any help or advise is welcome!
  7. Thanks for the replies @DaveP and @teppo. I don't have the knowledge to fix this issue. Unfortunately
  8. Hi folks, I'm trying to make a tool were I can upload zip files in the CMS and on the front you'll see the content in an iframe. The problem is that when I use the default 'file' field to upload and decompress the content of the zip, all the filenames are set to lowercase. I want the filenames that are 'zipped' exactly the same as the filenames that are decompressed in PW. Is there a way to change this?
  9. Can anybody help me to get the hashtags and mentions to work? They're shown, but not 'linked' as mentioned before. Any help would be appreciated!
  • Create New...