Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/01/2016 in all areas

  1. my latest tut+ tutorial went up today called: How to Develop a Processwire Theme - which is a very basic intro to creating a template for PW
    10 points
  2. 5 points
  3. That would lead to a delayed output from a beginner - if any output at all
    3 points
  4. $image->tags is just a string. // Probably this will do it. <div data-uk-filter="<?php echo str_replace($image->tags, ' ', ', '); ?>">
    2 points
  5. if($page->isHidden()){ echo '<meta name="robots" content="noindex">'; }
    2 points
  6. This line is executed regardless of whether $item has children: $out .= "<li$class><a href='{$item->url}'><i class='fa fa-file-text-o'></i> {$item->title}</a>\n"; You’re going to want to attach it to the condition if($numChildren) { below, so the link is only appended to your output if it doesn’t have children. Perhaps like so: if(!$numChildren) { //No children, so append the standard top-tier link $out .= "<li$class><a href='{$item->url}'><i class='fa fa-file-text-o'></i> {$item->title}</a>\n"; } else { //We have children here, so append the parent-style link and do the recursion //... }
    2 points
  7. Just thought I'd add the solution to this problem, for reference. Turns out there's a file called /site/assets/cache/LazyCron.lock (or something along those lines) preventing the cron functionality from working when there are PHP errors in my cron logic, which can happen during development of course. Fixing the errors and deleting the lock file restores functionality.
    2 points
  8. What works even great is a simple SQL dump and the use of the CSV Import module: https://processwire.com/talk/topic/383-module-import-pages-from-csv-file/
    2 points
  9. You could let the users log-in with their email address. You need to google around the forum to find all the things people said about it.
    2 points
  10. Sorry, I just looked at your site and realized you are using the video_url field inside a repeater. I should have noticed that from your original post above. The module doesn't currently support repeaters - I never had a need for it and no-one else has asked yet. I'll see what I can do about adding it and will get back to you when it's working. Completely wrong - it does already support repeaters - you just need to specify the template of the repeater in the "Templates to search" config setting. The problem with the module on your site was due to fopen not working on files at external URLs. The current version should now work on your server.
    2 points
  11. Hi Tony, Glad you find the module helpful. I have really been so busy I've not had a chance to update the docs, my bad. As the name of that option suggests 'post_small_image' will only work with truncated posts. What you want is its big brother, 'post_large_image' option set to 1. The default is 0 (meaning don't show the image), hence why you don't see your image in un-truncated posts. Until I get round to updating the docs, please have a look at the source code (not ideal, I know :-() for all available renderPosts() options (as well as other methods' options). For your particular question, these might also be of use: $options = array( // ** large/full post featured image ** 'post_large_image_width' => '',// no width manipulation of featured image if this is blank or 0 // no height manipulation if this is blank or 0. // Note, if size is true and both width and height > 0, we use size() instead 'post_large_image_height' => '', 'post_large_image_size' => false,// if 'size' = true AND both width and height > 0, this kicks in );
    2 points
  12. Set a different session name for every PW instance. From config.php: /** * Session name * * Default session name as used in session cookie. You may wish to change this if running * multiple ProcessWire installations on the same server. By giving each installation a unique * session name, you can stay logged into multiple installations at once. * * #notes Note that changing this will automatically logout any current sessions. * @var string * */ $config->sessionName = 'wire';
    2 points
  13. Here is very simple abstract class that I hope would get ideas and contribution from community, so that different PW projects could use same payments methods in generic way: https://github.com/apeisa/Payment Currently Payment modules just assume it's found from /site/modules/Payment/Payment.php, but I would love to get it autoloaded somehow (I went with PW module dependencies and transformed the base class into PW module also). Also I have tried to keep this as minimum as possible - hopefully I have not left anything too important out. I have also created one two payment modules, that use this base class: https://github.com/apeisa/PaymentStripe/ https://github.com/apeisa/PaymentPaypal/ Please visit their repos for examples.
    1 point
  14. PrevNextTabs Module Github: https://github.com/outflux3/PrevNextTabs Processwire helper modules for adding page navigation within the editor. Overview This is a very simple module that adds Previous and Next links inline with the tabs on the page editor. Hovering over the tab shows the title of the previous or next page (using the admin's built in jqueryUI tooltips.) Usage This module is typically used during development where you or your editors need to traverse through pages for the purpose of proofing, flagging and/or commenting. Rather than returning to the page tree or lister, they can navigate with these links. Warnings If you are using PW version 2.6.1 or later, the system will prevent you from leaving the page if you have unsaved edits. For earlier versions, to avoid accidentally losing changes made to a page that might occur if a user accidentally clicks on one of these, make sure to have the Form Save Reminder module installed. http://modules.processwire.com/modules/prev-next-tabs/
    1 point
  15. But this will only work if you don't deny robots access to those pages, otherwise they'll index just by links from other pages. At least that's what google says about it.
    1 point
  16. Thanks to all for your answers. I think I will follow Martin's advice of having the users log-in with their email. I won't show them their user page name. I can create the name programmatically or I can use the adjustName option. If the users don't see the name... they won't care ;-) Have a great day
    1 point
  17. Well because this functionality somehow best belongs to the $session API variable
    1 point
  18. Might be of use.. https://processwire.com/talk/topic/8343-access-page-and-pages-variables-from-inside-a-javascript-file/ https://processwire.com/talk/topic/5162-how-to-load-js-css-plugins-colorbox-cycle2/
    1 point
  19. I usually put 'variables' in an javascript object and put it in the site as one of the first scripts. There I define the variable I need, such as page locations etc. In http://www.copal-development.com for example, the first script tag in de bottom of the page contains an config object. Every script after this script can read that object and thus read the variables.
    1 point
  20. Similar to typing "google" into google. The internets breaks.
    1 point
  21. Hello Guys, Thanks for the responses. Turned out to be that my SQL import was only importing half the tables managed to get it sorted. Thanks for your help again! Cheers Jon
    1 point
  22. Christophe, Is this on the same site that you gave me access to last week? Let me know and if you mind me taking another look - it might be the easiest way for me to decipher where things are going wrong for you.
    1 point
  23. OK, a bit OT.... I was finding it increasingly annoying writing README's for my modules in Markdown. It takes way too much time. I needed something that could convert HTML to markdown, the idea being to write in RTE, copy the source HTML and convert that to markdown. I briefly toyed with the idea of writing a personal module for this, then I found this thread which lead me to other things via Google. And now I've found it, a MS Word plugin for markdown, yeah!! Yes, I am not a fan of markdown and yes I like Word! ...a lot. Now I can type my README's and see the visual richness at the same time as I spell check, yeah! Writage (a Markdown plugin for MS Word. It uses Pandoc behind the scenes) Pandoc (brilliant universal converter) Other interesting stuff HTML To Markdown for PHP to-markdown </end OT>
    1 point
  24. Great to hear! I've created an issue and suggested the fix.
    1 point
  25. This week we’ve got some great new optimized methods added to the $pages API variable, plus full link abstraction now built-in, new sub-selector upgrades, and more! http://processwire.com/blog/posts/processwire-3.0.6-brings-pages-upgrades-and-link-abstraction/
    1 point
  26. I can confirm that Chris workaround saved my life. Thanks Chris for your suggestion and thanks formmailer for this useful module!
    1 point
  27. I'll try to look into this as soon as possible, but if someone already fixed it and can submit a merge request it would be a great help. //Jasper
    1 point
  28. This is just to get you going...It is not a complete solution and will only work if there's only 1 tag per image...Otherwise, you need to capture each page's image's tag in an array (explode the tags string) and remove duplicates. Image tags are saved as a string of space separated tags. So, if there's more than one tag, you will get all of them in one line . Anyway, gotta run, so here goes... $duplicates = array(); foreach($page->images as $image){ if(in_array($image->tags, $duplicates)) continue;// skip duplicate tags echo" <li class='' data-uk-filter='{$image->tags}'> <a href='#'>{$image->tags}</a> </li> "; $duplicates[] = $image->tags; } echo"</ul>" ; Btw, why are you using a quote as a code block?
    1 point
  29. (on mobile, so not checking out the links already provided) I use Sublime 3, and believe there's a snippets package for PW. For me, Sublime is still the winner.
    1 point
  30. Next and prev return a single Page, not a PageArray, so you can’t count them. See the docs for $page->next: https://processwire.com/api/variables/page/ »This page's next sibling page, or NullPage if it is the last sibling.« This is the same for all properties and methods that return only a single Page, like $pages->get(), $page->parent, $page->rootParent, etc. If nothing is found, they will give you a NullPage, which always has the id 0. So you can test for it using one of these conditions: if ($page->next->id === 0) { /*$page is the last of its siblings*/ } or if ($page->next instanceof NullPage) { /*same here*/ } Since 0 evaluates to false you can also go if (!$page->next->id) { /*see above*/ } if you’re into the whole brevity thing. Sorry, can’t format on mobile.
    1 point
  31. Thats true... as it should. when using: if ($childpages) you ask: If PageArray... which is always true. You should check if it contains pages with count for example. if (!count($childpages)) { // The pageArray doesn't contain pages // If not count pages, thus 0 } if (count($childpages)) { // yay we have at least 1 page } // or if ($childpages->count()) { // yay we have at least 1 page }
    1 point
  32. What you need to understand is that in your example, you are storing the messages/errors in the session. This means you should be redirecting the user to display the message. Or to be precise, for them to be populated in $notices. If you want to add a message to the current request, you should use the "regular" message/error -methods. You can do this through most PW objects. For an example, change your line 67 to $form->error(__('There are errors in the form')); As a bonus, when redirecting, PW automatically stores such notices in the session . This means you could do $form->message(__('User registration sucessfull')); ...and the message wouldn't be lost. However in my opinion, it's cleaner to use $session->message() on line 98 because you are calling $session->redirect() on the next line.
    1 point
  33. In the current version of PW (2.6.9 dev) it is possible to add the date format via the PHP strftime syntax to get localized output. In my case I get a difference of 7 minutes between the choosen time in the backend and the outputted time in frontend. This is the date/time that I choose in the backend. The output format for each language in the field is like this: 1) German output format 2) English output format And this is what i looks like in the frontend: 1) German 2) English So as you can see the monthname is in the correct language and the time is also the correct format but I have got a difference of 7 minutes between the output on the frontend and the choosen time in the backend (18:07 instead of 18:00 in German and 06:07 PM instead of 06:00 in English). Could the cause be a server time problem where I hosted this site? Best regards Jürgen
    1 point
  34. The BMW Dealersites is a collaboration of various BMW dealers, brought together in a multisite ProcessWire setup with centralized and per-dealer contentmanagement possibilities. For anyone interesed, below a quick glance at the multisite pagetree: BMW enforces strict design guideliness for all websites that are built carrying the BMW logo. The guideliness are extensive but can be considered a bit outdated, since they do not take responsive possibilities into account yet. We managed to implement a responsive setup nevertheless, still complying to the guideliness. Which was quite a struggle, I can assure you As mentioned, the Dealersites is a collaboration of various BMW dealers. The idea is that all dealersites are basically the same (fields and templates), yet content may vary. This enabled us to create a centralized content module, in which content can be added and copied to all underlaying dealersites, minimizing the efforts needed to add and maintain content. See the screenshot below for an impression on how this works. We have been experimenting with hosting a bit. The sites are hosted using various Docker instances on an Amazon EC2 server, and mails are sent using Amazon SES. In the near future we plan on implementing ProCache3 with Amazon CloudFront. If you need any info on our experiences with this, just drop a line in this topic or sent me a DM. We have used quite a few modules, but nothing exotic. FormBuilder was used to create forms, some of which are handled by a third party URL to have added functionality: shooting Leads to an external webservice for example. The dealersites: http://www.vanlaarhovenbmw.nl http://www.vanhooffbmw.nl http://www.demaassche-venlo.nl http://www.demaassche-echt.nl http://www.nobracars-uden.nl http://www.nobracars-helmond.nl http://www.story-denbosch.nl http://www.story-waardenburg.nl http://www.story-nijmegen.nl Splashpages: http://www.nobracars.nl http://www.demaassche.nl http://www.bertstory.nl Work was done by us at X-com
    1 point
  35. No problem. Also, as a somewhat cleaner alternative to what I posted above, you can grab the POSTed version of the username directly to avoid the need to replace "-" with "@". With this version, it doesn't have to do anything if there is no "@" in the entered username. public function init() { if (strpos(wire('input')->post->login_name, '@') !== FALSE) { $this->addHookBefore('Session::login', $this, 'beforeSessionLogin'); } } public function beforeSessionLogin(HookEvent $event) { $name = wire('sanitizer')->email(wire('input')->post->login_name); $u = wire('users')->get("email=$name"); if($u->id) $event->setArgument('name', $u->name); } This way you can choose to sanitize it as an email address before it has been sanitized as a pageName which doesn't allow "@". The disadvantage to this version though is that for the front-end, you need to make sure your custom login form also uses "login_name" as the name of the input field. Not a big deal, but not as versatile I guess.
    1 point
  36. Huh. This looks like your MySQL server is reachable from everywhere in the internet, which is rarely a good idea. I usually bind only to localhost (if its running on the webserver itself), or add an iptables rule that only allows access from the servers I explicitely grant access to port 3306. For maintenance access, there's always the possibility to use ssh (MySQL CC has that built-in) to forward the connection to *nix systems, or VPN when using Windows hosts. One important measure to be able to pin-point problems quickly is to eliminate as much of the background noise as possible beforehand which port scans and distributed dictionary attacks tend to produce in the logs. Not letting these get to your services in the first place makes your logs much more meaningful. I don't think the database log will tell you much though, and the above lines just say that there was a connection attempt from a host that didn't resolve to a name. The most likely source of information would be the webserver log for that time, where you can see the real URL that was requested. If you can get that, also look out for POST requests in the timeframe in question. Mysterious error like yours can (I don't want to stir up panic there, but it would feel wrong not to mention it) sometimes also point to issues that arise by passing on unsanitized form values. The answer is likely much more less dangerous, but taking a look at that never hurts. Keep in mind that MySQL sits on the end of the food chain. The webserver log is your most important means to deduce what happened, then the application logs may give you further insight about how it happened.
    1 point
  37. Thanks for this module. I use smart fields and got a little bit trouble using the description field. Because I chose fields which include html tags. Even if if I check "Strip Tags" in the field settings for seo_description. I guess that this setting doesn't take effect if the field was left blank. This results in: <meta name="og:description" content="<h2>KF Interactive GmbH</h2> <p> D-04107 Leipzig</p> <p>Tel.: +<br /> Fax: +<br /> Mail: <a href=" mailto:info@kf-interactive.com"=""> <p><strong>Konzeption und Gestaltung der Website:</strong><br> <a href=""></a> & KF Interactive</p> "> .. and breaks the layout. I changed line 206: - $pageData['description'] = $page->get(implode('|', $configData['descriptionSmart'])); + $pageData['description'] = strip_tags($page->get(implode('|', $configData['descriptionSmart']))); .. and everything works Maybe you could include this litte fix in a later version?
    1 point
  38. if you need some more examples,i posted 2 gists from a site i made: https://gist.github.com/outflux3/5690429 https://gist.github.com/outflux3/5690423 these should be pretty obvious and provide enough different examples to get you going with setting up the search form, search processor, and search results;
    1 point
×
×
  • Create New...