Jump to content

elabx

Members
  • Posts

    1,364
  • Joined

  • Last visited

  • Days Won

    16

elabx last won the day on March 9 2024

elabx had the most liked content!

1 Follower

About elabx

  • Birthday 04/12/1988

Profile Information

  • Gender
    Male
  • Location
    Mexico City

Recent Profile Visitors

26,579 profile views

elabx's Achievements

Hero Member

Hero Member (6/6)

1.5k

Reputation

1

Community Answers

  1. I have a site I'm maintaining where I observe this two queries, and the only difference being one field Avg. 0.005s pages.find(parent=1082,template=ad,city_id|cities=11669,ad_status!=1, sort=-created, sort=-verified, limit=21, get_total=count) Avg. 078s pages.find(template=ad, parent=1082, ad_status=1, sort=-verified, sort=-created, city_id=11669, created_users_id!=41, title!=test|Test, status<1024) Average times from ProfilerPro. Event though the second query has more fields, I can confirm that the presence of "city_id|cities" or selector is what's making the query at the top spike. Is there a chance anybody know how to do this OR selection comparable to the second query performance? I've checked my indexes (compared the current ones with a new install of processwire) and they seem to be ok. Maybe this is just a caveat of the OR-field selector?? EDIT: This seems to be at least around twice faster: Avg. 0.035s pages.find(parent=1082,template=ad,(city_id=11669), (cities=11669),ad_status!=1, sort=-created, sort=-verified, limit=21, get_total=count)
  2. I have a route I want to throw a 410 status at it instead of 404, is there a way to do this right from Apache? I would bet you should be able to do something like this at the top of the htaccess file: RewriteEngine On RewriteRule ^some-url/some-path(/.*)?$ - [G] But it's not stopping and continues until the ProcessWire 404.
  3. Just as the title says, I am getting a mismatch between these counts, I decided to drop the ProcessWire one since it doesn't update on typing.
  4. The correct answer is to use the attributes: { "title": "Buttons", "items": [ { "title": "Default Button", "selector": "a", "attributes" : { "class" : "uk-button uk-button-default"} }, { "title": "Primary Color Button", "selector": "a", "attributes" : { "class" : "uk-button uk-button-primary"} }, { "title": "Secondary Color Button", "selector": "a", "attributes" : { "class" : "uk-button uk-button-secondary"} }, { "title": "Link Button", "selector": "a", "attributes" : { "class" : "uk-button uk-button-link"} }, { "title": "Link text", "selector": "a", "attributes" : { "class" : "uk-button uk-button-text"} } ] }
  5. So I realized I could use a custom json configuration file (very handy!) and added my style_formats like this: { style_formats: [ { "title": "Buttons", "items": [ { "title": "Default Button", "selector": "a", "class": "uk-button uk-button-default" }, { "title": "Primary Color Button", "selector": "a", "class": "uk-button uk-button-primary" }, { "title": "Secondary Color Button", "selector": "a", "class": "uk-button uk-button-secondary" }, { "title": "Link Button", "selector": "a", "class": "uk-button uk-button-link" }, { "title": "Large Button", "selector": "a", "classes": "uk-button-large" }, { "title": "Small Button", "selector": "a", "classes": "uk-button-small" } ] } ] } But the editor shows up like this:
  6. Might there be something in the trash with that number? get() skips any access control check!
  7. I think you have to do this by hand and render each page with the table. Example from the core.
  8. Yes! Either in the TinyMCE module settings, or in each field there are options for overriding the json config of the TinyMCE instance, and you can do sth like: site/templates/assets/tiny.css is my custom css file. In all fairness, I have only tested this in the global module config, not in the individual field context.
  9. Very exciting news! Thanks for letting us know! Can't wait to see the result!
  10. Maybe use a nested hook? $wire->addHookAfter(Pages::saved(template=repeater_parent_repeater), function($e){ $e->addHookAfter(Pages::saved(template=repeater_nested_repeater), function($e){ // ProcessWire magic! }); }); Just be sure it's not executing in odd places.
  11. Fantastic idea! Thank you! I forgot about this module and FieldtypeCustom felt too new.
  12. Hi everyone! I see in this post that introduced the custom field to ProcessWire a Radios field! BUT, in the source code of FieldtypeFile this is a fieldtype that doesn't seem to be allowed, I also don't see either where this could be updated 🤔 Thanks for further answers!
  13. I asked this in the DDEV discord kinda betting there would be more interest or at least pointing to a resource, but didn't have much success. I haven't seen docker recommended for production db's and comments around web as to why this is not a good idea, can't remember details right now, just remember I have dived into this rabbit hole before. But I'd love to be proved wrong! The only tool I've taken a look at as a possible aid for using docker for production is Basecamp's Kamal and they seem to assume you will be using a managed db from a provider and mount volumes to the docker containers if you need filesystem in the application (which is mandatory in the case of ProcessWire?), but there's accessories thingy? Anyway, I'm really in the same spot as you are @TwoWheelDev 😞 Love the dev experience docker offers, would love to take that to deployment without it being too expensive hosting wise.
  14. Not sure if this might be doable with hooking into something earlier, but figured it might be convenient to have this possibility. Example, to check for an authenticated user and escape any route that has this middleware setup. Maybe this just calls for its own implementation under a single /{whatever-path}/ hook?
  15. Try maybe: if($user->language->name == "en"){ //Processwire magic }
×
×
  • Create New...