Leaderboard
Popular Content
Showing content with the highest reputation on 12/27/2018 in all areas
-
Additionally using a modal to edit translations would be also handy ("Edit" button, "Bearbeiten" on the screenshots above). On closing the modal, the file list could be easily reloaded with triggering a reload event on the Inputfield. I'll probably add this to AOS if time allows. Update: added to v2.0.83 points
-
Before you start tweaking your .htaccess (which might be problematic if you want to share your module), how about copying the dev.php to site/templates in your module's install method and creating a dedicated page for it?2 points
-
emplate Field Widths Adds a "Field widths" field to Edit Template that allows you to quickly set the widths of inputfields in the template. Since v0.2.0 the module also adds a similar field to the settings of Edit Field for Repeater, FieldsetPage and Repeater Matrix allowing you to quickly set the widths of inputfields within the Repeater/FieldsetPage field, or within each Repeater Matrix type. Note: widths are only saved if the edit form is submitted with the "Field widths" field in an open (non-collapsed) state. Edit template Edit Field: Repeater Edit Field: Repeater Matrix Why? When setting up a new template/repeater or trying out different field layouts I find it a bit slow and tedious to have to open each field individually in a modal just to set the width. This module speeds up the process. Config options You can set the default presentation of the "Field widths" field to collapsed or open. Widths entered into the "Field widths" field are only applied if the edit form is submitted with the field in an open (non-collapsed) state. "Collapsed" is the recommended setting if you think you might also use core inputs for setting field widths in a template context. You can choose Name or Label as the primary identifier shown for the field. The unchosen alternative will become the title attribute shown on hover. You can choose to show the original field width next to the template context field width. https://github.com/Toutouwai/TemplateFieldWidths https://modules.processwire.com/modules/template-field-widths/1 point
-
This module enables you to automatically create pages based on a ProcessWire page template, eg Calender detail page, that has calendar event recurrences. Download from GitHub: https://github.com/clipmagic/ProcessRecurringEvents1 point
-
Just posted a new module to github that simply displays a google calendar in a new calendar page in the Admin interface. It's meant to go hand-in-hand with Ryan's MarkupLoadGcal module. There's really not much else to say about it other than it uses the new module config class so you'll need to be running an up-to-date dev version to be able to use this. Here's a shot of the config page... ...and here's what the calendar page is like... Please note, this module only embeds the calendar; the event you see listed under the calendar in the screenshot above is added by hooking this module's execute() method and extending the output. The hook method uses Ryan's MarkupLoadGcal module to pull events out of the calendar's feed and then appends them under the calendar. ProcessGcalEmbed in the module repository. ProcessGcalEmbed on Github.1 point
-
1 point
-
1 point
-
@pwFoo What exactely do you mean by 1)? Mapping an endpoint to a PW Page is as easy as $page = wire('pages')->get(1042); in your endpoint function. Mapping an endpoint to a php file is the intendend behaviour of the module, check the example: https://github.com/thomasaull/RestApi/blob/master/apiTemplate/Example.php which get's mapped in the Routes.php: https://github.com/thomasaull/RestApi/blob/master/apiTemplate/Routes.php 2) That's basically the approach @LuisM used in his PR. I'm not sure if it's the best solution, check my comment on Github: https://github.com/thomasaull/RestApi/pull/1#issuecomment-4501357671 point
-
RestApi.info.json in the github repo still says 0.0.3. Did you forget to sync your local changes to github?1 point
-
Hey @tpr I have been seeing this a bit lately: Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /site/modules/AdminOnSteroids/AdminOnSteroids.module on line 26221 point
-
I used this way very often in the past @benbyf <?php // create /site/modules/LanguageDefault // create file LanguageDefault.module // refresh modules in PW admin // https://processwire-recipes.com/recipes/change-homepages-default-language/ class LanguageDefault extends WireData implements Module { /** * getModuleInfo is a module required by all modules to tell ProcessWire about them * * @return array * */ public static function getModuleInfo() { return array( 'title' => 'LanguageDefault', 'version' => 1, 'summary' => 'A work around to changing the default language.', 'href' => 'https://processwire.com/talk/topic/9322-change-default-language-for-homepage/?p=89717', 'singular' => true, 'autoload' => true, ); } /** * Initialize the module * * ProcessWire calls this when the module is loaded. For 'autoload' modules, this will be called * when ProcessWire's API is ready. As a result, this is a good place to attach hooks. * */ public function init() { $this->session->addHookBefore('redirect', $this, 'setDefaultLanguage'); } public function setDefaultLanguage($event) { if ($this->page->id == 1 && $event->arguments(0) == $this->page->localUrl('default')) { $event->arguments(0, $this->page->localUrl('de')); } } } Found at: https://processwire-recipes.com/recipes/change-homepages-default-language/1 point
-
I have had similar event-situations in the past and went different ways. Solution 1: I added a date_end (to keep your naming) field to my events and displayed an additional "from/ab (german: from)" to the event itself when listed somewhere - so no repeaters needed (in my case). It's almost like a date range for a single event. Works really well and can be found at: https://www.musikschule-neumuenster.de/termine/ Solution 2: I created one main page for that event and used @psy's recurring events module to create follow-up pages/events I can show in my lists. In your case I'd probably go with solution 2. That way you can although create semantic JSON+LD markup for each day/event if wanted.1 point
-
When I try to edit a template that gets its fields from another template, I get an error: Argument 2 passed to ProcessWire\InputfieldWrapper::insertAfter() must be an instance of ProcessWire\Inputfield, null given, called in C:\inetpub\wwwroot\site\modules\TemplateFieldWidths\TemplateFieldWidths.module on line 152 Possible fix: if($fg_fields) $form->insertAfter($f, $fg_fields);1 point
-
1 point
-
There are lots of shortcuts ? I think @matjazp was looking to have one in the Console panel. Yes I could make it a module config setting but if you make it the default then the "Clear Results" link it irrelevant (I guess it could be removed in this case), but then you'd have to use shortcuts to not automatically clear the results. Some time ago IIRC there were two buttons, "Run" and "Clear & Run" and no separate "Clear Results". I actually think that you had something to do with this change but I don't really remember why we went this way? Yeah, I agree the Tracy settings can be slow to load. Turns out the biggest issue is actually populating the DOM. If I simply collapse all the fieldsets it loads reasonably quickly. I used to have all (except the first couple of key ones) fieldsets collapsed, but I was convinced to change this, but that was some time ago and there were a lot less settings then. I wonder if I should revisit this? Perhaps I should collapse by default, but when following the cog/settings links at the bottom of a panel, then this would open up the requested fieldset. Maybe it also needs a toggle all at the top of the settings page for those who actually want to browse? Any thoughts?1 point
-
Merry xmas to everyone in here. We are a great community and I'm pretty sure we, as humans first, are great person/friends/sons/fathers somewhere in the world. A big hug to everyone of you.1 point
-
Sounds like a CSS box-sizing issue. Are you using an unmodified core admin theme? All three core admin themes apply box-sizing: border-box to all elements so I'm puzzled why that wouldn't be working in your case. Maybe you can use your browser dev tools to investigate?1 point
-
This is how I've done it, hooks to the rescue. Clean. $this->addHookProperty('Language::code', function(HookEvent $event) { $lang = $event->object; $event->return = $lang->name === 'default' ? 'en' : $lang->name; }); So now you can access it as a property of languages. $user->language->code;1 point
-
Here's a little Tutorial of how to get pages and their parent's titles requested by @mel47 The page structure: The initial basic Finder: The easy and inefficient way: This will load all pages in memory and be slow when you have lots of pages! The a little more complicated but far more efficient way. First, we prepare the finder to join: Then we join that finder to the initial finder: Then just hide those two unnecessary columns in your final grid: document.addEventListener('RockGridItemBeforeInit', function(e) { if(e.target.id != 'RockGridItem_yourgrid') return; var grid = RockGrid.getGrid(e.target.id); var colDefs = grid.gridOptions.columnDefs; var col; // all your grid's frontend settings grid.getColDef('parent_id').hide = true; grid.getColDef('cat_id').hide = true; });1 point
-
@adrian thanks for the work on this! It's a super module that just got even better! Hope it's of use to others in its new multi-language support mode.1 point
-
Hi everyone, @dab has kindly sponsored support for multi-language subjects and content which I have just added to v1.3.0 Here is my test email content which will hopefully show you how it works. Subject English Subject ==#es== Spanish Subject ==#fr== French Subject Body English body ==#es== Spanish body ==#fr== French body ==sidebar== Sidebar english ==sidebar==#es== Sidebar spanish ==sidebar==#fr== Sidebar french There is also a new "Auto Activate Languages" checkbox that you'll probably want to check in the module config settings. Please let me know if you have any problems with this new functionality. Cheers, Adrian1 point
-
MarkupSimpleNavigation is really nice if you show the real path of your document structure in your url. But in your case you always show the parents url, then I would go another way and do it yourself like: echo '<ul>'; foreach($pages->get('/')->children as $item){ $class = '';// for marking the parent li if($item->id == $page->id) { $class = "parent"; } echo "<li class='{$class}'><a href='{$item->url}'>{$item->title}</a>";// open toplevel li // if there are childpages if($item->children){ echo '<ul>'; foreach($item->children as $anchor){ // you would have to set the anchor targets to the name of the page // note: $item->url # $anchor->url because you need the parents url echo "<li><a href='{$item->url}#{$anchor->name}'>{$anchor->title}</a></li>"; } echo '</ul>'; } echo '</li>';// close toplevel link li } echo '</ul>';1 point
-
Here's a working example for you: <?php namespace ProcessWire; $showForm = true; if ($input->post->upload) { $tempDir = wire()->files->tempDir('userUploads')->get(); $uploaded = (new WireUpload('uploadedFile')) // same as form field name ->setValidExtensions(['txt', 'png', 'jpg', 'pdf']) ->setMaxFiles(1) // remove this to allow multiple files ->setMaxFileSize(10 * pow(2, 20))// 10MB ->setDestinationPath($tempDir) ->execute(); // $page = $pages->get(1234); foreach ($uploaded as $file) { $filePath = $tempDir . $file; // $page->files->add($filePath); echo $filePath . "<br>"; } // $page->save('files'); if (count($uploaded)) { echo sprintf("Uploaded %d files", count($uploaded)); $showForm = false; } } ?> <?php if ($showForm): ?> <?php // Adding enctype is crucial!! ?> <form method="POST" action="./" enctype="multipart/form-data"> <label for="uploadedFile"> Upload: <?php // suffix name with [] and add multiple attribute if you allow multiple files ?> <input type="file" name="uploadedFile[]" id="uploadedFile" multiple> </label> <div> <button name="upload" value="1">Upload</button> </div> </form> <?php endif; ?>1 point
-
1 point
-
1 point