-
Posts
2,008 -
Joined
-
Last visited
-
Days Won
21
Everything posted by dragan
-
I was thinking about writing a module: Enabling PW to index and search contents of uploaded files. I know the easiest way to include search-inside-files capability is to use Google CSE. Developers who have a dedicated server may of course use of of the "big boys" of search like Lucene, ElasticSearch, Solr etc. For ES you'll need Apache Tomcat, which most people don't have at their disposal, etc. So, my question is, first of all: Would such a feature be used at all? I know you can create some sort of meta-search with file-descriptions, or when using the "one page per file" approach. After some brainstorming, I came up with this: Idea: Make it possible to search file upload content (PDFs, Word, Excel) Approach: Build a module (d'oh) Config settings: select templates / file-fields (what to index) - list all inputfields type "file" “index now” button or “index each time a file is added” or cron? Performance? Where / how to store indexes? As a separate, new field inside each page? On the file-system? In the module folder, each file has a related JSON file? (similar to language files) A new, separate DB-table? What we need: filename / path / URL filetype (to customize search results with file-icons) page id extracted content timestamp of last index-build? MD5/SHA hash or some such? How to handle user roles when doing actual search? Inherit from page? Inherit from file-field? So, what do you think? Not worth it? Does something like this already exist (I searched, but found nothing)?
- 7 replies
-
- file-search
- uploads
-
(and 2 more)
Tagged with:
-
PW > 3.0.86: PNG images can't be cropped anymore?
dragan replied to titanium's topic in General Support
With 3.0.86 in Firefox Quantum (Windows 10) I see all kinds of weird stuff: First time after saving a new PNG (upload pic, save page), then click on "crop", I get weird dimensions: someting like 1200 x 33px instead of 1200x1800px. Second try: Image shows in correct width/height proportions, crop seems to work alright. I hit save, and "save as copy", but I get an exact same size copy as the original. No error messages either in JS console.* A third try on that "cropped, but not actually cropped" image gets more weird: the image is now shown as a 50x60px thumbnail, but the values in pixels show something else entirely. * I get heaps of CSS warnings though: e.g. cropper.min.css Editing / cropping JPGs works fine, btw. -
Unified Documentation Resource for Processwire
dragan replied to Orkun's topic in Wishlist & Roadmap
Sure. But having a search that crawls several domains/sites in one go is surely a plus. And frankly, there is no reason not to have uBlock installed and running Also, since I switched from Chrome to Firefox Quantum recently, I realized there's apparently still no way to add a custom search like pre-Quantum (right inside the search/location field) with a keyword, like in Chrome. But I guess I'm nerding out now so I'll shut up.- 11 replies
-
- 1
-
-
- documentation
- resource
-
(and 2 more)
Tagged with:
-
Unified Documentation Resource for Processwire
dragan replied to Orkun's topic in Wishlist & Roadmap
Case in point: It took me all of 5 minutes to create a Google CSE with all of the URLs mentioned in the first post - plus Ryan's github repo: https://cse.google.com/cse/publicurl?cx=013706179141317928628:dendm4c3gpq- 11 replies
-
- 3
-
-
- documentation
- resource
-
(and 2 more)
Tagged with:
-
Unified Documentation Resource for Processwire
dragan replied to Orkun's topic in Wishlist & Roadmap
In addition to what already has been said in this thread, I'd like to add this: Of all open-source projects I ever came across, PW is very well documented. I've seen commercial apps which are documented far worse. Can it be improved? Certainly. Will it ever be 100% complete and perfect - and suit everyone? I don't think so. But I found that I can easily get most infos with a "keyword site:.processwire.com" Google query. Building your own bookmark collection helps. Keeping up-to-date by signing up to the PW newsletter helps as well. Digging into the source code helps too (as @bernhard recently has shown with his module-tutorial, there are true treasures buried right inside core code). Having said all that, maybe it would be worthwhile to try and build a Google CSE (custom search engine), which should be free to use for non-commercial / open-source communities, at least last time I checked. That's not to say I would oppose a unified docs.processwire.com project; but the effort is not to be under-estimated.- 11 replies
-
- 2
-
-
- documentation
- resource
-
(and 2 more)
Tagged with:
-
Not sure, but I would first of all look at the XML file. Has anything changed recently? What happens if you "manually" grab the XML, and update/create page(s)?
-
Yep - that did it (I installed WireMailSmtp, but I'm not sure I ever actually used it...). Thanks!
-
fwiw, with just two CSS declarations and taking your raw code, manually adding 4 items, it looks something like this: did you forget your floats?
-
is the site public to view somewhere? This looks to me like a CSS or HTML issue, rather than PHP or PW-related. Did you run it through W3C validator to see if the tags are all nested correctly?
-
I just installed this module to do a basic test. I don't see the error @dougwoodrow sees, but I'm having a problem with mails not being sent. Log from module: "[ERROR] Mail has not been sent to ..." Log from Wiremailsmtp_errors: Error in hnsmtp::send : cannot connect to smtp-server!
-
Did you check out Dynamic Roles? (PW3-compatible version here)
-
Thanks. However, that sets the html title, not the h1 that users see when visiting the page. Strangely, with code like this there is no h1 output at all: public function ___executeMySecondPage() { $headline = 'Happy ' . date('Y'); $this->headline($headline); $this->wire('processBrowserTitle', $headline); return '<p> Hello Page2 :) </p> <p> <a href="./" class="ui-button ui-state-default"> Go to Page 1 </a> </p>'; } Did Ryan tell you where all these "secret" methods are hidden?
-
@bernhard going through your epic tutorial again and again, I discover stuff I overlooked the first time. e.g. I didn't know it was so easy to add an additional page to a module such as you describe @ https://processwire.com/blog/posts/building-custom-admin-pages-with-process-modules/#hello-page2 Quick question: Do you know if there is a native PW method I can use here to define my own h1 title that looks a bit more human-readable? i.e. being able to display "My Second Page" instead of "Mysecondpage". I tried camel case and underscores for the function-name - didn't work.
-
[solved] How to add action buttons fieldtype for each repeater
dragan replied to Federico's topic in General Support
Just use InputfieldMarkup instead -
Welcome to the forum @FireDaemon Did you read this page? https://processwire.com/docs/security/admin/ Yes. In fact, during install process you are asked if you want to rename it. But you can do it later also. You could try this module. Yes That's already in core: see https://processwire.com/docs/security/admin/#preventing-dictionary-attacks In a test-environment, you can further add stuff like .htaccess allow/deny rules, i.e. only allow access from certain IPs.
-
Sidenote: Even if you come across a template that is not behaving as responsive as you think it should, you can easily change it... case in point: I would expect the phone view to put the article (main content) first, not the sidebar. http://themes.semicolonweb.com/html/canvas/blog-single-split-both-sidebar.html
- 23 replies
-
- 2
-
-
- template
- website template
-
(and 2 more)
Tagged with:
-
How could I assign specific admin page for user role?
dragan replied to adrianmak's topic in General Support
There's also this module: I just installed it on a 3.0.86 site - it works as advertised -
sigh... I must say some folks are quite good at marketing. I don't blame them. It's a free market. There's nothing I saw in this article that wouldn't be possible with PW (and without any extra modules either), more or less out of the box. What Magnolia calls fragments is apparently nothing more than PW's fields. But I have to hand it to them, they seem to know how to translate all that tech lingo to marketing speak.
-
[solved] How to add action buttons fieldtype for each repeater
dragan replied to Federico's topic in General Support
$wire->addHookAfter('Inputfield::render', function (HookEvent $event) { $field = $event->object; if (substr($field->name, 0, 13) === 'repeater_item') { $page = $event->arguments(0); $id = str_replace('repeater_item_', '', $field->name); $submitID = "submitRepeaterItem_$id"; $form = wire('modules')->get("InputfieldForm"); $submit = wire('modules')->get("InputfieldButton"); $submit->attr("value", "Edit this repeater item as page"); $submit->attr('data-href', wire('config')->urls->admin . "page/edit/?id=$id"); $submit->addClass('pw-panel'); $submit->addClass('uk-margin-left'); $submit->attr("id+name", $submitID); $form->append($submit); $myForm = $form->render(); $event->return .= $myForm; } }); I've got this in ready.php... seems to work. -
[solved] How to add action buttons fieldtype for each repeater
dragan replied to Federico's topic in General Support
Great Obi-Wan @bernhard: Yes, of course. I was just quickly copy-and-pasting from Chrome inspector... wanting to do a quick "proof of concept". @Federico As the RM module docs mention, "The field's value is accessible from the ProcessWire API in the frontend like any other field, i.e. it has access to $page and $pages.". I also made hints in my example code where IDs are used, that this should be populated by your custom PHP code (make-this-id-unique). -
Canvas has both kinds: Country AND Western! ahem... LESS + SASS
- 23 replies
-
- 5
-
-
- template
- website template
-
(and 2 more)
Tagged with:
-
That's right. Lister was never meant to be used in the frontend. If you just want to use Lister to create a selector, you just turn on debug mode and you'll see a yellow-highlighted text at the bottom of the Lister result screen with your current selector, i.e. template=52, teamLangSkills=1084, address%=zürich, limit=25, sort=lastName, include=unpublished You can use the exact same selector of course in the frontend too. Not sure why you want to use Hanna Code for that. But in plain PHP, you'd just do: $selector = 'template=52, teamLangSkills=1084, address%=zürich, limit=25, sort=lastName, include=unpublished'; $pgs = $pages->find($selector); if($pgs) { $out = '<ul>'; foreach($pgs as $p) { $out .= "<li><a href='{$p->url}'>{$p->title}</a></li>"; } $out .= '</ul>'; echo $out; } I guess you can store this inside a Hanna block. I don't know how you can directly access a certain Lister bookmark selector, but I'm sure it's possible.
-
I can't fully answer this question either, but I would never change the guest role. It's required, default for everyone. Can you describe in more detail what your setup is and what you want to achieve? Which PW version do you use? There's a relatively new feature that makes role-assigning much easier. Did you check that out? https://processwire.com/blog/posts/processwire-3.0.81-upgrades-the-role-editor/ Furthermore, if you need even more fine-grained rights, there's Dynamic Roles: Go to page 3 of that thread to find a PW 3 compatible version.
-
@psy although I don't have a need to look out for a theme for a client project, I decided to buy the Canvas theme anyhow. Right now there's a sale going on, so it's only $10 Gonna use it to quickly build prototypes and whatnot... It will surely look better than "naked" Bootstrap/Foundation setups....
- 23 replies
-
- 2
-
-
- template
- website template
-
(and 2 more)
Tagged with: