kongondo Posted March 20, 2016 Share Posted March 20, 2016 @robsns, Welcome to ProcessWire and the forums. Are you saying that you have a single (1) page with a custom field (based on FieldtypeEvents) that has ~18 columns and there's 6000 event entries (rows), i.e.., 6000x18 in total? Difficult to give a specific answer to your question since not clear why you have to have all these courses in 1 page. There could be other options, e.g. using a Process Module, or separating those 6000 courses into different groups, etc. If you want to discuss further, please start a new topic (since your question is not really related to FieldtypeEvents but a different custom module) and we'll take it from there Link to comment Share on other sites More sharing options...
rouge Posted November 22, 2016 Share Posted November 22, 2016 hi, how can I add pageing support for the input-table? my customer already has more than 100 events. thx in advance Link to comment Share on other sites More sharing options...
adrian Posted November 22, 2016 Share Posted November 22, 2016 On 11/22/2016 at 3:15 PM, rouge said: hi, how can I add pageing support for the input-table? my customer already has more than 100 events. thx in advance I would suggest taking a look at Profields Table (http://processwire.com/api/modules/profields/table/) which now supports pagination. Actually, technically it is the PW core that now supports it and the Table field is the first to implement it. So technically you could add it to this custom Events fieldtype, but the Table field would make your life much easier. 1 Link to comment Share on other sites More sharing options...
rouge Posted November 22, 2016 Share Posted November 22, 2016 Sounds good thank you! Link to comment Share on other sites More sharing options...
bubx2k Posted November 26, 2016 Share Posted November 26, 2016 I made a few changes in my fork of the module. I added support for DateTimePicker, Recurring Events and DataTables. Here is it: https://github.com/blackberrymamba/FieldtypeEvents 13 Link to comment Share on other sites More sharing options...
netcarver Posted December 2, 2016 Share Posted December 2, 2016 @bubx2k Welcome to the forums. Nice first post! Link to comment Share on other sites More sharing options...
SFCable Posted April 11, 2018 Share Posted April 11, 2018 I have just downloaded it and seems very good and userfriendly. And the user interface is damn perfect too. And apart from all front end is much faster and effective. Link to comment Share on other sites More sharing options...
rareyush Posted April 27, 2018 Share Posted April 27, 2018 I am using this module is there anyway to add time field as well in this module ? http://modules.processwire.com/modules/fieldtype-events/ Link to comment Share on other sites More sharing options...
kongondo Posted April 29, 2018 Share Posted April 29, 2018 On 4/27/2018 at 12:17 PM, rareyush said: I am using this module is there anyway to add time field as well in this module ? Do you mean a separate field for time? Not out of the box, no. You'd have to edit the source code. If you can be a bit more specific about your needs, we can rustle up something for you. Link to comment Share on other sites More sharing options...
rareyush Posted April 30, 2018 Share Posted April 30, 2018 6 hours ago, kongondo said: Do you mean a separate field for time? Not out of the box, no. You'd have to edit the source code. If you can be a bit more specific about your needs, we can rustle up something for you. here is the link for my thread where I described my prolem Link to comment Share on other sites More sharing options...
gunter Posted December 8, 2018 Share Posted December 8, 2018 How is it possible choose time with the datetime picker? It is possible to select the date, but not the time.... I´ve looked and tried a few things... but nothing did work... Link to comment Share on other sites More sharing options...
gunter Posted December 23, 2018 Share Posted December 23, 2018 A problem occured... this code does not work, the updated event field is not saved (but saving works, the title is saved) and the sleepvalue method isn´t called $page->title = "custom title"; foreach($page->events as $event){ $event->location ="new location"; $event->notes ="new notes"; } echo "now we save..."; $page->save(); but when I add an event to the field array the new event is saved AND the fields are stored - this code works: $event = new Event(); $event->date = "1979-10-12 00:42:00"; $event->location = "Vogsphere"; $event->notes = "The homeworld of the Vogons"; $page->events->add($event); foreach($page->events as $event){ $event->location ="new location"; $event->notes ="new notes"; } echo "now we save..."; $page->save(); Link to comment Share on other sites More sharing options...
gunter Posted December 23, 2018 Share Posted December 23, 2018 I have a solution: in the EventArray I wrote this: public function setTrackChange(){ parent::trackChange('value'); } it works now with this modification, I don´t know if there is a better way $page->events->setTrackChange(); $page->save(); Link to comment Share on other sites More sharing options...
gunter Posted July 31, 2019 Share Posted July 31, 2019 This is a small tutorial... If you want add another field to this fieldtype... first in FieldtypeEvents.module in getDatabaseSchema() add a line that suit your needs, so your new field gets stored to the database $schema['newValue'] = 'TINYTEXT NOT NULL'; try if you can install the module and add a field to a template and check if it works like before add the property to the constructor in Events.php $this->set('newValue', ""); then modify set() and get() so you can modify your new property... now try in your template,´if you can modify and output the new property foreach($page->events as $event){ $event->newValue = "hello new value"; echo "yes it works, we we welcome the new value: ". $event->newValue."<br>"; } if this works properly then go back to FieldtyeEvents.module: add this line in __wakeupValue() to the foreach loop $event->newValue = $v['newValue']; and in _sleepValue() 'newValue' => $event->newValue, in file InputfieldEvents.module in renderRow() method make sure, a $newValue variable gets gets sanitized from $newValue = $this->sanitizer->entities($event->newValue); change $out = " <tr class='Event$cnt $class'> <td><a href='#' class='EventClone'><span class='ui-icon ui-icon-copy'></span></a></td> <td><input type='text' name='{$name}_date[]' value='$date' class='datepicker' /></td> <td><input type='text' name='{$name}_newValue[]' value='$_newValue' /></td> //add this line add your field in __render() <table class='InputfieldEvents'> <thead> <tr class=''> <th class='EventClone'> </th> <th class='EventDate'>Date</th> <th class='EventDate'>newValue</th> //I´ve chosen EventDate class because its narrow and in __processInput() $event->newValue = $input->{"{$name}_newValue"}[$cnt]; I hope I didn´t forget anything, good luck! 4 Link to comment Share on other sites More sharing options...
fedeb Posted April 20, 2021 Share Posted April 20, 2021 (edited) Hi, (almost two years later...?) I am trying out the latest update of the FieldtypeEvents announced on the latest weekly update by ryan. Since I am new to Fieldtypes (also to ProcessWire) I have some basic questions: 1) When trying to populate the Events field from a php script using $page->save()or $pages->saveField(Page $page, $field) I get the an error raised inside ___sleepValue(): if($event->formatted) throw new WireException('Formatted events cannot be saved'); The error is originated because when loading the information from the database ($value) into an Event, the $event is tagged as formatted by the constructor -> It is not tagged as formatted in the constructor but still the page is formatted by default. class Event extends WireData { /** * Construct a new Event * */ public function __construct() { // define the fields that represent our event (and their default/blank values) $this->set('date', ''); $this->set('title', ''); $this->set('location', ''); $this->set('notes', ''); $this->set('formatted', false); parent::__construct(); } How can I go back to the unformatted state so that I can execute$page->save() from a php script? How are elements saved using inputFieldEvents? 2) are 'location' and 'notes' additional fields needed by default or they are just there from the previous version? When calling getDatabaseSchema() they do not appear. 3) In the latest reply @gunter mentions a set() and get() function. I do not see the get() function. Maybe it was removed in the latest update? (btw gunters reply was extremely useful, thanks!) 4) Broader question: Since I am populating my events from a php script and I don't necessarily need a GUI to input data, can I avoid including inputFieldEvents? Thanks in advance! Edited April 21, 2021 by fedeb mistake on the reason why the page was formatted Link to comment Share on other sites More sharing options...
ryan Posted April 20, 2021 Author Share Posted April 20, 2021 @fedeb Looks like I missed a spot on the updates to the Event class, I have fixed that and removed the references to the old fields (location, notes). 1. In ProcessWire a Page can be in a "output formatted" or unformatted state. You can toggle output formatting on with $page->of(true); or toggle it off with $page->of(false); Or you can get the current state with $formatted = $page->of(); When output formatting is on, values returned from the page are intended for output and thus can contain runtime formatting such as entity encoding. This is good for output, but definitely not something you'd want saved the database, so when you are creating pages or saving values on pages you want to have its output formatting disabled, i.e. $page->of(false); This should be done before getting, setting or modifying values that will be saved. 2. The location and notes aren't supposed to be there. I removed them in favor of making the module simpler by just having "title" and "date", and then people can add any additional columns they want. 3. The set() and get() functions are inherited from the WireData class. (Event extends WireData) 4. InputfieldEvents won't be included unless something asks for it (like the page editor in the admin). If you are just using the API side, then the InputfieldEvents module likely will never be loaded or come into play. It's still nice to have in case you ever want to see or edit your data in the admin. 3 Link to comment Share on other sites More sharing options...
BrendonKoz Posted May 25, 2022 Share Posted May 25, 2022 In the InputfieldEvents.module file's ___processInput method, there's an Exception exclaiming, "This inputfield requires that you set valid 'page' and 'field' properties to it." In what instances do inputfields (or any type of module) require page and field properties? I notice that many do not require this, but am not sure of the circumstances when they are required. So far I've just been copying/pasting from similar modules without truly understanding why. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now