Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/18/2020 in all areas

  1. This week the core version remains at 3.0.166, but 3.0.167 should be ready by next week. The main reason I'm not bumping the version is just because a couple additional updates I want to get in 3.0.167 are started by not yet fully finished. Below is a look at what's been committed to the dev branch this week so far: Added custom Page class support for the Language class by implementing your own LanguagePage class that extends it (i.e. /site/classes/LanguagePage.php). Added a PR from MoritzLost with improvements to the CURL support in the WireHttp class. Added a new method to the Fieldtype interface named getMatchQuerySort() this method lets a Fieldtype module optionally manage the query when a $pages->find() requests a sort by a field/subfield handled by the Fieldtype. The first implementation of the getMatchQuerySort() method was added for FieldtypeOptions, which now lets you sort by option values or titles, despite those values and labels being in a separate table that the rest of ProcessWire doesn’t know about. Added a new getAfterLoginUrl() method to the Process module interface which lets Process modules optionally sanitize and validate request URLs to the module for a non-logged-in user. The resulting URL can be automatically redirected to once the user has logged-in. While the method has been added and implemented in several core Process modules, it is not yet used by the core after login—that will come next week in 3.0.167. Previously the only aspect of an admin URL that could survive login was an “id” integer in the query string. This week there were also several optimizations and improvements made to the PageFinder class and resolutions to 4 issue reports. Thanks for reading, have a great weekend!
    12 points
  2. I did. It turned out to be a setting on the webhost's end and they were able to fix it. Thanks! Sorry for taking up space here, but I was in a bit of a panic.
    1 point
  3. Sounds like a minor thing in the end just to finish the post, unless it's your issue, your site falls apart without it being solved) Thanks!
    1 point
  4. I don't remember why there are all these checks in hookAfterTemplateRender, but in such way it could identify a template that was used for rendering of the current page
    1 point
  5. @Ivan Gretsky I am not sure that this will help, but for one project I been using these hooks for a similar task. Maybe it will give you some ideas. public function init() { $this->addHookBefore('PageRender::renderPage', $this, 'hookBeforePageRenderTemplater'); $this->addHookAfter('TemplateFile::render', $this, 'hookAfterTemplateRender'); $this->wire('config')->ignoreTemplateFileRegex = "/(\.before\.)|(\.after\.)|(\.{$this->template_files_suffix}\.)|(^_)/"; } public function hookBeforePageRenderTemplater($e) { $event = $e->arguments(0); $page = $event->object; if ($page->template->name == 'admin') return; $options = $event->arguments(0); $template = $page->template; $options['prependFiles'] = [ "{$template}.before.php", "_init.php", ]; $options['appendFiles'] = [ "{$template}.after.php", "_after.php", ]; $event->setArgument(0, $options); } public function hookAfterTemplateRender($event) { if ($this->wire('page') == null) return; if (strpos($event->object->filename, 'TracyDebugger') !== false) return; if (str_replace('site/assets/cache/FileCompiler/', '', $event->object->filename) !== $this->wire('page')->template->filename) return; if (strpos($_SERVER['REQUEST_URI'], $this->wire('config')->urls->admin) === 0 || $this->wire('page')->template->name == 'admin') return; $template = $event->object; $options = $template->options; if (is_array($options) && array_key_exists('pageStack', $options)) { $view = $this->wire($this->api_view_var); $layout = $this->wire($this->api_layout_var); $page = $this->wire('page'); $page_template = $page->template; if ($template->halt) { return; }; if (empty($options['pageStack']) && $page_template->templater_url_segments) $this->wire('session')->redirect($page->url); $template_name = ($page->template->altFilename) ? $page->template->altFilename : $page->template->name; $view_file = $this->getViewFilePath($template_name); if (is_file($view_file)) { $view->setFilename($view_file); } else { throw new WireException("View file for this page template ({$view_file}) does not exist"); } $event->return = $event->return . $layout->render(); } }
    1 point
  6. No direct answer from me) Just googled that and this seems to be something you might want to take a look at.
    1 point
  7. I checked my site that had custom styles. This is what I have there in site/modules/InputfieldCKEditor/mystyles.js: CKEDITOR.stylesSet.add( 'mystyles', [ { name: 'Inline Code', element: 'code' }, { name: 'Inline Quotation', element: 'q' }, { name: 'Left Aligned Photo', element: 'img', attributes: { 'class': 'align_left' } }, { name: 'Right Aligned Photo', element: 'img', attributes: { 'class': 'align_right' } }, { name: 'Centered Photo', element: 'img', attributes: { 'class': 'align_center' } }, { name: 'Small', element: 'small' }, { name: 'Deleted Text', element: 'del' }, { name: 'Inserted Text', element: 'ins' }, { name: 'Cited Work', element: 'cite' }, { name: 'Left Heading', element: 'h2', attributes: { 'class': 'u-align-left' } }, { name: 'Right Heading', element: 'h2', attributes: { 'class': 'u-align-right' } }, { name: 'Important', element: 'div', attributes: { 'class': 'u-important u-important--brand' } }, { name: 'Bordered Table', element: 'div', attributes: { 'class': 'u-table-bordered' } } ]); My added styles are at the end of the list. They do work, if there is only one CKEditor field on the page edited (see this issue). Also keep in mind, that the styles for ul elements are only shown when this type of element is selected in the editor working area. P.S. If everything works out, don't forget to add you custom styles to site/modules/InputfieldCKEditor/contents.css or site/modules/InputfieldCKEditor/contents-inline.css so they display as they should: ... .u-important--brand { font-size: 21px; line-height: 1.3; padding-left: 40px; } .u-table-bordered { color: blue; }
    1 point
  8. Thanks a lot @Ivan Gretsky! You're right, it was way easier than I thought! It worked like a charm! ?
    1 point
  9. I have opened a ticket on GitHub, in which I present a modification respectively a proof of concept, which significantly improves the editing of pages, especially with long contents. The save buttons are always in view with this modification, and the scroll position when editing and saving is saved and restored after saving. You can also find a screencast and code extensions on GitHub. What do you think of that? Link: https://github.com/processwire/processwire-requests/issues/177
    1 point
  10. Ok, maybe scoping is what is in the way. Try setting as $GLOBALS["alreadyExecuted"].
    1 point
  11. Unfortunately I cannot reproduce the problem at all. Please try the new version. Otherwise I can only imagine that the module collides with the JS code of another module. Maybe you can give me access to a test system so I can have a look at it.
    1 point
  12. Version Update 2.0.0 The current version has got some improvements, bug fixes and new features. Many thanks to @Autofahrn, who created the idea and code base for copying multiple items at once! Amazing feature! Also, there is now the option to disable the copy and paste dialogs. Last but not least, thanks to @joshua, for suggesting a bug-fix in context with normal repeater fields. All information and downloads are updated in the first post.
    1 point
  13. Thanks! I can work around it for now. Issue opened: https://github.com/processwire/processwire-issues/issues/1247
    1 point
  14. It's a bug - please open an issue on GitHub to bring it to Ryan's attention. The URL segments array has a 1-based index but this is lost to a 0-based index when the array is reversed here: https://github.com/processwire/processwire/blob/ee4c46a442f09cf81f9e1800c5fdfcd1176f538a/wire/core/WireInput.php#L576 As a workaround for now you could do this: $segments = $input->urlSegments; $last_segment = end($segments);
    1 point
  15. A bit offtop... Maybe such epic modules like Tracy Debugger (and AOS, and some else, probably) could get their own sub-forums under Modules/Plugins? Kind of like Padloper got its own under Vip Support? I am sure, it can be done and (arguably) would make it easier for people to find stuff. But would it make it easier for maintainers? What do you think, @adrian?
    1 point
  16. Just wanted to make a note here that I just wasted several hours trying to debug why I couldn't manually add or delete rows from a table when this module was installed. Turns out it was PHP's max_input_vars setting being too low, but no error was being logged anywhere. In the process of debugging I did fix a few bugs related to Table fields inside Repeaters and some other cleanup, so perhaps it was a worthwhile waste of time after all ?
    1 point
×
×
  • Create New...