-
Posts
11,213 -
Joined
-
Last visited
-
Days Won
373
Everything posted by adrian
-
@mel47 and @Klenkes - not ignoring you guys - I will try to take a look at your issues/requests in a next few days.
-
Limit field to a specific page or branch of tree
adrian replied to adrian's topic in Getting Started
I haven't tested your new module yet - I am sure it will work great But back to the thoughts from my last post, I was thinking of hooking into: Inputfield::getConfigInputfields and adding the selector and custom php options there. Anyway, when I have a minute I'll try your module and also take a look at that hook and see if I can implement it that way as well. -
Limit field to a specific page or branch of tree
adrian replied to adrian's topic in Getting Started
Hey @Robin S - obviously I don't know what approach you have taken so far, but I just had another idea for how this could be implemented. Perhaps under the field's Input > Visibility > ShowIf settings, there could be new options: 1) a selector text field, 2) a custom PHP code textarea. This would be a little like the Input > Selectable Pages options for Page fields. Anyway, I think this could be really powerful - if the currently edited page doesn't match the selector, or the custom php doesn't return true, the field would be hidden completely from the page editor for that page. What do you think ? -
Hey @kongondo - when adding via the API, eg: $matrix = new Matrix(); $matrix->row = 1060; $matrix->column = 1073; $matrix->value = "This is my value"; $p->results->add($matrix); $p->save('results'); is there a recommended way to overwrite existing rows? At the moment doing this when the cells are already populated results in duplicated entries in the "field_matrixfield" db table. Obviously only one set is shown when editing the field on a page in the backend, but I am worried about consistency of what will be returned (backend and frontend) and of course just wasted db space and data integrity. I am thinking that the easiest option might be to just remove the entries manually with a raw SQL statement before adding the matrix row. Any thoughts? Thanks!
-
Whether it is actually meaningful or not, it might help convince your clients - ProcessWire won the best small business CMS for 2016: https://www.cmscritic.com/awards/
- 10 replies
-
- 7
-
-
Redirect to Lister after Save + Exit via Hook
adrian replied to gebeer's topic in Module/Plugin Development
$event->object->getPage(); should get you the page being edited. -
Check out the top two PR's: https://github.com/ryancramerdesign/FieldtypeMapMarker/pulls Hopefully the second one down will take care of it. I have used that for when this field is in a fieldsettab and it works.
-
Limit field to a specific page or branch of tree
adrian replied to adrian's topic in Getting Started
Now that's what I call service, or maybe it's just "Great minds think alike" Can't wait to see what you have put together! -
Hi everyone! Just curious if anyone has developed a solution for this. I feel like it has been mentioned somewhere before, but I am not finding anything. I have a site with a complex, but repetitive tree (hence my various branch restriction modules), and I am finding myself wanting the ability to add a field but only have it available on a specific branch. I obviously don't want a separate template for this one field so I am thinking of creating something to make this possible, but just want to make sure I am not reinventing the wheel. It might be best to just go with a simple hook that is specific to this scenario, but maybe this is also an opportunity to build something that makes it easier to manage these situations through the field's settings. At first thought I am thinking of a new "Branch Restrictions" tab (between Access and Advanced) on the field settings page that lets you limit what pages it will appear on. Any thoughts?
-
Based on @Macrura's example - maybe just a personal preference more than anything, but I prefer the look of this. I do think it really helps to indent the code though function renderUkGrid($page) { return " <div class='uk-grid uk-grid-large'> <div class='uk-width-medium-1-3'> <div class='uk-panel uk-panel-box prodotto__panel-mod'> <div class='uk-panel-teaser'> <div class='uk-cover-background' style='background-image: url({$page->product_image->url});'> <img class='uk-invisible' src='{$page->product_image->url}' width='600' height='400' alt='Placeholder'> </div> </div> </div> <a class='prodotto__panel-links prodotto__panel-links-blue' href='{$page->url}'><span>Discover more</span></a> </div> <div class='uk-width-medium-2-3'> <div class='prodotto__descr'><span>{$page>product_options->title}</span> <h3 class='shadow-blue'>{$page->title}</h3> <p>".truncateText($page->product_description)."</p> <p><a href='{$page->url}'><i class='uk-icon-chevron-circle-right uk-margin-small-right'></i>Link</a></p> </div> </div> </div> "; }
-
Hi @mel47 - are you running the latest version of BCE? I did tweak some thing recently on this front - I believe it has to do with no EOL character, but I am now adding that so I think this shouldn't happen anymore. If you are running the latest version and still having problems I'll try to look into it shortly. Are you pasting the CSV, or importing from a file? Does it makes a difference using one way or the other?
-
Ah yes - try the latest version - those should also now be translatable. Sorry, in a rush, but hopefully that will work. Perhaps I can improve things in the future - I honestly haven't played around with module translations at all
-
If you have the filecompiler turned on, you usually shouldn't have to do anything to upgrade from 2.x to 3.x. If you don't want to use it, all you should have to do is add: namespace ProcessWire; at the top of your template files. Generally there should be no need to prepend all wire() calls like that.
-
The version I just committed makes those (and lots of other config settings option) translatable. OT - this version also includes lots of new options for adding/updating/overwriting images when importing a CSV file.
-
https://mpdf.github.io/what-else-can-i-do/images.html It looks like mPDF can handle dynamically generated images and base64encoded images.
-
Yes, Tracy shows the rendered HTML and all recipients. Back to your hook question, there is: getModuleConfigInputfields which may suit your needs, but haven't though into it too much, but it does seem to be what you were asking about. https://github.com/processwire/processwire/blob/35df716082b779de0e53a3fcf7996403c49c9f8a/wire/core/Modules.php#L3534
-
That will just set it to dev and proceed - it won't actually check the value of $config->env Just an option for you - TracyDebugger has a Mail Interceptor panel which which intercepts all outgoing emails and displays their content in the panel instead - might be a decent option for what you are trying to achieve?
-
Hi @Vlad - thanks for your feedback on this. Is there any chance you could provide an example of how to use ecwid in ProcessWire?
-
Just to add to @kongondo's code, if your site is not in English, you may want to consider: $p->name = $sanitizer->pageName($p->title, true); You can read more about that sanitizer option here: https://processwire.com/api/ref/sanitizer/page-name/ or: $p->name = $sanitizer->pageNameUTF8($p->title); https://processwire.com/api/ref/sanitizer/page-name-utf8/
-
That's a good point - this isn't foolproof for sure. Remember though that it's only config settings that are being exported/imported (which are stored in a json object in the "modules" db table), so nothing should be critical - there are no db schema impacts or anything. New settings should be added in when saving the settings page again. I guess an option to mitigate any confusion might be to add the version of the module to the json file so that it can be compared on import and if the version is different then warn that there might be new settings might be lost and should be reviewed. The other issue to consider is when a module's config settings reference a page, template, or field - these won't match on different PW installations because their IDs will be different. Nothing can really be done about this. I guess I am just trying to make configuring of complex and commonly used modules simpler. Maybe there is no complete solution possible?
-
@szabesz - that sounds like a great idea - let me think on this to figure out the best option. @Rudy - I was thinking that perhaps the functionality of this module could be improved it bit. Notice in the screenshot that now you can control activating and deactivating different languages at once, as well as leaving certain languages untouched. When you use this, please let me know if you think these options work well, or if you think it could be improved still.
-
Done!
-
For those of you who are experienced with the PW API (and those looking to learn), there is now an "Action Code" viewer that shows the executeAction() method of the action you are about to execute. It is of course collapsed by default and only available to superusers. Anyway, hope you'll find it useful and either reassuring (if you're worried about what code it about to be executed on your site), or informative as to what can be done with the API.
-
-
Your easiest option might be to install @tpr's AdminOnSteroids module. It adds a filter box to the top of the edit view in BCE. Take a look at his screencast here: Another option, would be to use the "Page Manipulator" action in my new Admin Actions module that will let you use the selector field type that is used in Lister to filter pages and then delete all matches: Would that work for you?