Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/16/2014 in all areas

  1. This is a very basic guide on how to optimize a ProcessWire page for speed. It doesn’t go into the depths of optimization and perfect render paths but will provide you with some proven ProcessWire methods for faster websites. The big problems that are easy to fix are what we aim for. You want quick improvements? Then read on… First let's have a look ath the following graph. Those are the areas, we want to improve. Source: http://httparchive.org/interesting.php?a=All&l=Oct%201%202014 Clean up your HTML Look at your HTML source code. Are there any unnecessary parts? Remove anything that might not be needed and try to keep your markup as clean as possible. Avoid using too many external JS libraries or other tools. It is okay to include jQuery from a CDN, because most visitors will already have cached the file. Too many of those external requests will slow down the page. If possible, try to avoid render-blocking Javascripts and move your script tags to the end of the page, right before the body. In most cases, your Javascript will enhance your content but doesn’t need to fire before the site is rendered. Always think if you need to include another library or the fourth webfont on your site. Minify Markup The next step to save some bytes is to remove all whitespaces from your markup. It doesn’t have to look nice, it has to be loaded fast. We perform this trick with our new super-weapon: The AllInOneMinify module for ProcessWire. Install it like every other module for ProcessWire. Once activated, go to the module settings and tick the checkbox for “Minify HTML” and look at your sites source code. It should be minified. AIOM can handle conditional browser comments. If your layout depends on whitespaces you could “force” them by putting an into the markup. Optimize the CSS Now we’re heading for the next larger part of a usual website. We will combine all CSS files and then remove anything not needed (whitespace,comments) from it. Before we start, make sure your CSS files only contain rules that you really use. Especially if you’re using a framework like Bootstrap, most of the selectors are never used. Remove them carefully. We need the AllIneOneMinify module from the previous step again. After installation, open the template file where your HTML header is generated. We will now replace all stylesheet tags with a single file. AIOM needs to know all CSS (or even LESS) files, relative to your template folder. It will then output a link to a single, compressed CSS file. You might have this in your HTML head: <link href="<? echo $config->urls->templates;?>/css/grid.css "rel="stylesheet" /> <link href="<? echo $config->urls->templates;?>/css/style.css“ rel="stylesheet" /> Replace all links to Stylesheets with the single tag like this: <link href=”<? echo AIOM::CSS(array(‘css/grid.css’,’css/style.css’)));?>” rel=”stylesheet”/> You pass an array with the file names to the AIOM method CSS. It will return a link to the file. AIOM takes care of image urls inside CSS. It will detect changes in the source file and only generate a new file if necessary. While developing, you might want to turn on the “Development” checkbox in the module settings. Make JavaScript tiny Do the same as you do to the CSS to your Javascript files. First, clean up the code. Then install AIOM and compress all JS files into a single file using the AIOM::JS method that works as the AIOM::CSS method. For best results, think about including scripts like jQuery from a CDN and put your scripts below the content, before you close the body tag. Also note that the order on how your throw your JS files into AIOM might be important, depending on the code inside. Get the right image size. ProcessWire comes with great image tools. Use them, to make images exactly the size you need them. You don’t have to serve that little thumbnail with over 3000px length just because the editor wasn’t able to reduce the size. Example: Your designer wants to have a slider image with a maximum size of 600x320 pixel. To output the image with that exact dimensions, use the API accordingly: $sliderImage->size(600,320)->url; An even better way would be to use adaptive images or the new srcset attribute combined with a JS fallback. Then your site only delivers the image size as needed. Hint: Play around with the image quality setting in the config.php. Maybe you don’t need images with a JPG quality of 90+. Compress the images further with minimize.pw To make images even smaller, we can use the minimize.pw service. This service will compress images nearly lossless by using more complicated tools to reduce the size of PNGs and JPEGs. By doing this, you remove bytes from the largest chunk of your website weight. minimize.pw is free for 2000 images. Just enter your E-Mailadress and receive a free key Then you have to install the ProcessImageMinimize module and enter they key. You can now activate the option to automatically compress every image uploaded. It is fail-safe and will compress images in the background. Please note, the automatic mode only works with images uploaded AFTER you have activated the module. You can manually select image fields with the ->mz() API method. Just include it before you output the image in your template file: $myImage->width(300,300)->mz()->url; We've closed the service. You could use something similar like Imgix ( https://www.imgix.com/ ). Activate GZip compression on your site Another method to speed up your site is to activate GZip compression. The server will then send all files compressed to the client. This works with nearly all browsers and the CPU power required is minimal. You can tell your server to do this, by adding those lines to your .htaccess file in your root directory. Please take care, that you do not overwrite the ProcessWire rules in the file! For best results add them on the top of the .htaccess file: <IfModule mod_deflate.c> AddOutputFilter DEFLATE js css AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml BrowserMatch ^Mozilla/4 gzip-only-text/html BrowserMatch ^Mozilla/4\.0[678] no-gzip BrowserMatch \bMSIE !no-gzip !gzip-only-text/html </IfModule> This was taken from another forum post. Tell the client to cache stuff To make repeating visits faster, we can tell the browser to cache special files for a longer period of time. Again, add this on top of your .htaccess file: <IfModule mod_expires.c> ExpiresActive On ExpiresDefault "access plus 1 seconds" ExpiresByType image/x-icon "access plus 1 year" ExpiresByType image/jpeg "access plus 1 year" ExpiresByType image/png "access plus 1 year" ExpiresByType image/gif "access plus 1 year" ExpiresByType text/css "access plus 1 month" ExpiresByType text/javascript "access plus 1 month" ExpiresByType application/octet-stream "access plus 1 month" ExpiresByType application/x-javascript "access plus 1 month" </IfModule> <IfModule mod_headers.c> <FilesMatch "\\.(ico|jpe?g|png|gif|swf|woff)$"> Header set Cache-Control "max-age=31536000, public" </FilesMatch> <FilesMatch "\\.(css)$"> Header set Cache-Control "max-age=2692000, public" </FilesMatch> <FilesMatch "\\.(js)$"> Header set Cache-Control "max-age=2692000, private" </FilesMatch> <FilesMatch "\.(js|css|xml|gz)$"> Header append Vary: Accept-Encoding </FilesMatch> Header unset ETag Header append Cache-Control "public" </IfModule> Remember, that this caching might be annoying while developing the site. Use the internal cache (or ProCache) Another trick to make the site faster is to use a caching system. This will “store” your rendered site so you don’t have to query the database that often. We can either do this with the internal cache of ProcessWire or use the commercial, official ProCache module. Using the build-in system, you go the the setting page of a template and open the “Cache” register. You can now set the Cache time and what happens if something changes. The settings depend on the content of the site. Mostly static content can be cached longer and you might not need to reset the cache every time. Dynamic sites will need shorter cache times. ProCache (buy here) is even faster because it will bypass PHP and the database. Files are served directly as HTML. Please note, that caching might make the site faster but it can create new problems. Use with care. Summary Keep your code as clean as possible. Remove anything unnecessary and then compress HTML,CSS and JS using the AIOM module. The largest part of your page weight are images. Keep them small by using the appropriate dimensions and consider services like minimize.pw. In the end, use intelligent caching and buy ProCache. Following this guide takes not more than an hour but can speed up your site and make your visitors happy. This was just a quick overview of techniques to optimize your page speed. There is plenty of stuff you can do but the steps above are a good first step. Maybe you can share your favorite methods (or links) to start the discussion.
    14 points
  2. This week we have an event here in Nuremberg/Germany called Nürnberg Web Week. Last night was the "CMS Night" which is organized by the Joomla user group Nürnberg. In the email reminder for that event, they also mentioned ProcessWire as one topic. Also at other congresses in my area, PW is being promoted as a very flexible CMS/CMF solution. So we can hope for a bright future for PW.
    6 points
  3. I posted 2 times in another topic about the SMTP settings for Google. Here is the consolidated information from those posts: If you use a Google email address, this will work: Other major providers are setup similar (you just need to check what their SMTP requirements are - this information is easily found, otherwise ask your hosting provider for correct setup and ports) ------------- Second Post ----------------- I will & here is additional information regarding Gmail. There are specific variations that will work and sometimes people don't understand why an option is needed. These links should educate anyone on why certain settings work and others don't. https://support.google.com/a/answer/176600?hl=en http://email.about.com/od/accessinggmail/f/Gmail_SMTP_Settings.htm http://email.about.com/od/accessinggmail/qt/et_gmail_imap.htm http://email.about.com/od/accessinggmail/qt/How_to_Access_a_Gmail_Account_with_any_Email_Client_via_POP.htm
    5 points
  4. Hello Richard, Field Depedencies work with Inputfields - parent_id is not an Inputfield for the form. It is a property of the Page-object (which you cannot use). The selector string just looks like a normal selector, but it is not a normal selector. The same syntax is just used here because it feels familiar.
    5 points
  5. @Gerhard, Note I am also new to Fieldtypes so, you may want to thoroughly test/validate, etc the attached. I have customised (mainly just commenting out stuff actually ) the FieldtypeEvents to only save timestamps (1 column table). As was native to FieldtypeEvents, each timestamp on a page is saved in its own row in the DB. Although I have also included the inputfield, you have several options: disable its page visibility in the template field visibility settings; disassociate it from the FieldtypeTimestamps Class and not install it or install it and use it to also have a visual view of the timestamps. You also get the nice jquery 'delete' or 'delete all' timestamps (events). If you don't want to install the Inputfield, you will also have to comment out/remove the method getInputfield() from FieldtypeTimestamps.module. Adding timestamps via API As shown here adding items to the Fieldtype via the API is quite easy (similar code exists in the the ___processInput() method in the InputfieldEvents (in the attached this is InputfieldTimestamps). $times = array('1521884800', '1721884800', '1571884800');//these can also be other valid PHP date/times, e.g. 20-10-2007 $page->of(false); foreach($times as $t) { $timestamp = new Timestamp();//this is the Class Timestamp found in Timestamp.php. Included via FieldtypeTimestamps. $timestamp->date = $t; // note stored in column 'data' in the db of the Field $page->timestamps->add($timestamp); } $page->save(); $page->of(true); To output timestamps using API foreach ($page->timestamps as $t) { echo "<p>Date: $t->date</p>"; } Finding items via API See Ryan's example here; I didn't check if it needs tweaking. Other things to note You can change the Inputfield to show timestamps rather than the date - InputfieldTimestamps.module lines #32-33 Currently the time format is hard coded as d-m-Y in Timestamp.php line #9 Left the commented out stuff in there...you can clean them out if all goes OK FieldTypeTimestamps.zip
    5 points
  6. 150 felds ¿ mabe u sholud try.profelds wat felds.types u use ¿ repetitors.or what can postes screenshit.of tamplate sceen w.felds ¿
    4 points
  7. Are you absolutely sure your superuser is called admin? I think you can verify that in the database. Another option is creating a new superuser: $u = new User(); $u->name = "therealsuperuser"; $u->pass = "therealsuperuser123"; $u->addRole("superuser"); $u->addRole("guest"); // Don't know if this really is required $u->save();
    4 points
  8. Something like this <?php $newsItems = $pages->find("template=widgetNews"); foreach($newsItems as $newsItem) { ?> <article class="newsItem"> <h3><?php echo $newsItem->title; ?></h3> <h4><?php echo $newsItem->newsDate; ?></h4> <?php echo $newsItem->newsSummary; ?> </article> <?php } ?> Wrap each post's content in another tag which you can style separately. Here I used the article tag, but a div would work just as well.
    3 points
  9. I just want to drop a note here to publicly thank jlahijani and muzzer for lots of recent help getting several more bugs identified and fixed and at the same time mention that you should all grab the most recent version on Github (https://github.com/adrianbj/ProcessMigrator). Thanks again guys!
    3 points
  10. Personally, I would not recommend it, unless you intend to serve different content to mobile visitors. If the content is to remain the same, I would recommend using a responsive design.
    3 points
  11. Overview Mobile Detect uses a lightweight PHP class Mobile_Detect for detecting mobile devices (including tablets). Installation 1a. Clone the module and place MobileDetect in your site/modules/ directory. [OR] 1b. Download it. git clone https://github.com/justonestep/processwire-mobiledetect.git your/path/site/modules/MobileDetect 2. Login to ProcessWire admin and click Modules. 3. Click "Check for new modules". 4. Click "install" next to the new SimpleContactForm module. Usage This Module extends $config and sets the following parameters: $config->mobileDetect = array( 'deviceType' => 'deviceType (phone, tablet or desktop)', 'browser' => 'mobile browser', 'operatingsystem' => 'mobile operatingsystem', 'device' => 'mobile device' ); You can access them where ever you want. See the example below: <body class="devicetype--<?php echo $config->mobileDetect->deviceType?>"> <body class="devicetype--{{config.mobileDetect.deviceType}}"> // twig Results in: <body class="devicetype--phone"> OR<body class="devicetype--tablet"> OR<body class="devicetype--desktop">
    2 points
  12. On Goldfinger... Trivia: it was actually Ian Fleming's dislike for the architect, Ernő Goldfinger, that lead to the James Bond villain being named after him [Wikipedia]
    2 points
  13. Surely it has to be pirates? Blackbeard Calico Jack Henry Morgan Sir Francis Drake
    2 points
  14. Let's wait until PW 3.007 for this.
    2 points
  15. I do like this idea. Some of my favourite architects to throw into the mix... Bancroft Goldfinger Smithson Pasmore Luder Chamberlin Powell Bon
    2 points
  16. It's made 100% in PW and sent directly from this server using PW's WireMail interface with either Teppo's WireMailSwiftMailer or Horst's WireMailSMTP.
    2 points
  17. could you try this: $this->addHookAfter("ProcessPageEdit::buildForm", $this, "tryThis"); public function tryThis(HookEvent $event) { $form = $event->return; $content = $form->find("id=ProcessPageEditContent")->first(); $content->label = 'steve'; } sitting on the livin' room giving the baby milk, so no time to test what I wrote.
    2 points
  18. One of the things that bugs me about Wordpress is the template system: its complicated. Sure there are a zillion themes and plugins that make the system work, but deviating to any kind of custom layout opens up a can of worms as you will need to fight the underlying WP scaffolding. After trying several of the popular platforms I settled on MODx due to the open design process and template freedom. Processwire takes this freedom even further as there is less propriety system syntax. Its cleaner and more elegant. There are a lot of ProcessWire folks here who came from the front end world, knowing markup, css, adding scripts etc; but not really knowing how to code PHP. Even though I am an on again - off again beginner I now realize you do NOT need to know everything about PHP. There are the basic functions that get mixed with minimal Processwire syntax. That becomes the core dynamic elements to your custom template. These then mix with all the different Fields that makes your dynamic content come alive. Its very powerful. Not knowing PHP does increase your time investment though. Debugging issues becomes longer as the obvious errors in your work are just not so obvious. That is where this great community comes in... Good luck!
    2 points
  19. You can learn more about Hanna Code here. Basically you can use a short code like [[icon-news]] or [[icon-check]] (where icon-* could be whatever you decide) to echo out a php/html/js snippet into your ck-editor. Let's say you want to create an Hanna Code called [[icon-pen]] : <?php $path = $pages->get("/path/to/Icons/"); // or whatever selector to get the Icons page echo "<img src='{$path->icons[0]->url}'>"; // where "icons" is the name of the imagefield-multiple and [0] is the index of the icon-pen that you want to echo out ?> Now your snippet will refer to [[icon-pen]], and you can insert it inside your ck-editor. This is a very simple example and should be modified to your needs, but I think you got the idea. Another idea is that you could also create a function and have the index of the icon as a parameter to change on the fly inside your hanna code.
    2 points
  20. Just very busy days, so I'm a bit slow in response. I'd love to get more explanation! With low-level I meant deep inside the core system. High-level would be closer to the surface/front-end. Don't know if that's the right way to put it though
    2 points
  21. you can use this module to change the whole output. If this operation is recommended - there are different opinions on that. I guess it depends on your own needs. Ask two peoples and you get three answers. I use it to change the output (html structure) for a special slider, apart from this just for css assignments (responsive design, the content remains the same).
    2 points
  22. TinyMCE as the default RTE ? I'm guessing the new growth is a combination of things...2.5, RenoTheme, ListerPro, ProFields, lull from other CMS progress, friendly community. And in the background, Ryan's constant patience, enthusiasm, productivity and all round genuine positivity and transparency. At least they're my own magnets. Interested to read others interpretation.
    2 points
  23. Hello, I think it would be fun to nickname the Processwire versions like the mayor softwares (Wordpress, Ubuntu, Mac, etc). So I propose that versions should be nicknamed after scientists/inventors or cool people that make experiments because Processwire "ancestor" Dictator CMS was named after the Thomas Alba Edision's Dictator Machine. Also, nicknames could come from beer, wine or fantasy characters like Bilbo Baggins or Gandalf?. What do you think?
    1 point
  24. Actually the site/config.php in 2.5 is stripped down to almost nothing - you need to read through wire/config.php and copy any required elements from there to site/config.php
    1 point
  25. Hi Marek, I am running 2.5.4 on this profile without any issues, what kind of issues are you having? Cheers
    1 point
  26. Probably the simplest way to do this is to create a hook method or property on pages - rather than "injecting" variables into templates. The Helloworld.module file is a basic example of how to do this - example3 and example4 functions, but here is how it might look (completely untested - guide only!) Module init: $this->addHookProperty('Page::hello_world', $this, 'helloWorld'); Module function: function helloWorld($event) { $page = $event->object; if ($page->template->name !== 'my_template') return; $event->return = "Hello, world. The ID of this current page is " . $page->id; } Template: <h1><?php echo $page->title ?></h1> <p><?php echo $page->hello_world ?></p>
    1 point
  27. From the source code it looks like the title of the first tab is set by adding the title attribute to the form in buildFormContent. I can successfully overwrite that attribute with this code... wire()->addHookAfter("ProcessPageEdit::buildFormContent", $this, "tryThis"); public function tryThis(HookEvent $event) { $form = $event->return; $new_title = $this->_("Personal Info"); $title = $form->attr('title'); $this->message("Updating form title [$title -> $new_title]"); $form->attr('title', $new_title); } And I've verified (by single stepping the code) that the attribute gets overwritten and returned and even makes it through several stages of hook return. Despite this, as Martijn mentioned, it seems to be protected as it still gets rendered as "Content" even with the change. I have no idea why at the moment. Update 1: Ok, it is getting saved in an instance variable ($this->tabs[$id] = $title) and it is that variable that's being used to render the tab via WireTabs. Will need to look at hooking execute() and doing a replace on the rendered output. Not a pretty way to do it - but at least I know it should work. Update 2: Just to confirm, I have succeeded in doing this using an after hook on ProcessPageEdit::execute - but it's not a particularly elegant solution.
    1 point
  28. Hi, I am a front-end developer with only limited knowledge of PHP, currently looking for an alternative to WordPress in order to build custom websites with dynamic functionality. I have never built a site with Processwire, so my idea is to develop a test-project that reflects the typical requirements of my clients (usually small businesses) in order get an idea how the system works. These requirements typically are: - Brochure style / informational sites - Multiple, editable content areas per page - Portfolio functionality: clients want to post their products / projects with text description and images in different categories - Latest portfolio items are displayed on the front page (e.g. latest 6) - Editable slideshow on the front page (text and image) - News / Blog functionality - Latest news / blog excerpts are displayed on the front page - Custom contact forms My idea, as an example, is to build something like the following website, which combines all these typical requirements pretty well: http://www.turnerconstruction.com/ I have a couple of questions considering the described use case scenario: - How realistic is it for a front-end developer with only limited PHP knowledge to develop the required functionality with Processwire? - What time frame would you suggest for a project like this for someone who just starts with Processwire? - What is the typical workflow? Can I build the complete, static site with HTML, CSS, JS and then turn this into Processwire afterwards? I would appreciate your advice. Thanks a lot.
    1 point
  29. Looks like protected,hmmm. You could play it Dirty if you don't mind and go for AdminCustomFiles and change it with Javascript. (Don't tell anyone) But I do like to know how to change this the 'right' way.
    1 point
  30. languages: /wire/modules/Process/ProcessPageEdit/ProcessPageEdit.module translate or change "content" regards mr-fan
    1 point
  31. The emails themselves are pages in ProcessWire as well, so all the content managed just like any other ProcessWire page, i.e. https://processwire.com/about/newsletters/processwire-weekly-22/
    1 point
  32. @Martijn Thanks for the snippet. Here's the result... ...not quite what I'm after - but interesting. Enjoy your time with your little one.
    1 point
  33. The Hungarian translation files just have been updated for ProcessWire 2.5.4. This time the following three files changed: wire--modules--fieldtype--fieldtypedatetime-module.json wire--modules--inputfield--inputfieldpagetable--inputfieldpagetable-module.json wire--modules--process--processtemplate--processtemplate-module.json The translation of the 2 latest core modules were added: wire--modules--process--processrecentpages--processrecentpages-module.json wire--modules--system--systemnotifications--systemnotifications-module.json Download the full package via the ProcessWire Modules Directory: http://mods.pw/7h
    1 point
  34. So, should we made a Poll? Why not we take names from architects and inventors and choose by a democratic vote? xdd some Inventors that comes to my mind are: Nikola Tesla ~> Processwire 2.5 'Tesla' Isaac Newton ~> Processwire 2.5 'Newton' Albert Einstein ~> Processwire 2.5 'Einstein' ?? I do not know many architects though
    1 point
  35. Hadn't have a lot of time recently. Started studying. Maybe in some weeks
    1 point
  36. Thanks for the info on the ProFields Table LostKobrakai. Hopefully that functionality will be added and if not Kongondo actually provided something relevant here using the Events Fieldtype. Of course that module is just a starting point Ryan offered to the community. I will be ordering ProFields Table shortly. I appreciate the link Kongondo. Ryan does state that the single table is technically faster, but it is good to know the difference is minute. His explanation brushed away any concerns as I approach 700,000 pages.
    1 point
  37. For a little page with less images i've set a couple of images in a pagetree called images with ebers image=page (one image per page) so the file can change but the link stays...imagemanagment would be done easy on the pagetree or a special adminpage. Take a look - should work with icons, too since icons are images....mostyl. https://processwire.com/talk/topic/7836-cant-wait-first-project-with-pw-nearly-finished/ Hanna code works for shure! but if you wanna use the PWImage Chooser you can work with this one and the modification of the startingpoint for Images like there: https://processwire.com/talk/topic/7439-processpageeditimageselect-hook-and-change-default-page/ Regards mr-fan
    1 point
  38. Ah, I understood it in the English sense - low-level means basic and high-level means advanced. So 'deep inside the core system' means high . OK, I'll try get some time soon to expound on what I said in the post above yours
    1 point
  39. Hi bber, this look kind easy to do (if I understand correctly what you need). Personally I would create a page called "Icons" and then put inside an imagefield (multiple) to store all the icons I need, then create several Hanna codes to echo those icons out. So when an icon will be changed, all its instances in the ckeditor would get updated. Does it make sense?
    1 point
  40. Yes, it was one time error. But since it was written in "red" I assumed it was an error. Thank you for clarification.
    1 point
  41. Working on it. Want it online asap, but can't assign enough time to it at the moment. But hoping for the coming weekend to make a huge step forward.
    1 point
  42. ...Thats the great thing of this technic.... The URL = the PAGE example real world: your file (page) = link to the file name is www.your-site/downloads/your-file.doc there you count the download, process the check for an entry or a value, and deliver the file. Nobody gets the file url in assets!! you asign the assetsfile to a pageurl so the url for the download = the url for the page not the file itself..... hope i could write it clear? EDIT: You could even change/update the file without changing the downloadurl Your have a filepage called "terms" = name of the page with the filefield gets may a terms-2014.pdf in it......next year you could delete the termns-2014.pdf and change it to 2015-terms-new-file.pdf -> the link stays always at your-site/downloads/terms.pdf....
    1 point
  43. Thanks for your detailed answers. This leaves me with a really positive impression about the dedication of the Processwire community. Something that is unfortunately missing in the WordPress ecosystem. I will start building my templates and and then step by step incorporate Processwire-functionality. I keep you posted during this process and ask you for advice when I should get stuck. Thanks again. Great support.
    1 point
  44. Welcome to the forums! You can set it as the default in your config.php file: $config->defaultAdminTheme = 'AdminThemeReno'; User's can change between themes from their edit profile page.
    1 point
  45. @Steve, Just to answer my own question about how the search for the 'indexed key' would work [database side of things] - this could either work the way PW handles repeater fields - data stored as comma separated integers (1234, 5688), i.e. $size,$variation ID pages respectively as you suggested, or why not store them as PW multiple page fields - i.e. a row for each addition, consisting of page id (integers) i.e. E.g. assuming Red = ID 1124, small = 2545 and medium = 2745 $variation $size $amount 1124 2545 $20 1124 2745 $10 On the inputfield side of things, the user will still be able to see a table similar to the one I posted above that would grow both vertically and horizontally with each new addition of size and variation...Of course horizontal growth could get very messy very quickly...
    1 point
  46. @kongondo, I like the thinking but you never know when an extra X will get added to a size; particularly medium. In other words, I suspect the table would need to accept changes in either dimension. How about simply concatenating the x and y variable to give a key that can then have a simple value stored against it? So you'd end up with a table that had an indexed product page id, an indexed "key" and an "amount" column. The function to make the key would just do something like... function makeKey($size, $variation) { $size = wire()->sanitizer->name($size); $variation = wire()->sanitizer->name($variation); $key = "$size/$variation"; return $key; }
    1 point
  47. Nicknaming versions after after great architects would be fitting, e.g. "ProcessWire 2.5 'Gehry'"
    1 point
  48. There are really cool additions to processwire nowadays, which allow database backup and upgrades from admin. They can make upgrading even an easier process. I have to say that I had some issues with restoring the upgrades on a not so up to date MySQL server (so i decided to go with phpMyAdmin exporting for now). Have not tried the "core update" module, but the video looks really promising.
    1 point
  49. 1 point
  50. $form = $forms->get("reconocimientos"); echo $form->render(); $form->get("reconocimientos")->addHookAfter("processInput", null, 'hookEmail'); A couple things to mention about the above code (quoted from above). You are adding a hook after the render(). You would need to add the hook before the render. That's because processInput is triggered from render(). Secondly is that you are hooking the wrong thing, as I don't think there is a 'processInput' method on $form (since it's not an InputfieldForm). What you'd want to do instead would be this (in your form-builder.inc file): wire()->addHookAfter('FormBuilderProcessor::processInput', null, 'hookProcessInput'); function hookProcessInput(HookEvent $e) { $processor = $e->object; if($processor->formName != 'reconocimientos') return; $inputfields = $processor->getInputfieldsForm(); // your code here. }
    1 point
×
×
  • Create New...