Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/07/2019 in all areas

  1. WIP module (90% done) following this request expression of interest ? by @szabesz. A (Process) module that allows the posting of Notes in the ProcessWire admin. Inspired by WP Dashboard Notes (see video in link above). The module is almost complete. As usual, I hit a snag with the CSS! PRs highly welcome, please! (see below). Setting note sizes and display was a bit tricky. Module is now available for alpha testing here. https://github.com/kongondo/DashboardNotes Contributing I should have mentioned this earlier and done it properly but I am lazy, so this is the rough guide. I know we all have our preferences but please note: No heredoc syntax No alternative syntax for control structures (i.e. endif, etc) Indent using tabs (4) Doesn't matter in this case, but no PHP short tags For methods, opening curly bracket on same line as the method name (there's a technical wording for this, I can't remember now) Features Set Notes priority (low/normal/high) Note text and background colours Enable/disable replies to Notes Lock Notes for editing Viewing of Notes can be controlled using users IDs, roles or permissions. Default is all Notes can be viewed by all who have access to the module Edit Note after posting Global note settings (accessible only to those with dashboard-notes-settings permission) - default colours, date format, if users can delete notes they did not create, if users can edit notes they did not create, note display dimensions, maximum depth of (nested) replies, maximum characters of note preview before truncate, etc.) Sort notes by date, title or priority Pending Bulk actions (delete, lock, change priority, etc) Reply/commenting on notes More testing on visibility Requests/Ideas Mine is: PRs are welcome! Especially with the CSS and/or Design (Use the Dev Branch please) Display Note author title (if present, or any other named author title field) rather than their (user)name? Other? Screenshots Thanks!
    2 points
  2. If you have a large number of images in the gallery it would be better not to load all the pages into memory only to display a portion of them with slice(). Better to use start and limit in your selector to get only the pages you will display. You could adapt the example given here:
    2 points
  3. Actually, looking at this, it works as expected for me:
    2 points
  4. Technically there isn't any good or bad template to import into processwire. In any template you want to import you have to replace content between the html tags with your own php and processwire api. That is all. Some free html5 templates here: https://www.free-css.com/free-css-templates https://templated.co/
    2 points
  5. @elabx https://github.com/processwire/processwire-issues/issues/793
    2 points
  6. Did you copy the .htaccess file? Does your server support mod_rewrite? It's a good idea when considering moving to new environment to first run the PW installer as this will check to see if the environment is compatible. If all good you can delete the installation and copy over your existing files and DB. Also see this: https://processwire.com/docs/start/install/troubleshooting/#the-homepage-works-but-nothing-else-does
    2 points
  7. Great, thanks @Robin S! Your example looks like what I'm looking for. I'll give it a try early next week and report back with my adapted solution, if I manage to make it work.
    1 point
  8. I've added data-attributes to field wrappers in v2.0.15 containing information about the included field. Unlike the info currently available it's not on the inputfield itself but on its wrapper, making admin CSS/JS customizations easier to apply. https://github.com/rolandtoth/AdminOnSteroids/wiki/Misc
    1 point
  9. Update: Jquery File Upload Version 0.0.7. As of today and this version onward, ONLY ProcessWire 3.x is supported. Changelog Added option to unzip uploaded ZIP archives (works only in PW backend {hence custom modules}). Refreshed upload widget look and style. Added support for so-called 'Upload Anywhere' (no documentation currently, sorry. Basically this means you can use a whole page a files' dropzone). For those who care, this means Media Manager's release is imminent ? Screenshots Thanks!
    1 point
  10. Works for me too, but would depend on what $config->urls->root is (e.g. if developing in a subfolder?) If it's just MSN you are concerned about the simplest thing is to use the features built into MSN for just this purpose. Either then "xitem_tpl" option or a "getItemString" hook: // MSN hook for external_link template $nav->addHookAfter('getItemString', function($event) { $child = $event->arguments('page'); if($child->template == 'external_link') { $event->return = "<a href='{$child->link_url}' target='_blank'>$child->title</a>"; } });
    1 point
  11. $page->prevAll("sort=sort"); This should force the order.
    1 point
  12. @flydev Great feedback and excellent suggestion. On the list for the next release ?
    1 point
  13. Just testing it, look great ? I suggest a more verbose message when there is an error. I got the following message "There was a problem sending the notification" and I needed to put a bd($resultObj); on line 200 to know which error was triggered. In my case, was : I also got a notice for an undefined variable when there are error with $resultObj , the variable should be affected to false just before the if($resultObj->success) condition to avoid this notice : Thanks again for this useful module !
    1 point
  14. Eureka! I copied the .htaccess file from the blank install into the root folder of the newly-moved site. Now it seems to be working fine. Thanks for getting me on the right track, Robin.
    1 point
  15. The relative dates will come via WireDateTime::relativeTimeStr().
    1 point
  16. I can reproduce. Seems like a bug. Issue here: https://github.com/processwire/processwire-issues/issues/826
    1 point
  17. I'm not sure what's going wrong in your module, but maybe it helps you to look at this proof of concept module which adds a config field named "Animal" to every field and allows setting the field in template context. ExtraFieldConfig.module <?php namespace ProcessWire; /** * * ExtraFieldConfig * * @author Robin Sallis * * ProcessWire 3.x * Copyright (C) 2011 by Ryan Cramer * Licensed under GNU/GPL v2, see LICENSE.TXT * * http://www.processwire.com * http://www.ryancramer.com * */ class ExtraFieldConfig extends WireData implements Module { /** * Module information */ public static function getModuleInfo() { return array( 'title' => 'Extra Field Config', 'summary' => 'Test module for adding and extra config field to Fieldtype config.', 'version' => '0.1.0', 'author' => 'Robin Sallis', 'autoload' => true, 'requires' => 'ProcessWire>=3.0.0', ); } /** * Ready */ public function ready() { $this->addHookAfter('Fieldtype::getConfigInputfields', $this, 'addConfigField'); $this->addHookAfter('Fieldtype::getConfigAllowContext', $this, 'allowContext'); } /** * Add config field * * @param HookEvent $event */ protected function addConfigField(HookEvent $event) { $field = $event->arguments(0); $wrapper = $event->return; /* @var InputfieldText $f */ $f = $this->wire('modules')->InputfieldText; $f_name = 'animal'; $f->name = $f_name; $f->label = $this->_('Animal'); $f->value = $field->$f_name; $wrapper->add($f); } /** * Allow setting config field in template context * * @param HookEvent $event */ protected function allowContext(HookEvent $event) { $allowed = $event->return; $allowed[] = 'animal'; $event->return = $allowed; } }
    1 point
  18. In a hurry, so answering quickly.. Yes. For fields and templates have a look at the method setImportData(). For pages, there's different ways. I'll let others chime in. Exporting pages example. Yes, for pages, using previously exported JSON or ZIP and for fields using previously exported JSON and setImportData(). Examples of importing fields and templates from JSON. Yes. How you do it depends on the fieldtype... (others will chime in here) Not sure I understand this fully, but yes, you can do everything from the API or using the GUI. For pages, the PagesExportImport is still experimental but it works fine (for me).
    1 point
  19. News Update - 6 March 2019 Hi all. How time flies! It's been a while since I gave you an update on progress. Taxes Most of the current work has focused on Taxes. Although the last mini update talked about the GUI, the main work has gone into taxes. I went back and forth on this one but I think I've finally arrived at something I am satisfied with. Looking at other systems, I liked both the approaches of Shopify and Woocommerce, but especially the former. The approach we'll take will marry the best of both worlds. In a nutshell, taxes will involve/feature the following: You will first need to set up countries that you will be shipping to (this is done when setting up shipping zones). An overview of the shops tax settings. Tax Overrides: Use this feature to override the base tax rates and taxes on shipping per country and/or country state/province. You can create a product category (aka collection) to which a specific tax override will apply. Tax Exemptions: At each product level, you will be able to specify whether a product should be charged tax or not. However, you will also be able to exempt some customers from paying taxes on purchases. Currently, email addresses will be used to identify such customers. Option to choose if taxes should be charged on shipping rates or not. In cases where more than one tax can be applied, choose whether taxes are compounded (e.g. a country + province tax) or one used instead of the other. Specify whether digital products should be charged tax (e.g. EU VAT) or not. Evidence of buyers location for EU VAT. Specify if taxes are calculated based on origin (where you are shipping from/your shop location) or destination (where you are shipping to)[default]. Specify if stated/displayed prices include taxes already or not. Print out tax reports (how much tax you've charged over a given period). Taxes in the United States are a bit tricky to determine. We'll do our best to accommodate the needs of Padloper users in this country. Please note that although Padloper 2 will ship with base rate taxes for most/many territories of the world, including their states/provinces where applicable, and whilst we'll endeavour to regularly update tax rates, the responsibility to ensure that a shop/business is charging and remitting the correct taxes lies solely with the shop owner. Shop owners can use overrides to update their taxes in cases where Padloper 2 base tax rates are not up to date. We will not accept any responsibility for any wrongful tax deductions due to incorrect base rates and/or overrides. GUI i was hoping to have something for you to look at by now but I needed to sort out tax related logic first. I wanted the logic to guide the GUI design and not the other way around. So, you'll have to take a rain check on this one. Files We had a bit of a think on how to handle files (downloadable/digital products, site-wise assets, etc). No final decision has been made but the goal is to be as versatile as possible. Notifications We've started drafting plans on how this will work. More on this later but this will involve email notification to yourself, customers and shop staff regarding their orders. Some notifications will be (semi-) automated, e.g. sending order confirmation, order status change, etc. That's it for now. By next update, I'm hoping to have something for you to look at, however crude :-). Thanks!
    1 point
  20. Thanks for the module @kongondoI'm playing with this and when URL is /processwire/dashboard-notes/view/ (without note id) I get an error: Call to a member function count() on null in ProcessWire\ProcessDashboardNotes->renderReplyMarkup(), line 1228, $note->dashboard_note is null. Check for urlsegment2 is probably needed. Also when you pass nonexisting id an error is thrown: Argument 1 passed to ProcessWire\WireData::setArray() must be of the type array, null given. I guess there is no support for comments that need to be approved? But as you said, this is in lazy development (nice wording) and good starting point for those who need it.
    1 point
  21. https://github.com/rolandtoth/AdminOnSteroids/wiki/FieldAndTemplateEditLinks
    1 point
  22. Maybe this module is what you might be looking for: https://modules.processwire.com/modules/helper-field-links/
    1 point
  23. Hah, traced the error to the /wire/modules/LanguageSupport/ProcessLanguageTranslator.module where line 671 contains: if(!$dirIterator) return array(); Played around a little and noticed when I change the statement to this: if($dirIterator != false) return array(); The error doesn't show up, but the list of translatable files is still empty. I googled this strange behavior and found out it's a bug in PHP. Which was fixed in version 5.6.17. Which reminded me I am not really sure which PHP version I am using atm. It was 5.4 ? (but PW requirements state required PHP version is 5.4 or newer...?) Tested on 7.2, works ? Lesson learned (again): when something is fishy, first check the basics ?
    1 point
  24. Thanks again for all the effort! I will find some time this week (probably on the weekend) to check it out and comment, and I'll see what else I can contribute.
    1 point
  25. We are off to the races.. Alpha version for testing and comments now available at repo. Please note (see what I did there? ??) This thing is in lazy development. Don't expect any more non-critical changes soon. Main issues for me CSS: When note sizes are small, the note titles are still large and look horrible. I'm not sure whether to truncate or reduce font size, or? Truncating long titles + long text in dashboard Note visibility can be limited by permissions, users and roles: Should we filter out system permissions? Continuing from #3, should we NOT display superuser names (in the dropdown of lists of users who can view the note, if one wants to set that) Continuing from #4, what about frontend users only; should we remove their names from the list since they can't view the backend anyway? I'm not sure how code this Continuing from #3, currently we check if a user title exists and use that value rather than name. Maybe make the field to check configurable? Notes layout? Currently, one can reply to several responses in the same note simultaneously. Is this OK? I think that's it. If I think of anything else I'll add it here. Thanks!
    1 point
  26. I am not the right person to really comment on this given that the only abilities I have in a second language is a smattering of travel Spanish, but this does seem pretty cool and makes you sound a lot less silly ? DeepL Google So, a DeepL module sounds like a pretty cool idea to me.
    1 point
  27. Wow. I'm overwhelmed. There are 13 people who would like to help, and 7 of them have spontaneous free capacity. Thank you very much. Wow. Ich bin überwältigt. Es haben sich 13 Personen gemeldet, die grundsätzlich gerne helfen würden, und 7 haben so spontan Kapazität frei. Vielen Dank. ?
    1 point
  28. I do it this way: $t = $this->database->query("DELETE FROM MarkupActivityLog WHERE `page_id` = $page->id");
    1 point
  29. Here is a more sophisticated version if you have a large number of siblings and don't want to include all of them in the pager navigation. <?php // Limit for number of sibling links $limit = 9; // Get the number of visible siblings $num_siblings = $page->parent->numChildren(true); // The default start value is zero $start = 0; // If the number of siblings is greater than the limit then we need to adjust the start value if($num_siblings > $limit) { // Get the halfway point of the limit $half_limit = floor($limit / 2); // Get the index of the current page relative to its siblings $index = $page->index(); // Adjust the start value to keep the current page within the sibling links if($index > $half_limit) $start = $index - $half_limit; if($num_siblings - $start < $limit) $start = $num_siblings - $limit; } $items = $page->siblings("start=$start, limit=$limit"); // Next page and previous page relative to current page $next_page = $page->next(); $prev_page = $page->prev(); ?> <?php if($items->count > 1): ?> <ul> <?php if($prev_page->id): ?> <li><a href="<?= $prev_page->url ?>">Previous</a></li> <?php endif; ?> <?php if($start > 0): ?> <li>&hellip;</li> <?php endif; ?> <?php foreach($items as $item): ?> <li class="<?= $page === $item ? 'current' : '' ?>"><a href="<?= $item->url ?>"><?= $item->index() + 1 ?></a></li> <?php endforeach; ?> <?php if($num_siblings > $start + $limit): ?> <li>&hellip;</li> <?php endif; ?> <?php if($next_page->id): ?> <li><a href="<?= $next_page->url ?>">Next</a></li> <?php endif; ?> </ul> <?php endif; ?>
    1 point
×
×
  • Create New...