-
Posts
11,210 -
Joined
-
Last visited
-
Days Won
373
Everything posted by adrian
-
@Sipho - You can choose different templates for Repeater Matrix fields - that link I provided shows examples and states: But, as with repeaters, they are not pages with URLs that can be directly visited - you could probably "fake" this by using URL segments on the parent page and use the passed values to determine which repeater item to show. OT - I completely agree that the PageTable interface is not ideal - seems to me we need the repeater matrix editing interface for PageTable fields as well. When the PageTable field was added, repeaters didn't support ajax loading, hence the modal editing interface to ensure it was scalable with lots of items.
-
Not free, but check out Repeater Matrix: https://processwire.com/api/modules/profields/repeater-matrix/
-
How to add repeater items to repeater inside repeater matrix
adrian replied to Raymond Geerts's topic in API & Templates
Take a look at this: https://github.com/adrianbj/ProcessAdminActions/blob/master/actions/PageTableToRepeaterMatrix.action.php It's purpose is to convert a PageTable to RepeaterMatrix, but you should find the code snippet in there that you need. -
Another option is the functions API: https://processwire.com/blog/posts/processwire-3.0.39-core-updates/#new-functions-api which lets you do things like: pages("template=basic-page")
-
Why are my pages only accessable in default language?
adrian replied to Timo's topic in Multi-Language Support
This will happen automatically if the fields for the page don't have a translated version - they will fallback to the default language. Also, just an FYI - you can also use Admin Actions to batch activate languages. -
Why are my pages only accessable in default language?
adrian replied to Timo's topic in Multi-Language Support
Also, just an FYI - you can also use Admin Actions to batch activate languages. -
CSS issues again right now: https://chrysemys.nl/verspreidingen/mississippi/ The CSS file is not found: https://chrysemys.nl/site/assets/aiom/css_chrysemys1f1a1b4c7f9475a33fbccc73a9188593.css If AIOM is causing these issues, then there must be something wrong somewhere
-
No ideas are silly - just looking for a consensus before making any changes.
-
Maybe, but on my Mac keyboard, the ALT key is closer to Enter than the CMD or CTRL keys, so for me that is the easier thing to use to clear and run. How many people out there are using the actual "Run" button instead of the shortcut? I know I do occasionally on page reload when the console isn't in focus, but it's not often. I guess my reasoning for a "Clear Results" button, rather than clearing by default is to keep it a little similar to the behavior you see with a regular terminal/command line where you have to explicitly clear what has been returned. Any strong feelings on this? PS - if we had two radios then we need to decide whether that status should be remembered or reset - sounding unnecessarily complicated to me
-
I'm happy to adapt if needed, but to be honest I almost always use the ALT+Enter option to run the code which automatically clears before running: "Enter PHP code, then use CTRL/CMD+Enter to Run, or ALT/OPT+Enter to Clear & Run." Does this work for you, or do you still think we need a change?
-
Seems to be fine now - before I couldn't get the css files to load, so there was no page styling at all. I did reload a couple of times to check. Maybe it was an issue with AIOM, or some network glitch, but the css on other pages was ok. Maybe nothing to worry about, but I would suggest keeping an eye out.
-
Just a quick note - the "Page Delete" module is obsolete - that functionality has been in the core for quite some time now.
-
@webhoes - the site looks fantastic, but just wanted to let you know that some pages are having css issues, eg: https://chrysemys.nl/habitats/ and https://chrysemys.nl/verspreidingen/kansas/ I expect there are many more also.
-
back to the roots: problems with simple hooks :(
adrian replied to bernhard's topic in API & Templates
Hey @bernhard - I just PM'd you with a new version that should work as expect with ready.php and hooks inside it. If you can test for me, hopefully I can get a new version released. Thanks! -
There are some links and also some code for creating repeaters and adding fields to it here: Shouldn't be anything special about doing it from a module. HTH.
-
Nope - you just select the template of the parent page and the template that you want to use for the child pages from the module config settings. It should be pretty obvious once you start with it.
-
Hey @onjegolders - I just tested @mr-fan's version of this script (which makes it a configurable module) and it works fine for me in PW3. The new page are created as direct children of the page where the bulk images are uploaded. The only thing I noticed that seemed a little weird is that if no description for an image was entered, the child page title used the name of the image directly including the file extension. I have created a PR which improves this: https://github.com/mr-fan/AutoImagePages/pull/1 Until that is accepted, please check out my fork: https://github.com/adrianbj/AutoImagePages
-
Hi @Klenkes - I decided to go with #2 - now BCE will only apply the "purify" sanitizer if the field that is being populated/updated has the HTMLPurifier enabled. Could you please test at your end to make sure it works as expected? Thanks!
-
I do use the $sanitizer->purify option with all content added via BCE, so that will be the source of the problem for sure. I can see two possible options here. 1) Add a BCE config setting to enable you to turn off the purifier sitewide and/or per parent page. 2) Check the purifier status for the field that the content is being added to and respect that. Any thoughts? PS if you want a quick fix, just edit this line: https://github.com/adrianbj/BatchChildEditor/blob/ba228d2f011d306345f02ec4aa19d090f2d89481/BatchChildEditor.module#L1448
-
back to the roots: problems with simple hooks :(
adrian replied to bernhard's topic in API & Templates
Hey @bernhard - I spent quite a bit of time looking into this the other day with no success. It turns out it's not just hooks inside ready.php - it seems like ready.php is never called at all from the Tracy console panel. I will investigate further, but so far a bit of a mystery. I thought perhaps it was an issue with ajax calls (which the console panel uses), but a normal ajax call results in ready.php being called, so really not sure at the moment. I'll see what I can figure out. Cheers, Adrian -
How to echo the lowest value from a Page Table?
adrian replied to PWaddict's topic in General Support
You could also just do this. By using "first()" you avoid the need for the foreach loop. $cart->renderPriceAndCurrency($release->children("limit=1, sort=pad_price")->first()->pad_price); -
You could also use Batch Child Editor's edit mode to change the status of all 500 children at once. Simply click the checkbox for the "Unpublished" label and that will uncheck it for all child pages.
-
back to the roots: problems with simple hooks :(
adrian replied to bernhard's topic in API & Templates
To follow up more - I just tried this in init.php: bd('test init'); $this->addHookAfter("Pages::saved", function($event) { bd('test init inside hook'); $this->log->save('debug', 'saved hook'); }); and this in ready.php: bd('test ready'); $this->addHookAfter("Pages::saved", function($event) { bd('test ready inside hook'); $this->log->save('debug', 'saved hook'); }); and got this response when running from the console panel: So, ready.php is being called, but hooks inside it are not - weird -
back to the roots: problems with simple hooks :(
adrian replied to bernhard's topic in API & Templates
Hi @bernhard - I am not really sure why at the moment, but if you move your hook to init.php (instead of ready.php), it works when the code is run from Tracy's console panel. So it looks like for some reason ready.php is not being called from the ajax call that the console panel makes when running code. Does that help? -
@Klenkes - a simple solution to this would be for you to manually change the "data" field in the "modules" db table from "text" to "mediumtext". I'll see if I can get Ryan to do it in the core so it's always available. https://github.com/processwire/processwire-issues/issues/321