Leaderboard
Popular Content
Showing content with the highest reputation on 01/14/2016 in all areas
-
Seems you got your modules confused This is the module you want: https://github.com/ryancramerdesign/MarkupLoadRSS. MarkupLoadRSS: It reads feeds. http://mods.pw/W What you have above (part of the core) is: Markup RSS Feed. It generates feeds. Install #1 and you should be fine. I tested your code and it works.2 points
-
While reading the code I noticed the suffix options in the Pageimage class. It seems some settings are added as suffix but not all. So my workaround for now is: $url1 = $image->size(100, 100)->url; $url2 = $image->size(100, 100, array('upscale' => false, 'cropping' => false, 'suffix' => array('noupscsale', 'nocrop')))->url; Resulting in: image.100x100.jpg image.100x100-noupscale-nocrop.jpg2 points
-
Whaa? ....I used Win10 for about 30 minutes and couldn't stand it. Switched back to 72 points
-
This should work: $sortedPages = $pages->find('selector'); $prevPage = $page->prev($sortedPages); $nextPage = $page->next($sortedPages);2 points
-
Finally, our site is live. It's a quite small, straightforward site with not much use for a CMS as of yet. However, as we will grow we might need easy ways to easily add or exchange content. Comments welcome. If you see anything strange, please let me know. I didn't optimize the hell out of it, but a 98/100/97 in PageSpeed is not too bad. Oh, I didn't use any front end framework or npm module. I thought this might be a little too much overhead for a site like this. I still need to minify my stuff, and there is room for optimization - but I really tried to keep my CSS lean. Don't look at the selectors though Modules used: * MarkupSEO * ProcessHannaCode * WireMailSMTP * SimpleContactForm * MarkupSitemapXML * TextformatterVideoEmbed On the technical side, this site runs on a small DigitalOcean VPS (1 CPU, 1GB RAM) with nginx and PHP 7. This is the first site I made that uses HTTP/2. And here it is: https://studio8.productions1 point
-
Right now this doesn't seem to work: $url1 = $image->size(100, 100)->url; $url2 = $image->size(100, 100, array('upscale' => false, 'cropping' => false))->url; This is because a filename like image.100x100.jpg is created for both settings. Is there a workaround for this? If not, maybe an additional MD5 hash of the settings could be added to the filename: image.100x100.d8e8fca2dc0f896fd7cb4cb0031ba249.jpg ?1 point
-
No, its not a bug. CroppableImages's UI was made before the crop functionality was introduced. CroppableImages was planned to add more functionality and better space usage to the UI, therefore it was not build on top of the core images UI. Thus truncate the path to all further updates / changes to the core image. It would be really cool if someone of the guys who are building the new images UI also could (re)build the croppableimages UI back to use the default one only with the additional buttons for the crop, after the core UI image is finished.1 point
-
I think it is possible to change the language of the datepicker with javascript: http://jsfiddle.net/repw4/418/1 point
-
Sorry, my bad for not thinking my answer through. setlocale() has no effect on PHP's date() formatting, it only influences strftime(). Thus, you can use it to change how the formatted value of a PW field looks if it uses a percent encoded format fitting for strftime, but not the input format that is active when used as a form field. So I'm not aware of any way to make native PW date fields locale aware.1 point
-
One piece of suggestion also from my side the yellow font color in the content with the white background is hard to read because your yellow color is too light.1 point
-
Woohoo! They're definitely on a drive to get people updated across the board even if this announcement didn't specify OS. It's got to be expensive to keep supporting old stuff. Now can Apple just end support for Safari next? All versions? Found a load of Safari-only quirks in a site I'm working on at the moment and it's doing nothing for my mood1 point
-
1 point
-
This is interesting https://www.wordfence.com/learn/2015-wordpress-security-survey/ It is an annual survey of 7000 plus members of the Wordfence community. I was particularly drawn to this line in the conclusion at the bottom: Since many clients coming to PW might well be coming from WordPress, this survey might be useful in client presentations.1 point
-
Where else would someone post a question like I did, and in the same day find people gathering around the subject and build a new module that solves the problem? This forum feels like actually being in a room filled with people who know their stuff and are willing to help a brother out.1 point
-
I managed to successfully change my default language Everything went quite smoothly, except for some strange errors that I desribed above and which might be related to my particular environment. Here my complete function for swapping a language with the default language. Instructions for necessary steps after swapping languages are included. <?php function swapLanguages($pages, $lang) { $startTime = microtime(true); $langDefault = "default"; $log = ["languages" => "Swap field values for language {$langDefault} with {$lang}", "pages" =>[]]; $languages = wire("languages"); // get languages $l1 = $languages->get($langDefault); $l2 = $languages->get($lang); foreach ($pages as $p) { $log["pages"][$p->id] = ""; $fieldlog = " name"; $p->of(false); // swap page names $nameDefault = $p->localName($l1); $name = $p->localName($l2); if($nameDefault != $name && !empty($name)) { $p->set("name",$name); $p->set("status$l2",1); $p->set("name$l2",$nameDefault); } elseif($nameDefault != $name && empty($name)) { $p->set("status$l2",1); $p->set("name$l2",$nameDefault); } // iterate through all fields and swap multi language field values foreach ($p->template->fieldgroup as $field) { if($field->type instanceof FieldtypePageTitleLanguage || $field->type instanceof FieldtypeTextareaLanguage || $field->type instanceof TextLanguage) { $fieldlog .= " {$field->name}"; // var_dump($p->$field); // needed this for some pages otherwise they threw an error // $p->of(false); // needed this for some pages otherwise they threw an error $langDefault = $p->$field->getLanguageValue($l1); $lang = $p->$field->getLanguageValue($l2); if( $langDefault != $lang && !empty($lang) && !empty($langDefault) ) { $p->$field->setLanguageValue($l1, $lang); $p->$field->setLanguageValue($l2, $langDefault); } elseif( $langDefault != $lang && empty($lang) ) { $p->$field->setLanguageValue($l2, $langDefault); } elseif( $langDefault != $lang && empty($langDefault) ) { // only needed this for pages that got created through API and had no default lang value set $p->$field->setLanguageValue($l1, $lang); } } } try { $p->save(); $log["pages"][$p->id] = "Swapped values in fields: {$fieldlog}"; } catch (Exception $e) { $log["pages"][$p->id] = 'Error: ' . $e->getMessage(); } $p->of(true); } // write logfile $logfile = fopen(wire("config")->paths->logs . "swaplanguage-log.txt", "w") or die("Unable to open file!"); $iterator = new RecursiveIteratorIterator(new RecursiveArrayIterator($log)); foreach($iterator as $key => $value) { fwrite($logfile, "$key => $value\n"); } fclose($logfile); $time_elapsed = microtime(true) - $startTime; echo "Finished after {$time_elapsed} seconds"; } /* Usage: // swapLanguages($pages->find("template=basic-page, parent=1, include=all"), "de"); // argument 1: pages array // argument 2: language name that you want to swap with the default language // A log file will be written to site/assets/logs/swaplanguage-log.txt. // It contains page IDs and fields that were swapped for each page */ /* // After executing this function for all required pages, following steps are needed: // 1. load core translation files for the language that is now your default (e.g. german translation files) to Setup->languages->default // 2. change titles of the default Language to your language (e.g. Deutsch) and the language that got swapped (e.g. English) // 3. if default language was English before swapping: delete core translation files for the language that you swapped // 4. if default language was not English before swapping: load the core translation files for that language // 4. in settings for home page, change the URL for your default language and the language that you have swapped. // Example: // Before swapping: default was en, swap language was de // After swapping: default is now de, swapped language is now en */ The function will swap page names and the contents of multi-language fields TextAreaLanguage and PageTitleLanguage. If any of you know a more generic way of checking whether a field is multi language, other than if($field->type instanceof FieldtypePageTitleLanguage || $field->type instanceof FieldtypeTextareaLanguage) that would be great. The function is also available as swap-languages.php gist. EDIT: Added field type TextLanguage to the fields that will be processed.1 point
-
There are usually 2 menu types on most sites. Let me generalise here a bit. You've got the top navigation which tends to be global. It's on every page and usually accompanies the company logo. Then you've got the side navigation which is contextual or based on the section the user is currently within. I'm assuming you're asking how you your client can pick which links / pages are used on the top navigation? Create a field called top_navigation or something meaningful to you and your clients Set it to Type=Page type (Basics Tab) Make it Multiple Pages (Details Tab) Assign it PageListMultipleSelect+ win the Input field type (Input tab) Finally, associate this naviagtion field with a template. You can just assign it to the homepage or you could create a new page called Site Settings or Navigation. Just tell your client this is the place to manage their top menu. Here's a screengrab of how it should look.1 point
-
You could also set a $session variable at the top of every page (or header.inc) and then call that. $session->prevPage = $page; Courtesy of Diogo, 2 years ago https://processwire.com/talk/topic/1257-non-admin-users-login/?p=112501 point
-
Does it not make sense to expose the sort field via the API? Front end example would be drag and drop sorting of user uploaded images. Having this order saved and mirrored in PW Admin would be ideal.1 point