Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/21/2016 in all areas

  1. Hi all, I am new to ProcessWire module development. Just recently getting back to using PW again after a couple of years away from it. I was looking for a SASS/SCSS/Compass pre-processor module for PW and couldn't find any. The closest I could find was AllInOneMinify but it doesn't do SASS/SCSS. I decided to make this module (with heavy inspiration from AOIM). This is a pretty basic module that takes one or more sass/scss/compass file(s) and compile them automatically in your template. Github link https://github.com/lesaff/ProcessWire-Sassify I really appreciate any comments, suggestions, bug fixes, etc. Hopefully this is the first of many modules. Thanks Rudy Note: Added to Modules directory, under http://modules.processwire.com/modules/sassify/
    10 points
  2. Speaking of bad bot blockers, I've had great success with Jeff Starr's robust "6G Firewall" for Apache: https://perishablepress.com/6g/
    3 points
  3. Check the owner and permissions on site/assets/* And if you want to learn more server stuff, there are a book and a video tutorial series on https://serversforhackers.com/
    2 points
  4. v067 is up, containing the image titles for the image select dialog and other fixes/updates: new option to FileFieldTweaks: show image titles in image select dialog custom paths for admin.css, admin.js and CKEaddons assets AdminTweaks: remove max-width constraint from modals AdminTweaks & RenoTweaks: added tweak "Highlight pagelist rows on hover" fix for templateEditLink not showing up (default theme) removed ScrollFix submodule
    2 points
  5. Strange that it isn't working for you. Line breaks work fine in CKEditor for me, even with ACF and HTML Purifier on and without having to add "br" to Extra Allowed Content. Can you test on another PW installation to see if line breaks are working there? Also, are you entering line breaks in CKEditor using Shift+Enter or are you pasting in source code?
    2 points
  6. Both things are not really php specific, but more common oop concepts. They're certainly not pw specific. http://php.net/manual/en/language.oop5.typehinting.php http://php.net/manual/en/internals2.opcodes.instanceof.php
    2 points
  7. I pushed an initial (testing) version of TemplateFileHelper to bitbucket. https://bitbucket.org/pwFoo/templatefilehelper/src/ The autoload module extends TemplateFile instances with API vars $layout and $view $layout -> global layout instance of TemplateFile to set layout placeholders ($layout->set(...) or global scripts / styles. $view -> current page instance of TemplateFile to set the current page placeholders and current page scripts / styles. load() method Load a template / view with additional controller (php) file as subTemplate. Returns a TemplateFile object to render / output Each sub-template controller have access to API Vars and $subTemplate (current TemplateFile instance, $subTemplate->set('placeholder', 'My value...')). Load site/templates/chunks/test1.php controller and site/templates/chunks/test1.tpl view: $part = $view->load('chunks/test1'); echo $part->render(); chunks/test1 example <?php // chunks/test1.php - controller $subTemplate->set('var1', "Subtemplate variable output..."); <!-- chunks/test1.tpl - view --> <div><?=$var1?></div> scripts / styles properties FilenameArray like $config->styles | scripts. It should help to organize scripts / styles with ajax in mind (global / current page only). // current page script $view->scripts->add('js-file.js'); // global / layout script $layout->scripts->add('js-file.js'); You have to handle the output yourself by two foreach loops inside your _layout.php / _layout.tpl files (non ajax calls scripts and styles should be in layout head section). foreach ($layout->scripts as $globalScript) { ... } foreach ($view->scripts as $currentPageScript) { ... } IntercoolerJS module will take care about async / ajax handling of (custom page) scripts and styles. hook Page::render hook after page render to load and add the global layout. The current page template (PW template file == controller) just handle the currents page code / view. Global layout / controller / view is moved to separate files (default: _layout.php controller and _layout.tpl view). Just use $layout->set(...) to fill the _layout.tpl placeholder variables inside the _layout.php controller file. configurable module Some settings are available... Global layout (view + controller) file name (default: "_layout") Current page content variable (used inside of the _layout.tpl view to output current page content, default: "currentPageContent") View file extension (default: ".tpl") Controller file extension (default: ".php") It will be a dependency of the planned IntercoolerJS module which adds ajax page calls, async scripts / styles handling (current page scripts and styles...) and need a defined template handling to work...
    1 point
  8. Hello Andy, actually this is not an issue, because the body-tag, like many others, is optional and can be stripped out to reduce the markup: Source: https://www.w3.org/TR/html5/syntax.html#optional-tags Ryan's blog post about the HTML minification of ProCache: http://processwire.com/blog/posts/processwire-2.6.9-core-updates-and-new-procache-version/#major-enhancements-to-html-minify-capabilities Regards, Andreas
    1 point
  9. You can even just do $pages->find ..... when bootstrapping in PW 3
    1 point
  10. @Peter Knight - Hi Peter. There's no limit on that front. Current module shows all of them on the single page. At the time, I thought to myself that if jumplinks are used effectively, then pagination won't even be needed. Doing the same thing for JL2.
    1 point
  11. Media Manager version 006 (released 21/09/2016) Happy to announce the latest release of Media Manager. Changelog mmlink: A CKEditor link plugin (cloned and adapted from pwlink thanks @ryan) lets you insert links to the media in your Media Manager Library directly into the Rich Text Editor (RTE). (Instructions on how to setup are similar to those of mmimage as shown in this video. Where it says MMImage/mmimage please replace with MMLink/mmlink respectively, thanks). The plugin is in the folder MediaManager/plugins/mmlink. Please note that currently it is not possible to edit a link's attributes (e.g. rel, target and title). However, a title is auto-inserted in the link (the respective media's title. Please download latest release of the module from the link in your purchase confirmation email. Let me know if you encounter any issues, thanks. @TODO: Multi-tagging of media Documentation (thanks for being patient with me guys...)
    1 point
  12. Just wanted to say - great module I am looking forward to when I can use it on PW3.
    1 point
  13. First thing to check is whether those requests look natural, even if just to rule out the off chance of a DDoS attack and stuff like that. Tons of requests to a specific page and usually something uncacheable (like search page with the same search term every time) is a telltale sign that someone is intentionally bombarding your site. It's also good to check where those requests are pointed at: if there's a lot of traffic to a specific part of the site at the same time when issues start, the problem might be related to that part too. Or it could just mean that a specific piece of content is extremely popular Most properly configured and resourced servers should be able to handle bot traffic with ease. There's the possibility of a misconfiguration and the settings of Apache, MySQL, PHP, etc. can always be tweaked in order to handle traffic spikes better, but if the root cause is that you're being harassed, there are other (and more efficient) ways to handle that.
    1 point
  14. It's weird if I refresh the page it doesn't seem to do any good unless I reload via clicking the site title. BUT thank YOU flydev, that seems to be the trick indeed! Good lookin' out. (If anyone does observe my layout still misbehaving please do inform me.)
    1 point
  15. The changes I made will only affect the console - it's just a matter of whether the encoding change breaks anything else. I checked the pageNameUTF8 sanitizer (because it was the issue that you had with that which resulted in the change that deleted "+" signs) and that still works great, so hopefully we are good
    1 point
  16. can anybody tell me what is wrong with this code? $i = 1; while ($i <= 10) { echo $i++; } it works inside a template file, but inside the console it leads to endless 100% cpu
    1 point
  17. Well if they get used to the pencil icon then when wil they learn the default PW workings? There's an issue in the module: its SettingsJS.js is added not only in the module's page but every (admin) page and asmList items get the "pencil" icons. Of course clicking on them do nothing, apart from this error: SettingsJS.js:50 Uncaught TypeError: Cannot read property 'undefined' of null Setting line 42 to this fixes it: if ($this->wire('user')->isLoggedin() && $this->input->get('name') == __CLASS__) {
    1 point
  18. This post is in response to some queries I received about Media Manager. I will be improving the documentation in the next couple of weeks. 1. Edit media details 2. Automatically publishing media on upload
    1 point
  19. Thoughts on the new manager page?
    1 point
  20. Since PW 3.0.21 (2.8.21) you can use: echo count($page->getLanguages()); in your case: if (count($page->getLanguages()) > 1) { $markup = ''; foreach($page->getLanguages() as $language) { if ($language->isCurrent()) continue; $markup .= "<li><a href='".$page->localUrl($language)."'>".$language->getLanguageValue($language, 'title')."</a></li>"; } echo "<ul>$markup</ul>"; }
    1 point
  21. Just to be clear: it's not required to install a language pack. A language pack is nothing more than strings already translated. ProcessWire will not depend on that, it will always use the default if a translation if missing. Do you have lots of data already? If you don't, you can do the following: On setup > languages 1 - Change 'default' language title to Danish 2 - Change 'da' language name to 'en' and its title to English In every page, copy the content from one language tab (on every field) to the other. (yeah, I know...) =========== You can also use the module Migrator to export everything to a json file, open it and find/replace things there (I never tried, though)
    1 point
  22. Good to find this thread. Was kicked out every few seconds, loading slow ... while working via Hotel WLAN Cookie settings? Changing the browser didn't help ... $config->sessionFingerprint = false was the goal. thanks a lot Adrian
    1 point
  23. I don't think this will fix all of your problems (or maybe even any!), but I found I had to set: $config->sessionFingerprint = false; Otherwise I was being asked to login again every few minutes. Might be worth trying.
    1 point
  24. Thanks for your post. What you are doing looks right, except that you can skip creating the Pageimages field. PW would rather do that internally. So this is the entirety of what you should do (after you have your $page object): <?php $page->images->add("path or URL to image"); $page->save(); If you are doing this from a template file (as opposed to a shell script or admin module), you have to turn the output formatting off first, as you saw. This is to ensure that you don't accidentally add runtime-formatted content to a page and save it. By "runtime-formatted", I mean entity encoded, markdown, etc. This example might better explain it: <?php $mypage = $pages->get(123); echo $mypage->title; // value is "Products & Services" $mypage->setOutputFormatting(false); echo $mypage->title; // value is "Products & Services" Now lets say that you did this instead: <?php $mypage = $pages->get(123); $mypage->title = "Great " . $mypage->title; $mypage->save(); If ProcessWire let you save that page, the 'title' field would now have this value the next time you viewed it: Great Products && Services Basically, PW only wants to save content in an unformatted "clean" state. It throws that error asking you to set output formatting OFF in order to protect against you corrupting your content. So to follow up from the first example, this is what you should do if you are doing this import from a template file: <?php $page->setOutputFormatting(false); $page->images->add("path or URL to image"); $page->save();
    1 point
×
×
  • Create New...