Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/30/2016 in all areas

  1. Aligator (wip) Processwire Module to render a nested tree starting from a single root or an array of pages. Aligator is similar to MarkupSimpleNavigation but has a different approach of how to define the markup for your menu. It doesn't assume any markup or classes. It's up to you to define them where needed. It's less plug and play and requires some more advanced knowledge of ProcessWire, as some additional setup and coding is needed. But allows for powerful and easier customization without using hooks. Aligator uses callback functions to achieve this. Additionally a selector can be used to filter the children for your navigation. Note: This module is a fun project trying to find simple configurable method to render navigations. It's a work in progress and there might be major changes to how the module works. See further infos and examples on the repository: https://github.com/somatonic/Aligator
    15 points
  2. Haven't used it now, but already like it! (have had a look to the readme!) Below an example of a root parent and a first level child:
    8 points
  3. Jeffrey Way, from the excellent Laracasts.com, just published a free series for PHP beginners: https://laracasts.com/series/php-for-beginners From the website: Jeffrey is a great teacher so if you are learning PHP, no better place you'll find.
    4 points
  4. Apparently the child has a higher z-index
    3 points
  5. Thanks for adding me as a colaborator, @horst. I've pushed a new dev branch to the repository that contains, Bugfixes to the textfile driver's itemCount() method and small cleanups for edge cases. New methods isEmpty(), purgeItems() and getItems() added to the base storage class and fully implemented in the textfile driver. The SQLite driver currently has stub implementations of these that need filling out. The addition of a Redis driver for super-fast in-memory queues (implements the full base class interface.) If anyone wants to give this a try before horst gets around to merging into the master branch, feel free to grab the zip (repository here.)
    3 points
  6. Wire::message() Wire::warning() Wire::error() /** * Record an informational or “success” message in the system-wide notices. * * This method automatically identifies the message as coming from this class. * * ~~~~~ * $this->message("This is the notice text"); * $this->message("This notice is also logged", true); * $this->message("This notice is only shown in debug mode", Notice::debug); * $this->message("This notice allows <em>markup</em>", Notice::allowMarkup); * $this->message("Notice using multiple flags", Notice::debug | Notice::logOnly); * ~~~~~ * * #pw-group-notices * * @param string|array|Wire $text Text to include in the notice * @param int|bool $flags Optional flags to alter default behavior: * - `Notice::debug` (constant): Indicates notice should only be shown when debug mode is active. * - `Notice::log` (constant): Indicates notice should also be logged. * - `Notice::logOnly` (constant): Indicates notice should only be logged. * - `Notice::allowMarkup` (constant): Indicates notice should allow the use of HTML markup tags. * - `true` (boolean): Shortcut for the `Notice::log` constant. * @return $this * @see Wire::messages(), Wire::warning(), Wire::error() * */ have a look in Wire.php
    3 points
  7. @cstevensjr Got your point and totally agree with what you're saying. I didn't mean to force anybody into using preprocessors. Just wanted to encourage people to start looking into it because it really can make live easier...
    3 points
  8. This is been resolved by the tech team that look after the servers. The issue was one of incorrect file permissions on assets/files.
    2 points
  9. You have the whole API available to you for module development. The examples above are not specific to modules, but are methods of the Wire class. https://processwire.com/api/ref/wire/message/ https://processwire.com/api/ref/wire/error/ My go-to pages for module-specific info are: https://processwire.com/api/ref/module/ https://processwire.com/blog/posts/new-module-configuration-options/
    2 points
  10. You seem to be stuck on sass and I am talking about having PW profiles that a basic beginner (who may or may not know anything about sass) can utilize. We are coming together from two totally different planes. Yes, I believe it was fantastic and a good trend that @flydev augmented the profiles by including the precompiled version. It should be a great learning tool for all.
    2 points
  11. While I agree with you that one needs to expand their horizons, we also need to understand that not everyone uses the latest technology. We should strive to make these profiles accessible to everyone, no matter their knowledge/skill level. My push will always be about accessibility to technology by all. I firmly believe that's how things will spread.
    2 points
  12. @flydev Thanks a lot for putting this together. I was only waiting for BS4 to reach beta state before I will update my site-pwbs profile. Now I don't need to spend the time on it myself, which is great @pwired @cstevensjr I can only recommend to preprocess yourself and encourage you to look into node, compass, bower etc. It really is worth the effort and gives you so much more flexibility. With the precompiled version of this profile, you need to override a lot of stuff in your own CSS and this will bloat your code.
    2 points
  13. If you want to save a pagefield value to the database you need to set outputformatting false, otherwise the value is only valid during runtime. http://processwire.com/api/ref/page/of/ In your case: $event->of(false); This should work: $event->of(false); foreach ( $event->event_data as $ed ) { if ( $signup_id != 0 ) $ed->signup_id = $signup_id; } $event->save('event_data');
    2 points
  14. With AI as well as search engines recognising well structured data, it's more important than ever to include schema information on web pages. V0.1.6 is now available on gitHub at https://github.com/clipmagic/MarkupJsonLDSchema New features include: Opening hours is now a textarea for multiple day/times FAQ schema added Improvements to other schemas, inc: Multiple images now supported in LocalBusiness & Organization schemas Product offers in the Product schema Citations in the Article schema Thank you to @LexSanchez for your suggestions ---- This module helps you dynamically create schemas for improved SEO & SERP listings from within your templates. Each schema can be configured to meet your requirements. You can even add your own ProcessWire schema classes to the module. Read about the module on github: https://github.com/clipmagic/MarkupJsonLDSchema Download from github: https://github.com/clipmagic/MarkupJsonLDSchema/zipball/master Download from ProcessWire modules: http://modules.processwire.com/modules/markup-json-ldschema/
    1 point
  15. Bootstrap-4 Minimal site profile for ProcessWire This profile is based on the "minimal site profile (intermediate edition)" and bundled with Boostrap v4.4.1 Features Bootstrap SASS Font-Awesome SASS Render / helper functions for : Simple ul navigation Bootstrap Multi-level navbar Bootstrap Carousel Bootstrap Cards Bootstrap Jumbotron Boostrap Accordion Assets minification, files bundle Dependencies jQuery Popper.js Bootstrap FontAwesome Prequisites You'll want to install the following on your system before proceeding: Yarn / NPM How To Install Download the zip file at Github or clone directly the repo with git clone and skip the step 2. Extract the folder site-pwbs4-master into a fresh ProcessWire installation root folder. During the installation of ProcessWire, choose the profile "ProcessWire Bootstrap 4 profile". After installation You can find the development file (CSS/SCSS/JS) in site/assets/dev/src The profile can be used as is only with $config->debug set to false. To use it in debug mode, you are required to install the dependencies with the package manager. Open a terminal in site/assets/dev and execute the following command-line: yarn Available commands : Rebuild, minify and bundle assets for release : yarn build References Bootstrap v4 documentation ProcessWire documentation ProcessWire Forum: bootstrap tag ProcessWire Forum: bootstrap related posts Credits The ProcessWire staff Inspiration from @gebeer and his Bootstrap 3 profile post Members who contributed in various post about Bootstrap navigation and code (see code-source for refs). Screenshots
    1 point
  16. $markup = ''; foreach($languages as $language) { if($language->id == $savedLanguage->id) continue; if(!$page->viewable($language)) continue; $user->language = $language; // do not use $language here again $markup .= "<li class='language' style='float: left; display: inline; padding: 1em;'><a href='$page->url'>$language->title</a></li>"; } if(strlen($markup)) $markup = "<something>$markup</something>";
    1 point
  17. Thanks @tpr - I have decided to remove that setMaxAllowedPacket method in the latest version - it's most likely not going to work for a standard SQL user on most shared hosts anyway. So, the message for everyone out there is if the debug bar isn't working and you have the PW core SessionHandlerDB module installed, you have three options: Uninstall SessionHandlerDB Increase your SQL max_allowed_packet setting (in your my.ini or my.cnf file, or via SET GLOBAL max_allowed_packet) - http://stackoverflow.com/a/5688506/1524576 Use the "Legacy" option for the Tracy core setting in the module config (not really recommended as you'll be missing out on core updates)
    1 point
  18. Cropping for different devices shouldn't mean crop to smaller sizes by default. Say you have a photo with a group of people and one of that group is the subject. It wouldn't be weird to crop out only that person for smaller devices.
    1 point
  19. v018 is uploaded with the latest Latte version (2.4.0). There's an official way to set the default layout file so previous workarounds were removed.
    1 point
  20. Have not checked out the module yet, but seems like a very nice addition. The JSON+LD Schema is really something Google will be using a lot in the future. Mark my words!
    1 point
  21. No, I just picked one from the past releases. I've sent you the screenshot in PM. Edit: the last working one is this: https://github.com/adrianbj/TracyDebugger/tree/144abecbee3e081de99052671c00f392106c6ae7 Edit2: there may be something with this line, commenting out removes the error: if($this->setMaxAllowedPacket()) $this->session->redirect('./');
    1 point
  22. @FrancisChung Thanks for writing this tutorial, but I'd suggest changing the title. You're describing functional or integration tests and not unit tests. Unit tests try to test the smallest units of software with as few external dependencies as possible (e.g. a method or a class). Testing browser output is possibly the largest testable unit of a website. I know that these names are almost never used 100% correctly, but I think in this case it would really make sense to correct the terminology.
    1 point
  23. FYI, I have written a guide for those looking to get Phpunit to work with Phpstorm.
    1 point
  24. Anatomy of a Test (Part 1): Now that we have a test structure in place, you might be asking yourself "what sort of tests should I be writing?" In general, you should start writing tests that would test the most important aspect of your site / system. For a CMS like Processwire, that would be tests that would cover Content Integrity for example, as content is king in a CMS. Tests that would cover navigation could be another example as growing content means growing navigational possibilities. You can use tools to determine how much of your written unit tests actually test your site/system, but test coverage is beyond the scope of this post. Let's look at example content unit test to see what's actually inside. <?php /** * Created by PhpStorm. * User: FrancisChung * Date: 09/03/16 * Time: 19:06 */ namespace Test; use Facebook\WebDriver\Remote\DesiredCapabilities; use Facebook\WebDriver\Remote\RemoteWebDriver; //use Facebook\WebDriver\WebDriverCapabilities; require_once(__DIR__."/../../../composer/vendor/autoload.php"); class WebFingerspieleContentTest extends \PHPUnit_Framework_TestCase { protected $site; protected function setUp() { $this->site="http://localhost"; } public function testSafari() { $browser = RemoteWebDriver::create('http://localhost:4444/wd/hub', DesiredCapabilities::safari()); $this::TestPageTitle($browser); $browser->close(); $browser->quit(); $browser = null; } public function testFirefox() { $browser = RemoteWebDriver::create('http://localhost:4444/wd/hub', DesiredCapabilities::firefox()); $this::TestPageTitle($browser); $browser->close(); $browser = null; } public function testChrome() { $browser = RemoteWebDriver::create('http://localhost:4444/wd/hub', DesiredCapabilities::chrome()); $this::TestPageTitle($browser); $browser->close(); $browser = null; } private function TestData() { return array( array("{$this->site}/fingerspiele/alle-fingerspiele/10-kleine-zappelmaenner/", 'Zehn kleine Zappelmänner | Fingerspiel | Sprachspielspass.de'), array("{$this->site}/fingerspiele/alle-fingerspiele/der-osterhase/", 'Der Osterhase | Fingerspiel für Kinder | Sprachspielspass.de'), array("{$this->site}/fingerspiele/alle-fingerspiele/weiss-wie-schnee/",'Weiß wie Schnee | Fingerspiel Sommer | Sprachspielspass.de'), array("{$this->site}/fingerspiele/alle-fingerspiele/ein-kleines-auto/", 'Ein kleines Auto | Fingerspiel | Sprachspielspass.de'), array("{$this->site}/fingerspiele/alle-fingerspiele/es-regnet-ganz-sacht/", 'Es regnet ganz sacht | Fingerspiel | Sprachspielspass.de'), array("{$this->site}/fingerspiele/alle-fingerspiele/das-ist-der-daumen/", 'Das ist der Daumen | Fingerspiel | Sprachspielspass.de'), array("{$this->site}/fingerspiele/alle-fingerspiele/plumps-und-platsch/", "Plumps und platsch | Fingerspiel | Sprachspielspass.de"), array("{$this->site}/fingerspiele/alle-fingerspiele/fuenf-engelchen/", 'Fünf Engelchen | Fingerspiel Winter | Sprachspielspass.de'), array("{$this->site}/fingerspiele/alle-fingerspiele/erst-kommt-die-schnecke/", 'Erst kommt die Schnecke | Fingerspiel | Sprachspielspass.de') ); // } /** * @param $browser */ private function TestPageTitle($browser) { $data = $this::TestData(); //TestFactory::PageTitleTest($data, $browser, $this); foreach($data as $testItem) { $url = $testItem[0]; $expected = $testItem[1]; $browser->get($url); $this->assertContains($expected, $browser->getTitle()); } } } Now the 2 use statements (DesiredCapabilities & Webdriver) are needed to access the Php-webdriver that we will be using to interact with Selenium. The require_once(__DIR__."/../../../composer/vendor/autoload.php") statement is to reference the Phpunit test framework that we installed via Composer (I got stuck on here for a while). Your test also needs to derive from \PHPUnit_Framework_TestCase as you can see in the above example. This is all the dependencies you need to write a Phpunit test for Processwire that runs on Phpstorm. In the next post (Part 2 of this topic), I will go through each method and explain their purpose and function.
    1 point
  25. Hi and welcome to PW. That CNN URL is not a valid feed - it needs to return an XML document, but that one is just a directory of actual feeds - choose one from the list and it should work fine. What was the other URL you tried before switching to the CNN one?
    1 point
  26. Yes, please only use the second one. Best is to uninstall the first one. The first one is obsolete, as it only supports the older image variations naming convention, and not the new one, introduced in PW 2.5.11.
    1 point
  27. Goog day! I have a Page field inside a Repeater inside a Repeater (yeah, x2). I need to determine the selectable pages for that Page field via php code. But I do not have access to $page variable from there. I can access $pages though. Is there a way to get the $page edited value? I have asked a similar question about Page field inside a Repeater inside a RepeaterMatrix, but it is in a vip forum so has a) less chance to be answered quickly and b) less chance to help someone else. Just mention it not to be banned by the moderators . I checked and the same problem repeats in either case. Promise to post a solution to the other topic if we'll produce one.
    1 point
  28. Hi and welcome to processwire. You should go through the forum channels and their posts because these questions are already answered many times. Processwire is a decoupled system, build around the concept that everything in the backend is "a page". You can use any css grid or php framework that you want to speed up your work. If you are new to these things I would suggest to start with the pocketgrid css as it is very easy to understand and work with. Flydev has made 2 nice templates available lately for processwire, one is based on bootstrap and the second one is based on foundation: I have setup a preview of these templates here http://dev9.pe.hu and here http://dev8.pe.hu Processwire gives you the highest freedom and power to build websites but like you mentioned you need to know html, css, javascript and php, and above all: the api of processwire. If you don't know this you will only be able to make simple websites with processwire. There are no professional templates for processwire like there are for wordpress. Why do you think wordpress has become so popular: pick a professional template, click it together and in only a few days you have a professional looking website. But this comes also with a price: wordpress isn't the safest system as it gets hacked a lot and wordpress needs a lot of plugins to get things to work. A good example is a multi-language website with wordpress. You need the wpml plugin for this to translate text strings. Not really functional as this solution causes a lot of database calls. You have to use the wpml search option to find the text strings in the database that you need to translate. And wpml is the best you can get for wordpress. That makes you rethink about wordpress. Processwire has multi-language already build in the core, a breeze to use and a real functional solution like it should be. Drop down menus and sliders are the least problems you have to get them in processwire. Right now I am putting the camera slider in a processwire website. http://www.pixedelic.com/plugins/camera/ This is only a matter of pulling the pictures from the processwire backend into the slider html/css. More effort you have to do for setting up your own forms because you need to know the api and php and a bit of abstract thinking. The good thing of processwire is that it makes you completely independent in making a website in any possible way you want or need. But for a non coder it takes time to get there.
    1 point
  29. I installed the latest version but always got a TracyDebugger class not found error. However, an earlier version works fine, eg. https://github.com/adrianbj/TracyDebugger/tree/2fbc6537099a3f90b549fcbfc219417949747952 I updated the module through the Upgrades module, but I got the same error on manual install. Things gone bad when I installed the Process Tracy Console I believe, but not sure. I tried entirely uninstall the module and reinstall, but no joy.
    1 point
  30. @ryan, committed an update this morning that I can confirm fixes this problem. Now works great on an updated 3.0.23 commit.
    1 point
  31. Did someone try to use Auth0 for social and/or passwordless login in PW? And is there somebody interested in porting their Wordpress plugin (that looks awesome) to ProcessWire? https://wordpress.org/plugins/auth0/ I have not the resources right now but I can help testing it. This is how their plugin works: Regular flow There are three different scenarios that could take place. First, a user that not exists in WordPress and it does in your Auth0 account try to log in. A user access your site's login page. (s)he completes his credentials (it could be an existing user in your Auth0 account or a new signup). Auth0 will authenticate the user The plugin gets the user profile. The plugin check if there is a user in the WordPress database with his/her Auth0 user_id. It can't find any, so it will check if there is a user with the same email. It can't find ant, so it will create a new user and log him/her in. Second, a user that exists in WordPress (this user was created before you installed the plugin) and in your Auth0 account try to log in. A user access your site's login page. (s)he completes his credentials (it could be an existing user in your Auth0 account or a new signup). Auth0 will authenticate the user The plugin gets the user profile. The plugin check if there is a user in the WordPress database with his/her Auth0 user_id. It can't find any, so it will check if there is a user with the same email. There is a user with the same email. It checks if the Auth0 user has verified the email. If the user has not verified the email, the process end here with an error message If the email was verified, it will update the user with the Auth0 user_id and log the user in. Third, a user that exists in WordPress (this user was created in the scenario one, or updated in the scenario two) and in your Auth0 account try to log in. A user access your site's login page. (s)he completes his credentials (it could be an existing user in your Auth0 account or a new signup). Auth0 will authenticate the user The plugin gets the user profile. The plugin check if there is a user in the WordPress database with his/her Auth0 user_id. It finds the user, and logs him in. Data migration When data migration is enabled, the plugin will expose two secure endpoint to let Auth0 authenticate the users. This endpoints are secured with a secret token and only available to the Auth0 IPs. You can change this in the plugin advanced settings. The login flow is the following: A user access your site's login page. He has an account in your wordpress site so (s)he proceds to login using this credentials. Auth0 can't find a user with this credentials in your account, so proceds to call your migration endpoint. The plugin find a user with the same username/email and verifies the password. Auth0 creates the user in your account and authenticate the user successfully.
    1 point
  32. Or add a checkbox to the template and when saving a page check for date and if empty set the checkbox. Then use "sort=hasdate_checkbox, sort=training_start, sort=id"
    1 point
  33. A personal thanks for providing this version.
    1 point
  34. I made a precompiled edition, here you go : https://github.com/flydev-fr/site-pwbs4/archive/precompiled.zip The installation process is the same, but no command-line or external tools required.
    1 point
  35. Hello again vanni, I think many of the TxP folks who have migrated over to PW have been in the same position. Take Tom Reno (renobird) for example; he's become very capable with PHP thanks to having to learn PW templates in a short period of time. There are good resources to help with this; template documentation on the main site, clear code examples on the forum (just browse for a while or google for them), an amazing blog profile for PW with lots of templates to use, an IRC channel and tools like Soma's cool API cheat sheet. Whilst TxP's parsed template tags are easy to use if you are used to writing X/HTML documents, you often have to spend time digging into the tag or plugin documentation to find out which attribute does what. With PHP you will have to learn some new things too, but once you know them you will have additional flexibility for your template handlers that isn't available without custom coding stuff in TxP and you will have a transferable skill which you won't have if you are putting time into learning TxPs unique tags. In addition, using PHP as the template language means the templates don't need to go through an additional parser.
    1 point
×
×
  • Create New...