Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/08/2018 in all areas

  1. I'm still working on the latest version of ProcessWire (version 3.0.106) and don't have it quite ready to push to GitHub today, so we'll save that for next week. But I do have a fairly major FormBuilder release ready, and am placing it for download in the FormBuilder support board today. In this post, I'll cover what's new in this version of FormBuilder. After that, there is a how-to guide for using hooks in FormBuilder, though some might also find it also generally useful for any hooks in ProcessWire. Lastly, there's a FormBuilder hooks reference, which has been asked for a few times lately, so figured that was a good way to round out this FormBuilder blog post. Thanks for reading! https://processwire.com/blog/posts/formbuilder-v34/
    8 points
  2. To easily add rel="next" and rel="prev" tags for pagination in head section insert the following hook to your site/ready.php: $wire->addHookAfter('Page::render', function(HookEvent $event) { $page = $event->object; if($page->template == 'admin') return; $tags = ''; $config = wire('config'); if($config->urls->httpNext) { $tags .= "<link rel='next' href='{$config->urls->httpNext}'>"; } if($config->urls->httpPrev) { $tags .= "<link rel='prev' href='{$config->urls->httpPrev}'>"; } $event->return = str_replace("</head>", $tags . "</head>", $event->return); });
    6 points
  3. @BitPoet and @wbmnfktr, this might be EXACTLY what I'm looking for. I'll take a look. Thanks! I see that this a Core module, but not installed when we first install ProcessWire, I didn't remember to look there. I already used PW on about 20 projects, and for every challenge I've came across there's always a simple answer that this forum provides. Thanks.
    2 points
  4. I recently started to build Vue SPAs with ProcessWire as the backend, connected with a REST API. Thanks to code and the help of @LostKobrakai (How to use FastRoute with ProcessWire) and @clsource (REST-Helper) I got it up and running pretty quickly and now have put all of it in a site profile for others to use. It includes the REST API with routing for different endpoints, JWT Auth and a simple Vue SPA which shows the process of logging in a user (nevertheless, you don't have to use the Vue part, the API will work on it's own). Check it out here: https://github.com/thomasaull/RestApiProfile I'm pretty sure, it's not the perfect or most sophisticsted solution, but it gets the job done for me… Feedback or Improvements are very welcome Update: This site profile is a module now: https://github.com/thomasaull/RestApi
    1 point
  5. Thank you Kogondo! BTW, this is one of the most useful Modules out there! Thank you for developing it!
    1 point
  6. If you use mod_security with a CMS it isn't specifically aimed at, this is exactly the kind of nonsensical errors you will get since its pattern matches will only make sense in the context of that CMS (mostly WP). Even with a supported CMS you will likely encounter that kind of error if you build a complex, dynamic site or use less popular plugins, and you will have to adapt the rule sets. I'm pretty sure you'll find log entries from mod_security that match your 403s and 404s.
    1 point
  7. InputfieldSelectizeMultiple or ajax version – the ajax version was designed for this purpose you describe; non-ajax version has only been tested to work on maybe 500-600 select items
    1 point
  8. Also take a look at pro module Visual Page Selector which I think enables a kind of lister in the page editing.
    1 point
  9. Sure. As mentioned above by @BitPoet. Already built-in.
    1 point
  10. @Xonox, have you seen Inputfield Page Autocomplete?
    1 point
  11. Regarding #1: I personally would prefer an autocomplete page reference here - but as you or the user (client?) has to manage thousands of books this might get out of control. You have to know all the books names, authors, whatever. This can become tricky at some point. Using a page reference with checkboxes for thousands of books might slow things down very easily. Yet another option that might not work very well here. Is it possible to automate those catalog creation? Either by genre, author, release date? What could a catalog contain? Are there patterns you could use to automate things? Could someone create a .csv with references you import later or every once in a while? Regarding #2: Both. You can connect those references either with Connect Page Fields or PagefieldPairs (I prefer this one). Updating a catalog adds the reference to book and vice versa. Update: We talk about backend/administration here, right?
    1 point
  12. not sure if that has already been posted, but this is a nice article about pw: https://www.spiria.com/en/blog/website-creation/processwire-trial
    1 point
  13. OK. I'll have a look. Could you please file it as a request on GitHub? It will help remind me, thanks.
    1 point
  14. Created and sent action module to @adrian via PM if he would consider including it in Admin Actions module. Thanks @Robin S!
    1 point
  15. Try to install a fresh copy of PW to the server you have the issue and during installation PW will let you know if your server is properly configured.
    1 point
  16. I use this hook to inject edit icons into the breadcrumb. Unfortunately the options exposed by $this->wire('breadcrumbs') are not great, no page id's etc… so it's kind of a hack… public function init() { wire()->addHookAfter('AdminThemeUikit::renderBreadcrumbs', $this, 'renderBreadcrumbs'); } /** * Render a list of breadcrumbs (list items), excluding the containing <ul>. * * @return string */ public function renderBreadcrumbs(HookEvent $event) { if (!$event->return) { return; } $process = $this->wire('page')->process; if ($process == 'ProcessPageList') { return ''; } $breadcrumbs = $this->wire('breadcrumbs'); $out = ''; // don't show breadcrumbs if only one of them (subjective) if (count($breadcrumbs) < 2 && $process != 'ProcessPageEdit') { return ''; } if (strpos($this->layout, 'sidenav') === false) { $out = '<li>'.$event->object->renderQuickTreeLink().'</li>'; } foreach ($breadcrumbs as $breadcrumb) { $title = $breadcrumb->get('titleMarkup'); if (!$title) { $title = $this->wire('sanitizer')->entities1($this->_($breadcrumb->title)); } $edit = ''; $icon = $event->object->renderIcon('pencil'); if (strpos($breadcrumb->url, 'open=') > 0) { $pageid = explode('open=', $breadcrumb->url); $pageid = end($pageid); if (wire('pages')->get($pageid)->editable()) { $edit = "&nbsp;&nbsp;<a href='../edit/?id=$pageid'>$icon</a>"; } } elseif (strpos($breadcrumb->url, '../') !== false && wire('process')) { $pageid = wire('process')->getPage()->parent->id; if (wire('pages')->get($pageid)->editable()) { $edit = "&nbsp;&nbsp;<a href='../edit/?id=$pageid'>$icon</a>"; } // modify open $breadcrumb->url = "../?open=$pageid"; } $out .= "<li><a href='$breadcrumb->url'>$title</a>$edit</li>"; } if ($out) { $out = "<ul class='uk-breadcrumb'>$out</ul>"; } $event->return = $out; } @ryan maybe this would be a useful addition to AdminThemeUikit?
    1 point
  17. I don't know which version you are using, but it already work out of the box... you do not need to hack something to get it working. It already check if the post var from step 1 is an email, if not, it check against username. https://github.com/processwire/processwire/blob/dev/wire/modules/Process/ProcessForgotPassword.module#L234 In ProcessForgotPassword 1.0.3, you can configure it :
    1 point
  18. It work, just test it. The only thing which could confuse the user, its the phrase, maybe its possible to hook into the ForgotPassword module to change that. Otherwise everything is fine.
    1 point
  19. Ahh... figured it out. Had some code in ready.php that prevented the initial show. ?
    1 point
  20. This error is caused by PHP being unable to reach a source of randomness to generate random numbers (like, in this case, session IDs). The exact cause can vary, ranging from missing read access to /dev/urandom (check if it is included in php.ini's open_basedir if that restriction is configured) over too old PHP versions to improperly set up chroot jails (e.g. missing to include /dev/urandom) and probably some scenarios I can't think of off the top of my head.
    1 point
  21. You definitely should give them another try @AndZyk. Since your first post a lot of things changed. Am I really experienced? Maybe kind of. Ask me this when I finished the next 100 projects with lots of rich snippets/schema-markup. ? My examples and code snippets wouldn't be any different than any other resource out there. I really love this tool: https://technicalseo.com/seo-tools/schema-markup-generator/ You can create several kinds of markup as an example and implement them in your project. Those examples are a great starting point for everything. From breadcrumb to review or events. Test your markup over at Google and do what they want you to optimize in your markup: https://search.google.com/structured-data/testing-tool/u/0/ Check the schema.org definitions and guides for more details: http://schema.org/ Set up Google Search Console, check your markup with it and let Google crawl your optimized sites. Get reportings on errors and fix them fast. As written before: start with small parts of site (if possible) check results every 2 days for several weeks don't try to trick Google don't fake reviews don't fake review-counts or anything else If you are into Local SEO do the basics and create company and localBusiness markup with everything you can (logo, social profiles, site search, opening hours, ...), connect to Google My Business. Feel free to contact me or ask whatever you want. It's easier for me to answer a question right now.
    1 point
  22. Yeah, it's just that... non-techy persons are scared when you even mention tech lingo like "API key". They expect that we as developers handle all this stuff and don't bother them with it. I'm off to go reading some leaflet.js and Mapbox tutorials...
    1 point
  23. If the name is the same on alternative languages, PW doesn't store it cause it's redundant data. The first code is wrong, as there's only "name" in a find selector not a "name[LANGID]". You don't need to handle the language as it's handled by the user language already. The second code needs a second param to be "true" to get the default name if the localized is empty. $page->localName($lang, true). /** * Add a Page::localName function with optional $language as argument * * event param Language|string|int|bool Optional language, or boolean true for behavior of 2nd argument. * event param bool Substitute default language page name when page name is not defined for requested language. * event return string Localized language name or blank if not set * * @param HookEvent $event * */
    1 point
×
×
  • Create New...