Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/03/2016 in all areas

  1. I've made a module that should swicth protocols (http/https) based on domain name. Don't now if it still works but you could try it: https://github.com/Da-Fecto/SwitchProtocol
    3 points
  2. Here is another option that uses URL segments to get the individual repeater galleries. This would allow you to continue using the UIkit slideshow. // The repeater field is called 'galleries' $galleries = $page->galleries; // Set defaults $current_gallery = $galleries->first(); $gal_number = 1; // Deal with url segments if($input->urlSegment(1) !== '') { // Sanitize url segment and subtract 1 to adjust for zero-based index $gal_zero_index = $sanitizer->int($input->urlSegment(1)) - 1; // Throw a 404 if the url segment is out of range if( $gal_zero_index < 1 || $gal_zero_index >= $galleries->count() ) { throw new Wire404Exception(); } else { $current_gallery = $galleries->eq($gal_zero_index); // Add 1 to give one-based index $gal_number = $gal_zero_index + 1; } } if($input->urlSegment(2) !== '') { throw new Wire404Exception(); } // Gallery heading echo "<h3>Gallery $gal_number</h3>"; // Slideshow foreach($current_gallery->images as $image) { // Output markup for slideshow here } // Gallery links (thumbnails) $i = 1; foreach($galleries as $gallery) { if($gallery->images->count()) { $link = $i > 1 ? $page->url . "$i/" : $page->url; $class = $i === $gal_number ? ' current' : ''; echo "<a class='gal-link{$class}' href='$link'><img src='{$gallery->images->first->size(100,100)->url}' alt=''></a>"; $i++; } }
    3 points
  3. @deltavik Hi, In case you are interested, there is a recently "released" Site Profile (by @clsource) which has tags already implemented (though no categories, but they can be added in a similar manner). This is just one example, but a good one:
    3 points
  4. To follow up on this, it would be very much appreciated if the render functions were hookable. I need microdata in the markup for the comment lists ratings. I know I could loop through the comments and output my own markup. But it would be much better if I could place this in a module and hook from there as I (and maybe others) sure could use this on other projects, too. EDIT: I added an issue and a pull request on github.
    2 points
  5. Ryan introduces $this->halt() in this blog post and there is some explanation in the code too. Essentially just reiterating what Macrura says above, in your template file... // some template code here: this always gets executed if(/* some test here */) { return $this->halt(); } // some more template code here: this doesn't get executed if the if() statement above is true // also, if a file is specified in $config->appendTemplateFile this is not appended
    2 points
  6. depending on how your templates are configured, you could for example not have a $useDone or $useMain and then at your own discretion use the return $this->halt which should do the same thing, meaning it would prevent anything from happening after the point that you put that.
    2 points
  7. This is a Leaflet version of Ryans Google Maps marker module. @Github
    1 point
  8. This module allows the default admin - and other users you specify - to login as any other user as defined in the module config. This could be useful for reproducing errors your users can see on websites or during testing, but I would suggest it is used wisely as there are some obvious snooping abilities in using this. Once installed, you can configure the module to be usable by various members of staff other than the default admin account, as well as define which roles or individual users you will be able to login as. After saving the config settings, you will find a page under the Setup menu in the admin called "Switch User". Selecting a user from the list checks via AJAX whether the user has admin access (this is a basic check for the page-edit permission as by default the admin homepage requires page-edit to load the page tree) and will either allow you to redirect to the homepage or back to the admin depending on that check. Download Here Version History 0.0.6 - Initial release
    1 point
  9. InputfieldChosenSelect This topic (https://processwire.com/talk/topic/71-categorizingtagging-content/) showed the need for a Inputfield that would provide a real tagging UI to be useable with FieldtypePage. It uses the chosen library, which can be found here http://harvesthq.github.io/chosen/. It's meant for MultiPageFields and works kinda like asmSelect, but with a different skin. Features: Inline adding of new tags, which will then generate the corresponding pages. Sortable tags. Usage Install the Module Edit your pagefield and choose InputfieldChosenSelect as inputfield. Use Enter or Tab to create new Pages with the currently typed name. Enter will fill in the tab currently selected in the dropdown. http://modules.processwire.com/modules/inputfield-chosen-select/ https://github.com/LostKobrakai/InputfieldChosenSelect
    1 point
  10. Hello, I made this clone of the Ghost Blog System (http://ghost.org) for demo of the Wire Render Pattern as well as a multi language site and menu system. https://github.com/NinjasCL/pw-ghost As always MIT licence.
    1 point
  11. I'm subscribed to Carl Alexander's newsletter, a developer how knows quite a lot about WordPress development. Today's topic is pretty interesting, quote: Wow! That's quite an invention No more comment. Should anybody be interested in the details: https://carlalexander.ca/designing-class-simple-wordpress-queries/
    1 point
  12. Hi Kekko, Welcome to the PW forums! In PW, image and file fields effectively store the images/files for the page they are on. Currently there is no fieldtype module released in the modules directory that acts a reference to images/files stored on another page. There have been a number of questions and requests about such a feature (for example here, here, here and here) and you could throw your support behind the item in the wishlist subforum here. I for one would love to see an image reference field for PW and it's on my list to have a go at developing some time but I fear it will be beyond my skill level. The only alternative to an image reference field that I'm aware of is to follow a page-per-image approach (i.e. each image is uploaded to a separate page, and then you use a Page fieldtype to reference the image in other pages). I haven't tried them, but there are some modules that can help if you want to use this approach: AutoImagePages ImagesManager FieldtypeImagesSelect ...and two commercial modules from @kongondo... Media Manager Visual Page Selector
    1 point
  13. Thanks @bernhard for the access to that testing server - very helpful! @blynx and @Gazley - does the latest version solve your problems? If it doesn't, chances are that you have SessionHandlerDB installed. You can either uninstall it, or edit your php.ini file and if output_buffering is set to 0, please change it to 4096. I am hoping to get a fix from the core Tracy developers so that neither of these changes are needed, but for the moment I think it should solve things.
    1 point
  14. Check this thread out: Symptoms are so similar I'd be kind of surprised if it wasn't related
    1 point
  15. It seems strange to me that in your screenshots of the Family settings of Template Categories none of the radio options is ticked. Something wrong with that? (Of course, the Categories page must have children allowed.)
    1 point
  16. Hey Ollie, The only thing I do when porting to https only is uncomment these lines. Have you tried it? It doesn't seem enabled in your .htaccess. I usually don't even set the templates to https only.
    1 point
  17. hi @adrian are you still working on the whitescreen issue? i'm having this issue on an ubuntu 14.04 digitalocean droplet pw 3.0.28 and tracy 2.5.6 ps: i could give you ssh access if you want? just pm me
    1 point
  18. This looks interesting. I am going to try it. thanks,
    1 point
  19. @netcarver This fixed it!
    1 point
  20. I also did some tests. Instead of the form button name you will get $input->post['ic-trigger-name']. Tested with FormHelper and this code snippet to get form process work. if ($input->post['ic-trigger-name']) { $input->post[$form->fhSubmitBtn->name] = $input->post['ic-trigger-name']; } Because FormHelper module checks form state by button name attribute.
    1 point
  21. Not sure. I only experienced this once during an internal hosting migration. If the files are there and PHP can't seem to load the classes, it seems to me there must be something with permissions/ownership of those files. Glad you got it working. These things are notoriously time-consuming to debug.
    1 point
  22. I think the problem you're having with the slideshow is a JS issue rather than a PW issue - as far as I can tell the UIkit slideshow component doesn't support dynamically adding/removing images out-of-the-box. And this is what you would need if you want the slideshow to load galleries according to which thumbnail below is clicked. You would have to code your own JS solution for this, which could be challenging. You might be better off to look for an image viewer script that has documentation/examples for loading galleries from a single link. For instance, if you were using Fancybox you could follow one of the examples below: http://jsfiddle.net/T6NKD/ http://jsfiddle.net/jekAe/
    1 point
  23. From the module readme... And you can also use the core Autocomplete inputfield to add pages on-the-fly providing the conditions on the "Input" tab are met...
    1 point
  24. No idea, but it's shorter so leaves more space in my head for others
    1 point
  25. good catch @flydev never considered this as most of my projects are multi lang tested and pushed your fix, should work now @csaeum Please let me now if it works for you, too EDIT: Just bumped version so you should be able to just update the module using ProcessWireUpgrade module (if installed)
    1 point
  26. @Beluga I just pushed a new leaflet-v1.0.0rc2 branch to my repo - works nicely. @ceberlin If you were referring to my work above, please try out the v1.0.0rc2 branch as it pulls the files in from the npmcdn you referenced in your quote.
    1 point
  27. SOLVED: I've put the getLoginUrl after the getAccessToken section and now the log in works. <?php namespace ProcessWire; // This file is the _init.php $homepage = $pages->get('/'); // FACEBOOK require_once $config->paths->root.'facebook-sdk-v5/autoload.php'; $fb = new \Facebook\Facebook([ // Thank you LostKobrakai 4 the \ 'app_id' => 'my_app_id', 'app_secret' => 'my_app_secret', 'default_graph_version' => 'v2.5' ]); $helper = $fb->getRedirectLoginHelper(); try { $fbAccessToken = $helper->getAccessToken(); } catch(\Facebook\Exceptions\FacebookResponseException $e) { // Thank you LostKobrakai 4 the \ // When Graph returns an error echo 'Graph returned an error: ' . $e->getMessage(); exit; } catch(\Facebook\Exceptions\FacebookSDKException $e) { // Thank you LostKobrakai 4 the \ // When validation fails or other local issues echo 'Facebook SDK returned an error: ' . $e->getMessage(); exit; } $loginUrl = $helper->getLoginUrl($homepage->httpUrl); // Include shared functions include_once("./_func.php"); Source: http://stackoverflow.com/questions/31347341/the-state-param-from-the-url-and-session-do-not-match
    1 point
  28. To be correct: Install pim, what installs pim1, go to modules / site, install pim2 and use pim2load(). It needs a rewrite someday for recent PW versions (2.8+ & 3.0+)
    1 point
  29. the profile itself has a $useDone variable, so you can also just set that to false and load your alternate file. /* * Whether to include the _done.php markup file? For example, your template * file would set it to false when generating a page for sitemap.xml * or ajax output, in order to prevent display of the main <html> document. * */ $useDone = true; in other scenarios you can stop what happens after the template by using: return $this->halt(); so therefore you could use wireRenderFile, or include/wireIncludeFile your alternate file, and then prevent loading _done by halting.
    1 point
  30. Another option is to tar the files locally and extract them on your server. Tar will respect your permissions.
    1 point
  31. 1 point
  32. you can just place like a fixperms.php (with the below code) file in the root and load it (then delete it): <?php exec ("find /home/user/public_html/ -type d -exec chmod 0755 {} +"); exec ("find /home/user/public_html/ -type f -exec chmod 0644 {} +"); replace the path with the root of which folders you need to fix. our main host switched like 30 sites to a different machine and the perms were completely messed up after the migration.
    1 point
  33. Just for the record, this works for gtmetrix (opens in new window): return '<form action="https://gtmetrix.com/analyze.html" method="post" target="_blank">' . '<input type="hidden" name="url" value="' . $page->httpUrl . '" />' . '<button type="submit">GTmetrix test</button>' . '</form>'; I managed to make it work in iframe but it's kinda hacky, I think it's better open it like this.
    1 point
  34. The custom php module works great for google speed test. I added a no-jquery javascript lightbox to it (modified version of squeral lightbox), called from my site js. The same could be added for gtmetrix but even using "?url=xxx" needs manual click on the "Analyize" button (the url is pre-filled though). I can share the code if someone needs.
    1 point
  35. hi adrian, the page recorder reminded me of my hook recorder i created almost a year ago and i got very little feedback so didn't take it further (not to say it was and may still be beyond my scope ). i think it could play very well together with tracy and all the options we have now (eg only load that panel once when needed). that's only a first vague idea. the last post in the topic has some more suggestions. if you like the idea i would be happy to support you as much as i can
    1 point
  36. Second new panel today Introducing "Page Recorder" This panel records the ID of all pages added whenever it is enabled (so this is one you'll want off by default and just enabled via "Sticky" when you need it). This is perfect for all sorts of testing, whether you need to create a LOT of pages for performance testing or you are testing a form which is automatically creating pages. Once you are done with the testing session, simply click the "Trash Recorded Pages" button and they will all be moved to the Trash. Because pages are sent to the trash rather than completely deleted, I consider it safe to use, but I am a little worried that someone may leave it enabled when they are creating real content pages and then later trash them, then empty the trash without realizing it contains a page they want. If there is demand, I may consider adding checkboxes so you can remove certain pages from the list so they won't get trashed with all the others. Please let me know if you have any suggestions for functionality or the interface.
    1 point
  37. I think an on-demand google pagespeed and gtmetrix page analyzis could be nice panel additions. On "on-demand" I mean they should analyze only on user request (eg. click on a button). Both have APIs but PS requires an api key, maybe gtmetrix too. I know it's a bigger request, I'm just asking whether you have thought about such feature.
    1 point
  38. Sometime after 3.0.21, PW had modifications that has messed up how PW's "Markup" field renders descriptions with HTML in them, which also affects MenuBuilder. I've created an issue on the PW Github: https://github.com/ryancramerdesign/ProcessWire/issues/1932
    1 point
  39. Thanks again for the port to leaflet! I prefer OSM over google maps and have been using it for quite some time. Leaflet is very powerful and opens up many possibilities. I forked Mats' module and added support for leaflet-providers so we can choose different map tile providers (see my post here). It is still a work in progress but seems stable. Once it is ready for production I'll make a pull request. Mats, do you think we should use leaflet-providers as standard or offer the user a choice whether they want to use it or not? Next up I will add an icon field and support for Leaflet.awesome-markers.
    1 point
  40. For a noob like me it was easy enough when I tried to setup a DO VPS using their guides. The issue for me would have been maintenance and security - which I would have sucked at - so I've stayed with my managed VPS. Take a look at https://serverpilot.io/ too.
    1 point
×
×
  • Create New...