Jump to content

Leaderboard

Popular Content

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

  1. This week we've got a new dev branch version with several updates which we'll merge to master soon. This post also includes a useful recipe on how to log all outgoing emails sent from your site. https://processwire.com/blog/posts/processwire-3.0.38-core-updates/
    6 points
  2. Actually both methods will run automatically, there's already another module for executing cron via webvisitors (Lazycron or something like that). So both methods will run automatically depending how task is defined at crontab (etc. /etc/crontab), the lazy option is targeted for users who just need to run some basic tasks and the pro option is targeted for users who want to do more. I'm gonna write a better instructions but it's still on todo
    5 points
  3. This is a single page for an old farmhouse deep in the Black Forest, which you can rent for seminars or as a weekend getaway. When visiting the site first you can slide through three full sized background images. To access the main content you can either click the logo, the toggle icon or the container. The content mostly consists of accordion elements, but in the section nächtigen there is also an calendar (using the new Google Calendar Markup module) and an reservation form included. www.langenbachhof.de Modules used: ProCache PageTable Extended Google Client API Google Calendar Markup Markup Sitemap XML Tracy Debugger Email Obfuscation Regards, Andreas
    4 points
  4. Thanks for the confirmation @Zeka. I have created a Github issue and suggested your fix. The problem can be worked around for now using the size() method with cropping set to false. $my_image->size(400,400, array('cropping' => false)); @horst, the weighten feature in PIA is cool.
    4 points
  5. @majake I did a bit of sleuthing and I think your website may be using the Spex module. http://modules.processwire.com/modules/spex/ I don't think this module is very widely used (it doesn't come up often in the forum) so there may not be many members here who can help you with it. But check out the links above and that may point you in the right direction. One more thing - your site seems to already have an RSS feed with the same content you are trying to output: http://www.roofcoonline.com/blog/rss
    2 points
  6. I love the new Foundation for Emails. If you are using the sass version, it is super easy to set up and start coding. You really don't even have to mess with tables etc as the stack takes care of parsing all of that when you "foundation build". I did a test the other day in litmus with multiple columns etc and I had no issues across the board.
    2 points
  7. This is a very beta version of the separate functions I use to generate srcset/bgset markups. There's some similar functions floating around in the forum but this one is a bit different because you can set "named image sets" which you can use easily site-wide. It's definitely work-in-progress so use it at your own risk. MarkupSrcSet Generate srcset and bgset markup for lazysizes. Features generate srcset/bgset markup for lazysizes set image sizes in JSON array add required JavaScripts automatically (optional) fallback to smallest image size if JavaScript is not available Usage Image sets JSON (in module settings): { "hero": [ [640, 210], [1080, null], [1920, null] ], "featured-image": [ [360, 240], 1.333, 2.667 ], "gallery-thumb": [ [240, 120], [480, 300], [800, 576] ] } Image methods $image->srcset(): <img <?php echo $page->featured_image->srcset('featured-image'); ?>> $image->bgset(): <div <?php echo $page->images->first()->bgset('hero'); ?>>Lorem ipsum</div> https://github.com/rolandtoth/MarkupSrcSet
    1 point
  8. Hi, We made a little help tool for implementing cron to processwire. Basically the module has two options to run module methods under cron: Lazy method: Just add simple config line to configuration field where you specify module, method and time delay Pro method: Just hook to our method and do everything you want Getting started should be relative easy, just install module and add line to configuration field (MyModule;MyMethdo;+10 minute). Delay accepts strtotime formats. http://modules.processwire.com/modules/pwcron/
    1 point
  9. A small website for the Black Forest based filmmaker Markus Ketterer. You can discover his portfolio or get more informations about him by clicking the logo. Each film page can contain two film stills and two behind the scenes pictures. The transitions between the pages were made with Barba.js (thanks to @LostKobrakai for mentioning it). www.luchs.digital Modules used: ProCache ColorPicker Markup Sitemap XML Tracy Debugger Regards, Andreas Update: This website doesn't use ProcessWire anymore.
    1 point
  10. Or just untick "Enable CSS source maps" in the Console settings (F1 in the Console).
    1 point
  11. I'd rather like to see the reference to the map being removed from the css file. Sass maps are there for development, but not for production usage.
    1 point
  12. Hello BrendonKoz, I would create a field f.e. date and add it to the needed templates. There is no need for the module mentioned above in my opinion. Although every page has an internal published field since PW 2.6.16 and I think you could change it through the API, I wouldn't recommend it, because it is used for internal uses. A separate field would be more cleaner and you could also easily change the field or the published dates, if you would like to. But that is jus my opinion. Regards, Andreas
    1 point
  13. Hello bcartier, I don't know, where you did get the published_date but in the API reference there is: Source: http://processwire.com/api/ref/page/#pw-methods-common Regards, Andreas
    1 point
  14. As far as I tested it, this GitHub pull request should fix the bug when using the module with PW 3.0.32+: https://github.com/kongondo/MenuBuilder/pull/30
    1 point
  15. Hi franciccio, I'm an italian guy like you. You can install processwire locally with MAMP (link) if you are on a Mac or with WAMP (link) if you work on a Pc.
    1 point
  16. @majake - I suggest you remove the config info in your previous post for the sake of security. You don't want to be posting your DB username/pass etc in a public forum. A couple of other ways that "main.php" might be appended: 1. The file is pulled in with an include in your RSS template. Probably not as I expect you would have noticed this. 2. It would be unusual, but I suppose the file could be appended in a hook. So you could try this: In your RSS template, insert this: <?php $no_main = true; ?> And at the first line of "main.php" (or whatever the file is called that contains your header/footer markup): <?php if(isset($no_main) && $no_main) return; ?> Edit: actually, could you post the contents of your RSS template file? That will help get to the bottom of the problem.
    1 point
  17. Hi @majake and welcome to the PW forums. I haven't used this module before, but I think you're right about the problem being related to a "delayed output" strategy. There is probably a template file being auto-appended to your RSS template - typically this would be called "main.php", "main.inc" or something similar. The instruction to auto-append this template file will be in your site config: probably in the /site/config.php file unless your site is using the ProcessWire Config module that stores additional config settings in separate JSON file. If there is a template file being auto-appended you should see a checkbox to disable this for the RSS template: Setup > Templates > rss (or whatever your template is called) > Files tab
    1 point
  18. @Robin S Thanks for creating an issue, but I not sure that my fix is covering all cases. Maybe somebody from more experienced members can check it.
    1 point
  19. Your web server should be configured to have a single canonical domain to avoid fragmentation of SEO and analytics, and your sitemap should use it. If the "www" version of the domain is canonical, requests for sitemap.xml will be redirected to that domain and the generated links should match. The module simply uses the value of $page->httpUrl. ProcessWire's .htaccess file includes directives for Apache to set a canonical domain, but they are commented out by default. Look around line 123: # ----------------------------------------------------------------------------------------------- # 13. OPTIONAL: Redirect users to the 'www.' version of the site (uncomment to enable). # For example: http://processwire.com/ would be redirected to http://www.processwire.com/ # ----------------------------------------------------------------------------------------------- # RewriteCond %{HTTP_HOST} !^www\. [NC] # RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    1 point
  20. Thanks. I use nginx, but I get the idea.
    1 point
  21. @gRegor - not sure if you already tried the Admin Help module, which is basically a documentation system that runs inside PW admin; one of the sub-modules is a process module that displays all of the documentation in an accordion page view...
    1 point
  22. You nearly had it $results = $pages->find("template=name-of-child-template, sort=parent.field-on-parent-template");
    1 point
  23. @blommie: I'm not sure JsonNativeField is going to fit your bill. While it supports an arbitrary number of entries, those are key => value pairs, much like regular fields with a name and value. You might want to look at the ChosenSelect Inputfield, which behaves as a tagging field and allows creating new "tags" (which are actually PW pages behind the scenes with the tag value as the title) on the fly if you enter a new name. Repeater and Page field types don't need you to have the pages used in them to already be present in the system. A page is just an entry in a table in the database, and if you use repeaters, the template configuration for these pages is even done behind the scene when you define the repeater field's parts (fields). If you're coming from other systems, the concept of using "full-blown" pages for simple data might seem a bit much, but because PW keeps things simple under the hood, it actually doesn't get much leaner database-wise.
    1 point
  24. Hi, I am developing a site where I need to sum a specific field value across a large number of pages selected with a selector string. For example, I am keeping track of the stock of specific products. The stock is influenced by various stock movements. I have a template for stock movements, with fields "product" (Page type) and "quantity" (Integer type). Currently, I am searching for the pages and adding the quantities in two different steps: // For a given $product $movements = $pages->find("template=stock-movement, product=$product, quantity!=0"); $stock = 0; foreach ($movements as $movement) { $stock += $movement->quantity; } This is fine, but I am doing this very often, and I would like to improve the performance of this calculation, since the quantity of stock movements can grow very large. To do this, I was thinking of using the SUM function offered by MySQL to achieve similar optimizations as what is achieved by the $pages->count() function. Ideally, this would translate into a $pages->sum() function that could be called as follows: // For a given $product $stock = $pages->sum("template=stock-movement, product=$product", "quantity"); I have tried looking through the code of the Pages, PageFinder and DatabaseQuerySelect classes in the core to get some inspiration, but I fear that I don't understand well enough how the query mechanism works to be able to adapt it to create the function mentioned above. Could anyone help me with this? Thanks a lot in advance, Eric
    1 point
  25. Hi everyone, I have just updated this module to support insertion of Hanna codes, and renamed it to DynamicDescriptionNotes. It passes the $page (for the current page being edited) and $field (for the $field where the Description or Notes text is referencing the Hanna code, so you can use $page and $hanna->field in your Hanna code to refer to these. This opens up lots of possibilities for dynamic content. Please let me know if you have any problems or suggestions. A big thank to @Robin S for the awesome idea! PS, It's now available from the modules directory: http://modules.processwire.com/modules/dynamic-description-notes/
    1 point
  26. Does using dedicated module files help a lazy programmer? For a private helper module I wanted to built, I decided to use the possibilities of dedicated files (implemented in PW 2.5.5) and not to write all into a single module file. Until now, I totally missed or forgot about this possibility. To my excuse: on introduction I may have thought not to use it early in my modules to keep backward compatibility. And then totally forgot about it. I allready use a tool for postprocessing in my sites. And I'm not familiar with all those popular node/grunt/gulp/npm/bower/and-what-else stuff out there. It looks to me a bit oversized for small to medium websites. But I also wanted not miss a comfortable, easy to use config for less and sass files, especially for those from frameworks like Bootstrap 3 / 4 or UIKit. So, what my toolbox should get added was a preprocessor (compiler) for sass (.scss) files first. I choosed the UIKit for the first shot. The created files for a configurable module called PreAndPostProcessor and a process module called ProcessPreProcessor were: PreAndPostProcessor.module PreAndPostProcessor.info.json PreAndPostProcessorConfig.php ProcessPreProcessor.module ProcessPreProcessor.info.json ProcessPreProcessor.css ProcessPreProcessor.js As you can read about the differences to the old-schooled style in Ryans blog post, I focus on what I found out to be most useful for me. Starting with the Config file, I decided to use the $this->add() method in the __constructor(). It is the way what needs less code to define your inputfields for a configpage: just a collection of arrays with field or fieldset definitions. Mandatory definitions are: type, name, label. Others are optional: description, notes, required, columnWidth, collapsed, showIf, ... And, of course, you need the definitions specific to your fieldtypes (value, options, ...). To group some fields into a fieldset, add a key called "children" to the fieldset array and add all field definitions to it as collection. Simple! Another nice thing I discovered, is the use of the *.info.json files. So, this I have used before, but not like here. The behave is like with the *Config.php files, - you write really less code, just arrays with key - value pairs and PW does the rest for you! Only difference here is, that you have to write it in JSON notation. The ProcessPreProcessor.info.json file contains the neccessary and common parts: title, version, requires. And some others: permission, permissions, page and nav. Page and nav are specific to Process modules. With page {name, parent, title} you define where PW should create you a page in the admin, and with nav, you can define a complete submenu for this page. For those who are yet not familiar with the internal structure of Processmodules: you can navigate to a submenu entry by calling it: {pw-admin-url}/{main-module-url}/{submenu-url}/. Calling the main menu url invokes the ___execute() method of the module. Calling a submenu url invoke the ___executeSubmenu() method. This all is really simple and straight forward. And it is really really helpful in cases like with the new toy for my toolbox. The nav is a collection of arrays, each holding at least an url and a label. Thats enough for PW to implement the menu and submenu for you in the admin. But you also may define an icon too. Aaaand, you also can add your own custom key / value pairs to it. PW does not complain on it. I have added a description. The nav was generated by parsing all core distribution scss files from the UIKit. They have a name and description in their first two lines. I programatically read this out and generated this nav notation for the info.json file: The (main) ___execute() method of the ProcessPreProcessor.module should present a submenu list with file infos. This now could be done by parsing the info.json file: public function ___execute() { // generate a navigation $dump = json_decode(file_get_contents(dirname(__FILE__) . '/' . basename(__FILE__, '.module') . '.info.json')); $nav = $dump->nav; $out = "\t\t\t<dl class='nav hnpp'>\n"; foreach($nav as $obj) { $out .= "\t\t\t\t<dt><a href='./{$obj->url}'>{$obj->label}</a> ></dt>\n"; $out .= "\t\t\t\t<dd>{$obj->description}</dd>\n"; } $out .= "\t\t\t</dl>\n"; return $out; } To make it even more friendly for lazy devs, , I created one method that is called from all sub-execute methods by simply passing their own name over into this function that loads and parse the scss file and displays its config page: The first version work out nicely. Here is a screenshot of it: ... and to answer the initial question: Yes, it does!
    1 point
  27. Thank you nik, for that code. I am using it and it works quite well. Only thing that needs to be changed is the while from while (count($results) > $limit); to while (count($results) = $limit); Otherwise it loops 1 more time than it should.
    1 point
  28. Email is responsive by default.
    1 point
×
×
  • Create New...