-
Posts
721 -
Joined
-
Last visited
-
Days Won
6
Everything posted by matjazp
-
I (client) might want to display news posts from remote site on his site. I could connect to remote mysql and use db queries (hmm...no). I could parse rss feed (then you have it all and not just what client needs). I know PW 3 runs in its own namespace, but believed something similar might be possible with current PW. Pages Web Service will do the job, will use it if client expresses a wish. Thanks to really smart friendly people here ;-)
-
I would like to have access to another site running PW on the same server from my templates (and modules). I would like to use PW APIs, from both "servers", something like: $pages->find(some_selector) would find pages in "local" PW $pages_remote->find(some_selector) would find pages in "remote" PW Is it possible?
-
Great to see FEEL as a module, thank you. - FrontEndEditLightbox.css.min is missing. - Maybe you should add the checkbox (unchecked by default) in the module config to add JqueryCore.js in case someone is not yet using it? - This is not working (should be name instead of text): echo $page->feel("text" => "Edit page"); - I would like to have popup opened 100% width. How can I override: .mfp-feel .mfp-content { background: #fff; max-width: 90%; max-height: 90%; } - How can I style edit button other than using positional classes? Ok, I can use exesting css and ad my styling, but would be nice if you could provide a simple textarea in config, where I could enter css? - Idea: how about automatically adding feel button to pages?
-
Update: I think I found solution. In InputFieldFile.js replaced xhr.setRequestHeader("X-FILENAME", unescape(encodeURIComponent(file.name))); to xhr.setRequestHeader("X-FILENAME", encodeURIComponent(file.name)); and then in WireUpload.php (line 134) replaced if(!$filename = $_SERVER['HTTP_X_FILENAME']) return false; with if(!$filename = rawurldecode($_SERVER['HTTP_X_FILENAME'])) return false;
-
Update: found it! It's unescape() function in the InputFieldFile.js: xhr.setRequestHeader("X-FILENAME", unescape(encodeURIComponent(file.name))); If you omit the encodeURIComponent, IE behaves as Chrome and FF: xhr.setRequestHeader("X-FILENAME", unescape(file.name));
-
I have strange problem uploading files with international names in Internet Explorer. I have a file č.txt Name: Latin Small Letter C With Caron Unicode Code Point: U+010D Unicode Character: č Decimal NCRs: č Hexadecimal NCRs: č UTF-8 Code: C4 8D Escaped Unicode: \u010D Category: Latin Extended-A When file is uploaded in Chrome or FF, letter č is sanitized to c, that is expected result. When I upload the file in IE, č is "sanitized" to a. So, I enabled tracing and also echoed the values coming into validateFilename function in WireUpload.php. This is what I found. In FF or Chrome "č.txt" is 196, 141, 46, 116, 120, 116. 46 = ".", 116 = "t", 120 = "x". 196 and 141 are C4 and 8D hex, that is UTF-8 encoding. This is expected result. In tracelog: X-FILENAME: %C4%8D.txt In IE "č.txt" is 195, 132, 194, 141, 46, 116, 120, 116. Again 46 = ".", 116 = "t", 120 = "x". But where did 195 (C3), 132 (84), 194 (C2), 141 (8D) come from? In tracelog: X-FILENAME: %C3%84%C2%8D.txt So IE is sending file name in different encoding or what?
-
Yes, it's working, thank you. Would be good to reflect this behaviour in modules directory (and github).
-
Module: Video embed for YouTube/Vimeo (TextformatterVideoEmbed)
matjazp replied to ryan's topic in Modules/Plugins
Feature request: - recognize https://youtu.be/xyz... - recognize urls in links (<a href...) (it's actually good it is not catching urls in a tags) -
Feature request: I would like to have an option to specify template(s) where the field(s) to search for video URLs. Example: search for video URL in body 'field' in templates 'gallery-item' and 'albums-item'.
-
Pages with file/image fields require a directory. Why, if there is no image/file present? I use Clean Empty Page File Dirs module occasionally.
-
tpr, I was commenting BernhardB's video, not yours. When in admin, there is javascript config variable and config.url.modules points to core modules directory so that could be used in FEEL.lightboxJSpath/lightboxCSSpath? But config is defined only when page is loaded and you need the path before that...
-
fredi had problems with fields that are not full width and (as far as I remember) it closes the modal even when there are errors (eg. required fields not entered). I think new version of fredi is using "native page editing". As I can see on the video at the provided link, your version of edit-shortcuts also requires manual page reload?
-
Looking good! I also disabled/hid the Setting tab. You should mention in docs that jquery is needed. My development version is not on root so I had to adjust the path to lightbox css/js.
-
Could the script be modified so that popup (iframe) would close itself after save ONLY if there are no errors? You are hiding tabs with javascript and that can be seen on the video...
-
I would like that each user could edit just his/her "home" page and also add/move/delete/sort etc. pages beneath his homepag. I'm aware of some modules, like PageEditPerUser, PageEditPerRole, CustomPageRoles, DynamicRoles, "Page edit per user created id" by Soma and tinacous (and probably more). How to approach this in the most scalable way?
-
API how to delete files with hook "after page save"?
matjazp replied to Juergen's topic in API & Templates
Not tested, maybe $p->removeAll() or $p->delete($p->filename) -
Yes, quiet works (at least on 2.5.4), I used it recently on pages. I found the code somewhere here on the forum, don't remember the author.
-
$p = $pages->get(1234); $p->created = '2015-07-09 11:12:13'; $p->save(array('quiet' => true));
-
Sites with A (and B) grade are almost certainly using ProCache. In real life it is really hard to get A grade without ProCache. And yes, some CMS/CMF are faster. The best results are achieved with SSD (for data and for mysql data), tested myself, almost double the speed...
- 3 replies
-
- performance
- loading
-
(and 1 more)
Tagged with:
-
I have set $start = ($input->pageNum - 1) * 20; $newposts = $posts->find("limit=20, start=$start"); $newposts->setLimit(20); $newposts->setStart($start); and pagination (and rendering the posts) is working. But this is slower than having two "independent" queries: first $pages->find(...) just to get the authors and second $pages->find(...) to get the posts. Thank you LostKobrakai and tpr.
-
I use $posts->renderPager() method for pagination. $posts = $pages->find("template=post, limit=20"); $posts->getLimit(); returns 20 $posts->getStart(); returns 0/20/40 etc. $posts->getTotal(); returns 203 $posts->count(); return 20 $posts = $pages->find("template=post"); $newposts = $posts->find("limit=20"); $newposts->getLimit(); returns 0 $newposts->getStart(); returns 0 $newposts->getTotal(); returns 203 $newposts->count(); return 0
-
Is there a better way of finding all different post authors? $posts = $pages->find("template=post"); $authors = []; foreach($posts as $p) { $authors[$p->createdUser->id] = $p->createdUser->get("title|name"); } Later on I need a selector like this: $now = time(); $posts = $pages->find("template=post, !post_expires<$now, limit=20, sort=-post_created"); So I have 2 (redundand) queries, so I would like to "extend" the first query (performance?): $newposts = $posts->find("!post_expires<$now, limit=20, sort=-post_created"); but that way pagination is not working.
-
When attempt is made to edit non existent page (http://localhost/processwire/page/edit?id=9999999) this error is shown instead of 404: Error: Call to a member function attr() on a non-object (line 350 of C:\inetpub\wwwroot\PW\wire\modules\Process\ProcessPageEdit\ProcessPageEdit.module) This error message was shown because site is in debug mode ($config->debug = true; in /site/config.php). Error has been logged. Administrator has been notified. PW 2.5.4 dev
-
Yeah, trash is just for admins, forgot that. Now I have two hooks: one on Page::trashable intended for admins, to remove trash icon, as a reminder not to shoot myself in the foot, and one on ProcessPageEdit::buildFormDelete, where I can inform the user about possible consequences about deleting the page that is referenced from another page(s). I think it would be good to have that sort of functionality available in the core or installable core module (for example user should not get deleted if he owns pages). LostKobrakai, thank you for your suggestions.
-
I tried this: wire()->addHookAfter("Page::trashable", function($event) { $page = $event->object; wire('session')->message('trashable: '.$page->id); $event->return = false; }); With that hook the trash icon in page list is gone (for all pages of course), but I can still move the page to the trash. Also, I can trash the page in Delete tab (while editing the page) unless I hook to Page::deleteable.