Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/08/2017 in all areas

  1. Couldn't you create a new "Fieldset in Tab" and place the desired fields within the tab when editing the template?
    4 points
  2. Hi @Peter Knight 1. You can use MarkupSEO, just change type of needed field to multilanguage text/textarea ( seo_title, seo_description etc.) 2. I think yes. Can't remember if I had some issues. 3. All of my sites are multilingual and I never had a need to use a separate tree for every language. You can switch off multilanguage support on template level (Advanced tab) and there is module that lets you control whether multi-language support is enabled at the page / branch level. 4. Yes. You should read about hreflang. Also, there is "What should happen when this field's value is blank?" option in field settings. Usually, I don't inherit values from default language, because in that way I can get duplicated content ( not good for SEO ). Image and files fields are multilingual through language-alternate values
    2 points
  3. Have you declared namespaces in your templates files?
    2 points
  4. https://processwire.com/api/ref/session/redirect/ https://stackoverflow.com/questions/3923904/preventing-form-resubmission https://stackoverflow.com/questions/6320113/how-to-prevent-form-resubmission-when-page-is-refreshed-via-php
    2 points
  5. Don't know if other problems referred to above are related, but I'm having trouble in Chrome on OS X Yosemite, where, after uploading (and client-side resizing) a good number of images, there seems to be a memory leak or maybe Chrome not releasing memory or something. Sequence/symptoms are - Everything works fine for a number of uploads. Next handful of images seem to work - thumbnail is shown under spinner - but image saved is all black. Mac display starts corrupting and needs a restart to fix. Same image that didn't work above now works fine. This has happened a few times, so does seem repeatable. I'll do some more testing and try other browsers (haven't done yet), and if anything pops up I'll report back.
    2 points
  6. @ngrmm It's never a good idea to override somehing in the core or in a third-party module because if you update it your changes are overritten again. I updated the module and added an option in module settings to set the limit. @Tacolombardi <?php $events = $modules->get('FacebookEvents')->getEvents(); ?> <ul> <?php foreach ($events as $event): ?> <li> <?=$event['name']?> <img src="<?=$event['cover']['source']?>" alt="<?=$event['name']?>" /> </li> <?php endforeach; ?> </ul>
    2 points
  7. I cannot reproduce. No probleme to run setlocale() from config.php. This cannot cause such a problem. Did you use the same database for your fresh install? Or is the database still there? In case of complete crash access directly to the database via phpMyAdmin, adminer or any other mysql administration tool and export the database first as .sql or zipped sql file to have a backup. Do you have a tool like this in use? You can make also regularly backups of your database via cronjob: http://modules.processwire.com/modules/cronjob-database-backup/ File permissions checked? Really no backup of the uploaded files?
    2 points
  8. @cosmicsafari, as a general starting point you can get a clue of an API property name by looking at the input name in the PW admin using your browser dev tools.
    2 points
  9. I guess the SQL LIKE operators can recognise an escaped quote and treat it as such, whereas the other operators cannot. So that leaves you a bit stuck if you must use those other operators because you'll always have a potential clash of quote characters if you cannot escape quotes.
    2 points
  10. Solved!!! Answer was in the .htaccess file. Remove reference to robots.txt being a physical file on the system. #RewriteCond %{REQUEST_FILENAME} !(favicon\.ico|robots\.txt) RewriteCond %{REQUEST_FILENAME} !(favicon\.ico)
    2 points
  11. Adds a Service Worker to your Processwire site which can be customised. The service worker script itself is heavily based on Jeremy Keith’s work – thank you Jeremy! More information: https://github.com/johannesdachsel/processwire-serviceworker
    1 point
  12. Where do i get? From here: https://github.com/IDT-media/IntegerAutoIncrement What does this do? Adds additional option to Fieldtype Integer to make it auto increment. How to use? Simply install this module, Create / Modify Field that is Integer, set auto increment on/off. Enjoy!
    1 point
  13. In the blog post that introduces the $pageimage->maxSize() method, it is described like this: But when I use maxSize() in PW 3.0.37 I do get a cropped image. I have an image that is 1200x600 and if I do $my_image->maxSize(400,400)->url I get an image that is cropped 400x400 when I think it should be uncropped 400x200. Can anyone confirm? I'm sure this method used to work properly as described.
    1 point
  14. I can confirm that sorting by repeater count does not work. Seems like a bug to me, considering that it's possible to sort by Page Reference count and PageTable count and those are quite similar fieldtypes. @Tom., maybe open an issue on GitHub?
    1 point
  15. Howdy @Thorsten, and welcome to the forum! The only thing I can think of in my limited experience is since it is a different server maybe the rewrite in htaccess is not correct. If throwing this exception worked on a previous server, and now does not work on a new server, that leads me to believe there is something out of whack with the new server. Others more knowledgeable will be along shortly to help further. Again, welcome to the fold.
    1 point
  16. Don't know if it should be possible to do this or not, but one workaround might be to have a field on the page to hold the count, and update it automatically on page save. You can set the field (say awards_count) to not show in the admin, so it will only be maintained by a simple hook function. It's really easy to do... Add a new field awards_count to the appropriate template (I'll assume work based on your question) and set it to not show in the admin (Admin > Fields > awards_count > Input > Visibility > Hidden (not shown in the editor) Add a hook in /site/templates/admin.php something like this <?php namespace ProcessWire; /** * Admin template just loads the admin application controller, * and admin is just an application built on top of ProcessWire. * * This demonstrates how you can use ProcessWire as a front-end * to another application. * * Feel free to hook admin-specific functionality from this file, * but remember to leave the require() statement below at the end. * */ $pages->addHook('saveReady', function($event) { $pages = $event->object; $page = $event->arguments(0); if($page->template == 'work') { $page->awards_count = $page->awards->count(); } }); require($config->paths->adminTemplates . 'controller.php'); And that should do it! Then you can do sort=-awards_count using the new field instead of the count property.
    1 point
  17. I am reading through replies, but wanted everyone to know as of one hour ago, I was able to reload backup from a couple of days ago. Thankfully my server configuration was set up to do this automatically. I'm new to this journey, and I will always be more careful. In fact, I am finally convinced I should have the following workflow: virtualized local configuration matching server config > commit to git local > push git to cloud > upload changes to live site.
    1 point
  18. In another thread Ryan said: Might be something in the discussion that helps:
    1 point
  19. +1 Something else must have happened too "about at the same time". Setlocale is used so that the system can handle certain utf-8 characters properly when uploading files. What sort of characters does your client use when naming files to be uploaded? Maybe you set it to en_US.UTF-8 and soon after they uploaded something not supported in this character set? I think it is quite unlikely to be the issue. You might want to figure out what else could have happened.
    1 point
  20. Hi @tpr, I spotted an issue with the position of the InputfieldPageListSelect restore icon when the inputfield's width is not the last/only inputfield in a row: I fixed it with this: html.aos .InputfieldPageListSelect { position:relative; } .aos_pagelist_unselect.restore { right:0; transform:none; -webkit-transform:none; }
    1 point
  21. This is my second project based on processwire. I love it. Please share your meanings http://baumaschinen.guru
    1 point
  22. Please have a good read on this topic, too.... http://ohmspeaker.com/speaker-filter/?length=27 seems matching your needs a little bit, too. regards mr-fan
    1 point
  23. $(this).closest(".card-footer").siblings(".card-reveal").toggleClass("show");
    1 point
  24. Regarding the filter options in the sidebar, I see a few approaches... 1. Foreach the search results This will not be efficient and personally I would rule it out. But the idea is that you iterate over all the pages in the search results PageArray and build up an array of unique categories that have been selected in the result pages, then you build your filter options from it. 2. Use the Connect Page Fields module Say you have the categories from the wireframe above (there are probably more but the principle is the same): Style, Frame, Surface. The child pages (the category options) use the templates "style_item", "frame_item", "surface_item". Your product template is called "product" and contains three Page Reference fields for selecting these categories named "style", "frame", "surface". You create a Page Reference field "selected_on" which allows the template "product" for selectable pages. You add this field to the templates "style_item", "frame_item", "surface_item". In the Connect Page Fields module config you make three connected field pairs: "style" <=> "selected_on", "frame" <=> "selected_on", "surface" <=> "selected_on". In your search results template you get the related categories with something like this: // find search results $results = $pages->find($your_selector); // get categories that have been selected in these results $related_categories = $pages->find("has_parent=/selects/product-categories/, template!=blank, selected_on=$results"); // build your filter from the related category pages... If you are limiting/paginating your result items (which you probably will be) you could use a separate $pages->findIDs() query to get just the IDs for use in the $related_categories selector. 3. Use SQL to query the tables of the category Page Reference fields You'd need a solid understanding of SQL for this approach. See this post for the general idea of how to query a field's table:
    1 point
  25. I sounds like what you are trying to build is a multi faceted search that updates the filters and results depending on what the user has chosen or typed. I think you are on the right track with the setup you've described, using the Page reference field to apply the categories to each product. The challenge will be how you build the logic of what to show / hide depending on the filters, and combine this into a usable experience. Most of the solutions I've seen are a combination of javascript logic in the front-end that connects to search results via an API. This project called instantsearch.js is a library of UI widgets for building these type of instant-search multi filter type experiences - unfortunately it only works with a commercial hosted search service (algolia), but it may give you some ideas on how to build your solution (some kind of javascript + api combination). This e-commerce example looks similar to what you are trying to build… https://community.algolia.com/instantsearch.js/examples/e-commerce/
    1 point
  26. Hi, I would consider taking a closer look at this one: Product variations are challenging to implement properly.
    1 point
  27. For that kind of system I'd probably go with laravel spark.
    1 point
  28. Help yourself... ;-) 1 - apache user id inside my container docker exec processwire /bin/sh -c "id www-data" # uid=33(www-data) gid=33(www-data) groups=33(www-data) 2 - I create my directory site (pw/site) mkdir site chown -R 33:33 site mkdir modules mkdir assets chown -R 33:33 modules chown -R 33:33 assets cp site-default/config.php site/config.php chown -R 33:33 site/config.php cd site-default/ ls assets finished.php install ready.php config.php init.php modules templates cd .. cp site-default/finished.php site/ cp site-default/ready.php site/ cp site-default/init.php site/ cp -r site-default/install site/ cp -r site-default/templates site/ After that, everythink is ok with http://192.168.2.2:82/install.php
    1 point
  29. Hi @teppo, I recently started using this great module. Tracy is picking up some error notices when opening a page containing a Repeater in Page Edit. PHP Notice: Trying to get property of non-object in ...\VersionControl\ProcessVersionControl.module:658 This seems to be due to the field names ($field) containing a "_repeater1234" suffix so wire('fields')->get($field) does not find a match and returns null.
    1 point
  30. Session lock is added finally. I also make a pull request to netcarver's SessionHandlerRedis. Once it is done I will close this one and move to that one probably. FYI: phpredis is undergoing a pull request to add their session lock.
    1 point
  31. I was referring to google moving toward the https preference; a secure site is preferable to it's non-secure counterpart. Also, the www prefix became redundant a few years back and isn't necessary any longer. The dns record accounts for those users who still use it. You have two separate web sites with two separate domains, or is this what you were referring to with www.domain.com pointing to one site, while domain.com points to the other? Depending on your hosting provider, there are configuration files specific to a domain located somewhere. I run unbuntu on my laptop (LAMP) and debian (LAMP) on my production server. Apache is using sites-available/sites-enabled structure to hold the virtual config files. My non-secure (http) virtual config looks at requests on port 80 (non SSL) and redirects to https. This is where I was getting confused. You mention both protocols (http and https) point to the same content, but you also mention how to modify the code used for both sites. Is it two different sites serving the same content? Having separate registrars and separate hosting providers is only a management issue for you (or whomever is responsible) by having to log in to different accounts to manage the information. Purely as an option, you could eventually consolidate your domains under one registrar, and even place all the domains on one hosting account.
    1 point
  32. A. If we stay in our separate installation per site realm we still have a number of options to do what you want: Use multi-instance mode from the main site. Get data from chapter sites via web service, REST, ... GraphQL... or maybe just RSS or Atom. B. You can always go for putting everything in one installation and configuring access rights for editors with something like this or this too, but probably that'll make it only more complicated. C. Finally you can go for writing a custom frontend admin for you chapter site editors while staying in the comfort of a single installation)) But that will take some time and sweat to do. I do not know the scope and budget of your project. Might be a decision worth considering.
    1 point
  33. It seems like chapter sites are to be rather independent, though alike. So you probably would like to have them each in separate installation (with different databases). [Relatively simple stuff] To speed up the creation of a new chapter site you can develop a site profile and start each new one with it rather than from one of the default ones. But this way you will still have each site with non-connnected-to-other-sites files and will have to handle the updates to the site files separately. [More advanced further...] You can run the sites from the common core though (see here, option 1), so you will have to update the core only once for all of the chapter sites. [Try at your own risk] If the chapter site will have really the same template structure and will differ only with the database-stores content you could symlink all site/templates and probably site/modules folders to one common place. But you will still have to manage changes made in admin area one by one... [That is only for the record. Never done it myself] Or use something like this or this.
    1 point
  34. Welcome to the forums, @future_vision! Please provide more details to get a (hopefully) good answer (an advice applicable to any question. I know)) Should the chapter sites have their own domains/subdomains or they will be all on one? Do you need to manage access control to chapter sites or they will be managed by a single person/group of people? How different/similar would the chapter sites be? Maybe even paste the chapter and the main site structure outlines. The question seems too general, I suggest we narrow it down a bit.
    1 point
  35. @nabo, I think you can just do some Pageimage resizing method on the last item in the field, which will be the image you just added. $product->setOutputFormatting(false); $product->images->add($file_url); $product->save(); // create variation of image $product->images->last->size(400, 300); // whatever resizing method you want
    1 point
  36. Another option would be: $page = $siteB->wire(new Page());
    1 point
  37. Hi @Marc Not tested $siteB = new ProcessWire($path, $url); $siteB->pages->add('skyscraper', '/skyscrapers/atlanta/', [ 'title' => 'Symphony Tower', 'summary' => 'A 41-story skyscraper located at 1180 Peachtree Street', 'height' => 657, 'floors' => 41 ]); https://processwire.com/api/ref/pages/add/
    1 point
  38. How about a Buy-a-Coffee too? We need options!
    1 point
  39. Here's how you might dynamically create it with ProcessWire without tinkering with .htaccess files. Create a new template, call it robots, and set its URLs > Should page URLs end with a slash setting to no, and Files > Content-Type to text/plain. You should tick disable Append file and Prepend file options as well. Optionally set its Family > May this page have children to no, and Family > Can this template be used for new pages to one. Family > Optionally Set allowed templates for parents to home only. Create a new page under homepage, set its template to robots, and name as robots.txt. Create a new template file at /site/templates/robots.php, inside it you type <?php namespace Processwire; // render different robots.txt depending on your own conditions. if ($config->debug) { // use PHP_EOL to create multiline strings echo <<<PHP_EOL User-agent: * Disallow: / PHP_EOL; } else { echo <<<PHP_EOL User-agent: * Disallow: PHP_EOL; } and done. You should be able to see robots.txt at the url /robots.txt.
    1 point
  40. Hi @Robin S I can confirm that this method has unexpected behavior. Not sure, but I think that this: public function maxSize($width, $height, $options = array()) { $w = $this->width(); $h = $this->height(); if($w >= $h) { if($w > $width && $h > $height) { return $this->size($width, $height, $options); } else { return $this->maxWidth($width, $options); } } else { if($w > $width && $h > $height) { return $this->size($width, $height, $options); } else { return $this->maxHeight($height, $options); } } } should be public function maxSize($width, $height, $options = array()) { $w = $this->width(); $h = $this->height(); if($w >= $h) { return $this->maxWidth($width, $options); } else { return $this->maxHeight($height, $options); } }
    1 point
×
×
  • Create New...