Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/11/2019 in all areas

  1. I fixed it. @Robin S update the css rule with this: .Inputfield_service_rows .header-row > label:not(.ui-state-error) { background:#29a5aa !important; }
    2 points
  2. Hi @VeiJari It's usual practice, but not compulsory, to put hooks into /site/ready.php. site/ready.php loads before _init.php. You're changing the saved page data so you may need to turn off outputting formatting first if saving the entire page, or simply set-and-save the 'ajasta' field, eg (untested): wire()->addHookAfter('Pages::published', function($event) { $page = $event->arguments('page'); $t = wire()->templates->get($page->template); if($t->name == 'artikkeli' && $t->hasField("ajasta") { $page->setAndSave('ajasta', 0); } $event->return = $page; });
    2 points
  3. Not another Markup Fieldtype ? https://github.com/BernhardBaumrock/FieldtypeRockMarkup What do you think of a Fieldtype that does nothing else then rendering runtime markup from files that you provide in the settings or at runtime? In addition to that, I'd like the field to trigger javascript events to be usable for other fieldtype modules (like a charts module or a grid module). Javascript events would be necessary on field load (ajax/non-ajax), on collapse of the field, on click of a tab. When working with charts and RockGrid this has sometimes become a pain and I've implemented (sometimes dirty) fixes for that in different modules in different ways. I think it would make sense to have a solid base for such kind of modules (fieldtypes) that use some kind of standard events for standard situations. I'm especially interested in your opinions @Beluga because of the upcoming RockTabulator module and @kongondo because of your existing module. I think there are already similar modules by @Robin S and @kixe ? Thx for your input ?
    1 point
  4. 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!
    1 point
  5. Hey @WillyC, nice to read from you again. (Long time no see.) ?
    1 point
  6. What do your apache logs say? Do you know where they are located? Did you follow my write-up from my sig? Are you using virtualhosts?
    1 point
  7. In a current project I am using a Repeater field to build a kind of pseudo-table, where each Repeater item is a row. Some of the rows are headers, and some have buttons that toggle corresponding checkbox fields in a hidden FormBuilder form. The problem was that when the Repeater items were collapsed I couldn't see which rows were headers and which contained buttons. I tried including the fields in the Repeater labels but it still didn't provide enough visual difference to be quickly recognisable. So I investigated how classes could be added to selected Repeater items in admin depending on the value of fields within the Repeater items. This is what I ended up with... In /site/ready.php // Add classes to selected service row Repeater items $this->addHookAfter('InputfieldFieldset::render', function(HookEvent $event) { /* @var $fieldset InputfieldFieldset */ $fieldset = $event->object; $attr = $fieldset->wrapAttr(); // Fieldsets in a Repeater inputfield have a data-page attribute if(isset($attr['data-page'])) { // Get the Repeater item $p = $this->pages((int) $attr['data-page']); // Check field values and add classes accordingly // If item is a header if($p->row_type && $p->row_type->id == 2) { $fieldset->addClass('header-row'); } // If item has a checkbox button if($p->fb_field) { $fieldset->addClass('has-checkbox'); } } }); In admin-custom.css (via AdminCustomFiles) /* Special repeater rows */ .Inputfield_service_rows .header-row > label { background:#29a5aa !important; } .Inputfield_service_rows .has-checkbox > label .InputfieldRepeaterItemLabel:before { font-family:'FontAwesome'; color:#73cc31; content:"\f058"; display:inline-block; margin-right:6px; } Result
    1 point
  8. Sure, init.php runs before ready.php as well, but thanks for the link, which explains this more precisely:
    1 point
  9. Be careful here @Autofahrn and @psy. @VeiJari is talking about init.php and not _init.php. init.php ready.php finished.php Just to keep this in mind. https://processwire.com/blog/posts/processwire-2.6.7-core-updates-and-more/
    1 point
  10. I'd support the /site/ready.php solution as well. It seems to be the better place for hooks that don't end in a module. But there is another thing. Your hooks is tied to the published state or the action of publishing it. While testing this you have to unplublish the page first to test your hook. Had this testing issue a while back, too. ?
    1 point
  11. I guess $pages is not "ready" in _init.php, since _init.php is loaded pretty early. When PW is up and running and before the template is executed, it runs site/ready.php. So placing hooks in ready.php is the recommended practice. sorry, no.
    1 point
  12. Perhaps this will help? Oh, and welcome to the forum! ?
    1 point
  13. Hey @bernhard ploi does look good and good to get on cheap plans now before they up the price later like these services always do. However when I tried it out they hadn’t set up multiple system users yet, and I found their admin a bit all over the place. I’m sticking with runcloud for now, however with them I’ve had problems trying to amend Nginx configs for their Nginx + Apache setup, they lock you out of certain sections and it makes some things like cache headers hard to customize. Another one that is very different but technically much more secure, optimized and capable is this https://apnscp.com/, but the documentation is literally all over the place. More info here https://amp.reddit.com/r/webhosting/comments/arqya9/built_a_control_panel_over_16_years_free_lifetime/
    1 point
  14. @jens.martsch Thank you, It seems to be not only the colour but even at 100% you get a lot of artefacts on the image. Another example: Original above Output through the API at 100%. EDIT: Just realised that the forum is compressing images so they look the exact same ??? I'll try get them up on Dropbox
    1 point
  15. I'm not fully understanding your question. Are you wanting to update the composer dependencies from within Processwire like the Processwire Upgrade module does? Ex. update a GoogleCalendar library to the latest version? Or.. Are you asking what is the best way to include a third party library within a module? In this case, I would advise NOT including the library directly in the module. Have the user install it separately via Composer. I like how Wanze did it in the new version https://github.com/wanze/TemplateEngineTwig One command ran by the user will download the third party dependency, update the composer.json, install the dependency in the correct vendor folder, and install the module in the correct Processwire modules folder. Here are a couple links you might find interesting: https://processwire.com/blog/posts/composer-google-calendars-and-processwire/
    1 point
  16. wire( 'sanitizer')->entities( $u->title ) => $url . $u->id, wire( 'sanitizer')->entities( $u->request_type->title ), wire( 'sanitizer' )->entities( $dog_ref->title ) => $url . $dog_ref->id, wire( 'sanitizer' )->entities( $mailer->name ), ... "<a href=''>Schváliť</a>", // u NO.entitties on this.ones
    1 point
  17. looks.ikes u w ant $table->setEncodeEntities(false);
    1 point
  18. Saturday morning I wrote in the the latest weekly issue this: And here's the view from my front door just now, Tuesday morning: I'm not particularly superstitious, but kinda feels like I dropped the ball on this one. To my defence, on Saturday there was literally zero snow here, and the whole day was sunny and warm and all. Proper shorts and T-shirt weather. I guess the lesson here is that it's always too early to say that the winter is over. Have a great day, folks!
    1 point
  19. The idea of easy inclusion of any custom Javascript sounds good. The module I made and use is very slim and very stable. I use it extensively, especially with hooks and the full PW API and PHP. The only Javascript I have included currently is iframe resizer.
    1 point
  20. Great points @wbmnfktr! Thanks for pointing me to ploi.io @Mikie - looks like a good alternative to runcloud ? I'm using my own VPS's at reliable hosting companies in AUT/DE as for the reasons @wbmnfktr mentioned. Personally I don't do any installations on 3rd party hosting providers any more. For me it was always a pain at some point. For example one hoster just didn't have SSH access and there was no option to transfer the whole site at once. Transferring the whole site via FTP would have taken hours... that's really not worth the saving of 5€/month compared to having all on my VPSs and full control over everything and being efficient and fast. I've never had problems with my clients paying 5-10€/month for hosting on my server, when I tell them that setting up the website on their servers costs extra money and is a lot less efficient and more expensive in everyday operation. And that's not a lie! But it depends on your business... If you only do simple websites with no extra needs and maybe even no updates for several years, then it might be easier and better to choose a standard hosting provider that does everything for you (including invoicing, which can be tedious). 5-10€/month is for sure not worth doing everything on your own if you don't need any advanced features (like ssh, git support, etc).
    1 point
  21. I'm so lazy ? That's why I created RockModuleCreator some time ago... I didn't want to copy files, rename them, rename the class, lookup icon names etc... Not a lot to say... Simply upload your skeleton to github or similar, add placeholder tags like `#author#` or `#date#` and create modules quickly and easily. I'm happy to accept PRs if anyone wants to take this further... https://github.com/BernhardBaumrock/RockModuleCreator Available skeletons: https://github.com/BernhardBaumrock/RockMigrationsDemo https://github.com/BernhardBaumrock/RockProcessHello
    1 point
  22. This profile can be used as a simple business card or it can be used as a starting profile. Live Example Can download from this link: https://github.com/rafaoski/site-minimal Basic Info Most of the profile settings and translates are in the _init.php file. Functions can be found in the _func.php file. The entire view is rendered in the _main.php file that uses markup regions. You can easily add hooks using the ready.php file. Options page added with the new “Unique” status, which you can use in this simple way like: pages('options')->site_name pages->get('options')->site_name Screenshots:
    1 point
  23. HELLO! I've been working on a user messaging module which I am nearly ready to release as version 1. Currently I have the below functionality and I'm looking for feedback to what other things may be useful for people looking to add user to user messaging on their sites. compose message to one or more users known to PW js to enable tag based UI display of user names input on compose message form display all message threads with reply forms reply to message thread displaying each user name by each message in the thread display "unread" when a thread has new content that hasnt been seen by current user delete or unpublish message thread (configurable) display total message thread count display total unread threads (threads that have new replies that the current user has not seen) delete all message threads and associated data (not meant for the users to have access to) road map send email to user on new message to a thread they are included in
    1 point
  24. I have started a topic in Repeater Matrix closed support board with a request to make it possible to override InputfieldRepeaterMatrix::renderFooter method in a hook. This way we can probably implement any kind of add content type design without css overrides.
    1 point
  25. Yep. And add a nice touch to convert automagically label/link-texts to title attributes, so when the author hovers over an image, he knows exactly what kind of matrix item he/she will add.
    1 point
  26. Exactly. It's just a bit custom CSS. ? It might also be an idea for a matrix update that you can configure labels as images. Would be more flexible.
    1 point
  27. WOW!! Jaw dropped here... I'm really impressed, David! This module and the admin settings you built look incredible. Dumb question: how did you create those matrix thumbnails?
    1 point
  28. This is an additional plugin for the CKE. You can download it below and simply configure it as an additional plugin in PW. ? https://ckeditor.com/cke4/addon/loremipsum
    1 point
×
×
  • Create New...