Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/07/2017 in all areas

  1. Hi @vwatson - I have coded up a new action for the AdminActions module called: Ftp Files To Page If gives you a nice and easy GUI for choosing: the folder where you have FTP'd the files to (you can choose from any folder under /site/assets/cache/AdminActions/ the field you want the files added to the page you want the files added to whether you want the action to automatically delete the FTP folder and all files once the action is complete Hopefully once you have the AdminActions module installed, you'll find this action very easy to use. Let me know if you have any problems or any thoughts for how it might be improved.
    5 points
  2. This post includes coverage of the latest weekly core dev version, an update on ProDrafts, and more. It's a bit of a short post this week due to a change in schedule today, so some of the planned content for this week will be in next week's post. https://processwire.com/blog/posts/processwire-3.0.48-core-updates/
    4 points
  3. Have a look at: https://processwire.com/docs/tutorials/troubleshooting-guide/ The .htaccess file has lots of helpful comments in it. I'm pretty sure you'll get that fixed very quickly.
    3 points
  4. Thanks! Such minor UI tweaks can add a lot to the overall feel and they were easy to add. I just took the opportunity to harvest some glory with minimal effort
    3 points
  5. Hello, I fixed my problem. The solution was easier than its research Just needed to truncate cache table in MySQL.
    2 points
  6. In response to Teppo's Weekly #139: Thanks for the features; much appreciated! For the most part, web typography is kinda new to me. I've noticed in the past, but never really thought much about it (most people don't). So playing around with all of this is quite interesting. There is still much for me to learn in terms of best practice, and I want to see where Typeset can be improved. Whilst I really like PHP Typography (specifically the fork of it found in wp-Typography), I'd like to be able to use Typeset as a daily driver once performance has been improved as much as possible. Also, just a note about the typography textformatter: it's only slow when hyphenation is enabled; that appears to be the case from experiencing the difference on my blog. Nonetheless, it's always recommended to cache your output for better performance. No amount of performance-improvements to the modules will save the time that caching will.
    2 points
  7. Hi @franciccio-ITALIANO take a look at this post:
    2 points
  8. @Ivan Gretsky - I ended up doing some more tweaking on this and decided to commit it so you can get the new version from the modules directory now. Here's a screenshot of the tabs in action: I have also added a new: FTP Files to Page action based on this request: It works with files and images and looks like this:
    2 points
  9. A few new tweaks to the Console Panel snippets/history functionality, thanks mostly to @tpr again - he really has played a huge role in making this look as nice as it does!
    2 points
  10. Custom Inputfield Dependencies A module for ProcessWire CMS/CMF. Extends inputfield dependencies so that inputfield visibility or required status may be determined at runtime by selector or custom PHP code. Overview Custom Inputfield Dependencies adds several new settings options to the "Input" tab of "Edit Field". These are described below. Note that the visibility or required status of fields determined by the module is calculated once at the time Page Edit loads. If your dependency settings refer to fields in the page being edited then changes will not be recalculated until the page is saved and Page Edit reloaded. Usage Install the Custom Inputfield Dependencies module. Optional: for nice code highlighting of custom PHP install InputfieldAceExtended v1.2.0 or newer (currently available on the 'dev' branch of the GitHub repo). The custom inputfield dependencies are set on the "Input" tab of "Edit Field". Visibility Show only if page is matched by custom find Use InputfieldSelector to create a $pages->find() query. If the edited page is matched by the selector then the field is shown. Show only if page is matched by selector As above, but the selector string may be entered manually. Show only if custom PHP returns true Enter custom PHP/API code – if the statement returns boolean true then the field is shown. $page and $pages are available as local variables – other API variables may be accessed with $this, e.g. $this->config In most cases $page refers to the page being edited, but note that if the field is inside a repeater then $page will be the repeater page. As there could conceivably be cases where you want to use the repeater page in your custom PHP the module does not forcibly set $page to be the edited page. Instead, a helper function getEditedPage($page) is available if you want to get the edited page regardless of if the field in inside a repeater or not. $edited_page = $this->getEditedPage($page); Required The settings inputfields are the same as for Visibility above, but are used to determine if the field has 'required' status on the page being edited. https://github.com/Toutouwai/CustomInputfieldDependencies http://modules.processwire.com/modules/custom-inputfield-dependencies/
    1 point
  11. TextformatterTypographer A ProcessWire wrapper for the awesome PHP Typography class, originally authored by KINGdesk LLC and enhanced by Peter Putzer in wp-Typography. Like Smartypants, it supercharges text fields with enhanced typography and typesetting, such as smart quotations, hyphenation in 59 languages, ellipses, copyright-, trade-, and service-marks, math symbols, and more. It's based on the PHP-Typography library found over at wp-Typography, which is more frequently updated and feature rich that its original by KINGdesk LLC. The module itself is fully configurable. I haven't done extensive testing, but there is nothing complex about this, and so I only envisage a typographical bug here and there, if any.
    1 point
  12. Hi Adrian, No worries, it's ok. Good idea, functions are always good to use, less code easier to call. I understand not everyone wants the same. Maybe an inputfield with radio buttons at the module info to check if they want to export the grandchildren too can fix it. You're right. It would be a mess, even my grandchildren pages don't have the same name as the fields of the child pages while the fields have the same type. I will take a look at PHPExcel next week. If you need any help during the development of multiple languages - message me I will also search for a solution. Regards, Harmen
    1 point
  13. Hi everyone, this is more a note than a question but I also wanted to know if it is wanted to be like that, and I didn't find any Info on this. I had a structure like that: my site has a user-profile page and a PW user. The user has a page field to link it to its profile page. So far so good, but to get some information from the PW user I set a page field into the profile page, so both pages are bound by two lines (profile<=>user). Each line goes in only one direction. What happened after is this: the server run out of memory (allocation?). Seems like the page input fields run in circles. The page was still shown, but broken, with the error at the bottom. The fix was easy: just put one page field into the PW user, link that with the profile and do a $users->find("page_field=$page->id") in the template of the site. Easier done could be to use the $page->createdUser profile value, but that makes it a little more complicated to change at creating the user and profile site. Will do that later on. Many ways to go, I like that the most on PW As I understand this can happen to any pages, so be warned to not combine pages like this. There are better ways. So: is this a wanted logic? Two pages can loop into each other? Are there any security notes on something like this, maybe on the docs? Or something like small notes to DO NOT do something like this or be warned somehow? Thanks!
    1 point
  14. @FrancisChung Is this for a search you want to kick off via a page on your PW site - where the user can enter some variable search term? If so, how about a Click() handler on the submit button that issues 3 distinct ajax searches against the backend? Here's some pseudo-JQuery to illustrate the idea. To keep it shorter, this example kicks off two async ajax calls to the back-end to get search results as JSON and then renders the output once both calls have returned (either with or without data.) $('#submit-button').click(function () { var searchA = false, searchB = false; // Kick off asynchronous call to get results for search A... // return results as JSON jQuery.ajax({ url: '', // Construct a url to trigger search A success: function (result) { searchA = true; // Add code to store result JSON... rendezvous(searchA, searchB); } }); // Kick off asynchronous call to get results for search B... // return results as JSON jQuery.ajax({ url: '', // Construct a url to trigger search B success: function (result) { searchB = true; // Add code to store result JSON... rendezvous(searchA, searchB); } }); }); function rendezvous(A, B) { if (A & B) { // Use JQuery to combine, format & render search results in your current page } }
    1 point
  15. Syntax of your apache directive is fine. Just to mention you are using AND for the conditions. You maybe prefer OR? RewriteCond %{HTTPS} !=on [OR] RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] RewriteRule (.*) https://%1%{REQUEST_URI} [L,R=301] EDIT: This code has issues, go here: #136046
    1 point
  16. I tested this and can confirm the issue - I believe it's a bug and created a GitHub issue for it: https://github.com/processwire/processwire-issues/issues/152 The issue only occurs when both Page fields are 'single' fields.
    1 point
  17. Hi Harmen, Sorry it's taken me a while to respond to your post. I took a quick look at the code you added and I think all that logic needs to end up in a function that we can call for children and then again for grandchildren, rather than duplicating. I am honestly wondering if this is a good fit for BCE because I am not sure that everyone will want the same formatting for grandchildren, although honestly I don't know how it looks yet, but grandchildren can have different templates/fields which would surely make a mess in a CSV? I wonder if you'd be better off with something like a custom implementation using PHPExcel (https://github.com/PHPOffice/PHPExcel). I do however agree with adding options for multilanguage support for exports. I don't expect this should be too difficult if we take the approach of a separate column for each language version of each field. Cheers, Adrian
    1 point
  18. Yes - sorry, I thought I had linked to it earlier: Blog post documentation: http://processwire.com/blog/posts/introducing-tracy-debugger/ Forum thread: https://processwire.com/talk/topic/12208-tracy-debugger/ Modules directory: http://modules.processwire.com/modules/tracy-debugger/
    1 point
  19. Check out the PW Info and Template Resources panels in Tracy. Those will show all sorts of info on the contents of fields (and their settings) as well as the variables you have defined manually in your templates.
    1 point
  20. Just a heads up that there is a bug in the new file compiler code in 3.0.48: https://github.com/processwire/processwire-issues/issues/151 You guys may not want to upgrade until @ryan has sorted this one out. Not sure how likely it will be to affect typical template code, but it currently breaks Tracy.
    1 point
  21. Sounds that you may have a Js error, is there any in the devtools console?
    1 point
  22. You could FTP your files to an "uploads" directory and them import them to a field on a page using the API. For example, to add PDF files in /uploads/ to a field named "files" on the Home page... // function for adding files function addFiles($file_extension, $page_id, $files_field_name) { $files = glob( wire('config')->paths->root . "uploads/*.$file_extension" ); $p = wire('pages')->get($page_id); $p->of(false); foreach($files as $file) { $p->$files_field_name->add($file); } $p->save(); } // call the function with arguments to suit addFiles('pdf', 1, 'files'); Remember to delete the files from the uploads directory after each successful import.
    1 point
  23. @Martijn Geerts So that's a kinda fire and forget approach? There's no way to retrieve any of the output of that curl request. @FrancisChung I had great joy exploring a bit about what's possible with elixir. It's a great language for concurrent programming and not as hard to grasp as erlang even though it runs on the same runtime.
    1 point
  24. I've done a thing like this: Here (not in this part of the script) I test for all variables, when oké, I'll post to the same URL with an added URLSegment called 'curl'. So the the script will be executed again, but then over shell_exec an out of the session. You should note that all output even errors will have a nice journey into /dev/null so they are gone. For error handling you're on your own. // Success if (!count($this->errors)) { $query = http_build_query($this->postArray); // point output to /dev/null/ shell_exec("curl --data '$query' " . $this->page->httpUrl . "curl/ 2>/dev/null >/dev/null &"); $this->json['success'] = true; // Show errors, abort } else { $this->json['errors'] = $this->errors; }
    1 point
  25. In light of the above, I've been working on a port of Typset from JS to PHP: https://github.com/mikerockett/php-typeset It doesn't include hyphenation, but does add features not found in the original JS version. It's currently in alpha, and I'll make a Textformatter for it when it's stable. I haven't done benchmarking between Typography and Typeset, but I can already feel that Typeset is faster. Sensible (common) defaults are set. If you're keen to have a look, please let me know what you think. ?
    1 point
  26. I would go with Media Manager or with a combination of pages (own central pagetree for documents) and may i use http://modules.processwire.com/modules/fieldtype-runtime-markup/ to generate a upload button (or use ?modal or something else).... But Media Manager is definitly build for such approach. best regards mr-fan
    1 point
  27. Media Manager might be the slickest option for this. Not 100% sure but I think it allows you to upload new media directly from a page being edited. If you want a no-cost solution you could look at adapting this module from @mr-fan, which is based on code by @adrian https://github.com/mr-fan/AutoImagePages But it doesn't allow for the uploading of new files directly from a page being edited - you must upload from the parent page of the files/images branch.
    1 point
  28. Hi doolin, I would suggest checking this post from Soma, which "corrects" ryan's original code for the custom login. Concerning the redirection after logging out, I am assuming that you are using the link in the admin area, right? Since the admin doesn't know about your custom login page, it can't redirect to it. You need to hook into the Session::logout function to force redirection to the right login page, for example with a module: class CustomLogout extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'Custom Logout', 'summary' => 'Redirects to a custom login page after logout', 'singular' => true, 'autoload' => true ); } public function init() { $this->addHookAfter('Session::logout', function($event) { $this->session->redirect($this->pages->get('/login/')->url); }); } } Concerning the login page itself, it should remain accessible for non-admin users, since they need to access it to login. What you could simply do is make it non-editable by non-admin users by configuring the permissions for the login template (in the Access tab). Removing it from the page tree is somewhat of a hassle...
    1 point
×
×
  • Create New...