Leaderboard
Popular Content
Showing content with the highest reputation on 07/15/2018 in all areas
-
Your problem is not with PW since you're not even reaching PW, from what you said. Your problem is most likely with pointing the domain to the new server. So take it slower, instead of moving PW just put a index.html (this eliminates most steps) file on the new server and try to access that. Once you reach that index.html start moving PW.2 points
-
Continuing from last week's post, ProcessWire 3.0.108 is now available on the dev branch, and it adds support for a new, more powerful live search in the admin. This week we will take a closer look at how it works, as well as how module developers can make their modules searchable too. https://processwire.com/blog/posts/pw-3.0.108/1 point
-
Thanks for the answers! Tried that and didn't work. Yes, this works. Well, there are all kinds of folks ? If I can enter "title=foo" I expected I could also enter "id=1234"... What I meant with "What pages to show" is Lister eg. this link: /processwire/page/search/ Maybe this should be the default "result" if the search term is empty and you press enter. Now you get "The process returned no content." and that probably isn't very helpful?1 point
-
there is FieldtypeHandsontable which is exactly what you displayed, it lets you have an excel-like input field. Very cool and useful thanks to @bernhard1 point
-
Maybe we can support other options here, though I'm not going to be able to remember special characters or combinations in this (or be able to easily communicate that to others), just need to keep it as straightforward as possible. I did try "?" but it's too short for autocomplete. I'm not too worried about people not being able to search for "help", as I'm guessing it's pretty rare, and there's already the much more power Pages > Find, if someone can't accomplish something with the live search. Also, this help thing was really about introducing the feature and communicate how to use it in the blog post. I added it last minute as part of writing the blog post, and not certain it's really needed or will stay long term. Though if it did stick around, I suppose it could show a "type 'help' for instructions" link in a tiny dropdown when you are focused in an empty search box. Any module that manages items of any sort. In the core, these modules implement the searchable interface: ProcessField, ProcessTemplate, ProcessCommentsManager, ProcessPageType, ProcessUser. I left pages and modules implemented internally, because it ended up being more efficient to do so. I can't speak to other people's modules, but for me I'm adding support in FormBuilder, DatabaseBackups, HannaCode and ProcessWireAPI. This is primarily a text searching engine. I wasn't thinking folks would search for pages by ID in this search box. But it looks like "id==1001" or "pages.id==1001" does work (like rafaoski mentioned). I'm not sure I understand what you mean about getting your previous search, this sounds more like Lister?1 point
-
Your first example isn't working for two reasons I can see. Though maybe these are ones you already know, but jut in case: 1) it needs to be in your /site/ready.php or /site/init.php file; 2) The addHookAfter() call is commented out, so it never gets hooked; 3) your str_replace() looks to me like it would result in 2 slashes being present at the end, rather than one (due to the rtrim). Another thing to consider is that $page->path() does not return a URL. It returns a page path. The might be the same in many instances, but if PW is running from a subdirectory, they won't. Also, neither are intended to be returning query strings, so it's kind of taking these methods outside the scope of what they are intended. Maybe it's okay to do, I'm not certain but I might suggest instead adding your own custom URL function or method, and using that to get these custom URLs for when you want them. For instance, you could add Page::myurl() method in your /site/init.php file: $wire->addHookMethod('Page::myurl', function($event) { $page = $event->object; $path = $page->path(); // determine if it's a going to be a custom URL if(strpos($path, '/page/') === 0) { // replace /page/ with /article/ list(,$path) = explode('/page/', $path, 2); $path = "/article/$path"; } // convert path to URL $url = $event->wire('config')->urls->root . ltrim($path, '/'); // add in any query string params stored in $input->whitelist $queryString = $event->wire('input')->whitelist->queryString(); if(strlen($queryString)) $url .= '?' . $queryString; // return the URL $event->return = $url; } Now, rather than calling $page->url(), you can call $page->myurl() for any of the cases where you want to use these custom URLs. Another strategy would be to change everything after the entire page has rendered, like with a after Page::render hook. Though I don't think I'd use that if your intention is to add query strings to URLs.1 point
-
Your problem is unrelated to PW. You can read here how to move a PW site, but the steps apply to most CMS's, just step 5 is specific to PW in that the file name and its location differ from cms to cms. That's why i said it's unrelated to PW, there is nothing special about moving a PW site compared to moving any other site. Have you actually contacted them? And as I said before no one can help you with the little info you provided. What kind of hosting do you have (shared, vps etc)? Do you have a control panel? Do you have phpmyadmin? Who handles your domain?1 point
-
I've updated in the modules directory. Don't have time at the moment to look at this – if its needed urgently, please submit a merge request. ?1 point
-
The module has been moved to GitLab: https://gitlab.com/rockettpw/seo/markup-sitemap I have tagged 0.4.1-RC3, but have not yet updated it in the modules directory. Need to fire up the old laptop to get credentials for that.1 point
-
https://www.i-programmer.info/news/83-mobliephone/11963-ten-years-of-the-apple-app-store.html some highlights for TL;DR readers: "...if it was a free market, then Apple would not have made more than an estimated $100 billion over the time, but programmers would be that much better off." "No right of appeal and if you talk to journalists then Apple has no intention of helping you at all. That this is an authoritarian regime isn't a point that you can argue against." "Windows Apps are almost as locked down as iOS apps. Only Google made the stupid mistake of letting Android go open source and it has been working steadily to take control back ever since. Assuming Android is still around in ten years time, my bet would be that the Play store will be just as much a walled garden as the others." "The App Store is mostly full of small apps that do frivolous things - it's a trinket store. Let's get back to real computing."1 point
-
Hello, I need some help with changing the URL for default language pages. I have two languages one is hidden at the moment for future use. Now I would like the default language URL to be only the site name and a page without /en how can I achieve that. I want my URL to be like www.mysite.com/jobs and not www.mysite.com/en/jobs. Now only the home page has the right URL all other have /en. ... I looked through the forum but no luck so far. Thank you R Ok, I got it, I just had to delete the EN in my homepage setting and now it is working, I found it on a forum. Thank you anyway1 point
-
If all you want the edit page to show is a list of children then maybe you would be better off replacing ProcessPageEdit::execute() entirely. E.g. $wire->addHookBefore('ProcessPageEdit::execute', function(HookEvent $event) { /* @var ProcessPageEdit $ppe */ $ppe = $event->object; $page = $ppe->getPage(); if($page->template != 'my-template') return; $event->replace = true; /* @var InputfieldForm $form */ $form = $this->modules->InputfieldForm; /* @var InputfieldMarkup $f */ $f = $this->modules->InputfieldMarkup; $f->name = 'ChildrenPageList'; $f->label = 'Children / Subpages'; if($page->numChildren) { /* @var ProcessPageList $ppl */ $ppl = $this->modules->ProcessPageList; $ppl->id = $page->id; $ppl->showRootPage = false; $f->value = $ppl->execute(); $template_sortfield = $page->template->sortfield; if($template_sortfield && $template_sortfield != 'sort') { $f->notes = sprintf('Children are sorted by "%s", per the template setting.', $template_sortfield); } } else { $f->description = 'There are currently no children/subpages below this page.'; } $form->add($f); $event->return = $form->render(); }); If you wanted the "Add New Page Here" button and "Sort Settings" fieldset too then you could add those by borrowing from the code in ProcessPageEdit::buildFormChildren().1 point
-
Many thanks @Robin S and @adrian, finally I managed to find time and come back to this. Interestingly, I already was on the right track with my own first try ?: // JS in Markup to toggle the Tab-Url $markUp = wire('modules')->get('InputfieldMarkup'); ob_start(); ?> <script> function hnConfigureEditorChildrenTab() { document.location.replace('#ProcessPageEditChildren', '') + '#ProcessPageEditChildren'; //var dropDown = $('.pw-button-dropdown').children(); //console.log(dropDown); //dropDown.children().each().attr('style', 'display:none!important;'); } document.body.onload = hnConfigureEditorChildrenTab(); </script> <?php $markUp->value = ob_get_clean(); $form->append($markUp); The first JS line triggers a click on the tab too, by rewriting the location href with a newly added anchor. ? But it wasn't bullet proof. 20% the time, it doesn't work. So, many thanks for your solutions and the hint with the name-field! ------ Another issue I have in the wider context is, that I want to hide the save buttons on that template, because it only has informational character. // remove save button $saveButton = $form->children->get('id=submit_save'); $form->remove($saveButton); This results in removing the top-right placed button completly, but with some left over from the bottom-left placed button: ==> I'm not sure why it behvaes like this. Maybe it has to do with that there are two items with the same ID (submit_save) in the DOM? EDIT: I now solved it by injecting some styles, as targetting this by JS dindn't fully work. Maybe because AOS also targets the dropdowns when selected there "show on_hover instead on_click"? <style> #submit_save, #pw-dropdown-toggle-submit_save, #wrap_submit_save, #pw-dropdown-toggle-submit_save_copy, .pw-button-dropdown-wrap { display: none !important; } </style> Now my pages look as they should ?1 point
-
Not exactly simple, I use a CentOS server hosting KVM virtual machine running CentOS and ispconfig3. The VM is bridged on to my local LAN. ispconfig allows easy setup of additional websites for experimentation, I currently have over 20 different local domain websites for testing running off one server. Each site allows shell access, so I just use scp/winscp to download/upload files, cli mysql/mysqldump to dump and save databases, and usually just do all my editing in vim from the command line shell access. Occasionally I sshfs mount the "remote" site filesystem and use some gui IDE, usually geany or eclipse. The biggest roadblock is getting an ispconfig3 server installed and running. The ispconfig folks provide a nice tutorial, but it still takes some time and effort to get it set up, but once you do it offers a nice development environment.1 point
-
@BitPoet Thank you very much for the heads-up. Also to @Robin S. I finally ended up with this hook function in a module context which does exactly what I need, also in ajax mode: $this->addHookAfter('Field::getInputfield', $this, "lockConfirmedItems"); public function lockConfirmedItems(HookEvent $event) { if($this->user->isSuperuser() || $this->user->hasRole('certificationadmin')) return; $thisPage = wire('page'); // // Only run our locking logic if we are editing a user in the backend if($thisPage->process != "ProcessUser") return; $repeaterPage = $event->arguments(0); $context = $event->arguments(1); if($context != "_repeater" . $repeaterPage->id) return; if(!$repeaterPage->confirmed) return; $event->return->collapsed = 7; } Setting collapsed with the Inputfield constants like in BitPoet's code didn't work for me.1 point