I found the information I was asking for:
http://processwire.c...stions/?p=22535
Maybe it would be fine to have all available options somewhere available at one place - the thread above would be a nice place to collect them ;-)
Male
doolak hasn't added any friends yet.
Posted by doolak
on 31 March 2013 - 03:05 AM
I found the information I was asking for:
http://processwire.c...stions/?p=22535
Maybe it would be fine to have all available options somewhere available at one place - the thread above would be a nice place to collect them ;-)
Posted by doolak
on 17 March 2013 - 09:48 AM
Hi there,
I need to show the Date/Timepicker in German, so I am using the jQuery UI/Datepicker/Localization like below:
$.datepicker.regional['de'] = {clearText: 'löschen', clearStatus: 'aktuelles Datum löschen',
closeText: 'schließen', closeStatus: 'ohne Änderungen schließen',
prevText: '<zurück', prevStatus: 'letzten Monat zeigen',
nextText: 'Vor>', nextStatus: 'nächsten Monat zeigen',
currentText: 'heute', currentStatus: '',
monthNames: ['Januar','Februar','März','April','Mai','Juni',
'Juli','August','September','Oktober','November','Dezember'],
monthNamesShort: ['Jan','Feb','Mär','Apr','Mai','Jun',
'Jul','Aug','Sep','Okt','Nov','Dez'],
monthStatus: 'anderen Monat anzeigen', yearStatus: 'anderes Jahr anzeigen',
weekHeader: 'Wo', weekStatus: 'Woche des Monats',
dayNames: ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'],
dayNamesShort: ['So','Mo','Di','Mi','Do','Fr','Sa'],
dayNamesMin: ['So','Mo','Di','Mi','Do','Fr','Sa'],
dayStatus: 'Setze DD als ersten Wochentag', dateStatus: 'Wähle D, M d',
dateFormat: 'dd.mm.yy', firstDay: 1,
initStatus: 'Wähle ein Datum', isRTL: false};
$.datepicker.setDefaults($.datepicker.regional['de']);
This works fine when it's added into the InputfieldDatetime.js - but just for the date - for the time (which uses the Timepicker addon) one should be able to use this code:
$.timepicker.regional['de'] = {
timeOnlyTitle: 'Zeit wählen',
timeText: 'Zeit',
hourText: 'Stunde',
minuteText: 'Minute',
currentText: 'Jetzt',
closeText: 'Schliessen',
timeFormat: 'HH:mm',
amNames: ['AM', 'A'],
pmNames: ['PM', 'P'],
};
$.timepicker.setDefaults($.timepicker.regional['de']);
... but I could not get this work when including it into jquery-ui-timepicker-addon.js - so I just changed the options in that file.
As it's obviously not recommended to change the code in the modules files, I would like to add the localization by a hook.
How could I load a hook always when the datetime module is called? It would work fine with Page::render, but in use with the Form Builder it wouldn't work then, when the forms are embedded by iframe.
So it would be great to add the javascript by a hook "into the datetime module"...
Would be great if somebody could show me the right direction.
Cheers, doolak
Posted by doolak
on 13 February 2013 - 09:11 AM
Thanks doolak! Could use some more sleep this month.
I know this too well...
Posted by doolak
on 13 February 2013 - 08:44 AM
Hi arjen,
the parent page will have the "has_children_class" and if it's the actual parent it will have the "parent_class", too.
So it can be styled with CSS through:
li.parent.has_children {
color: #fff
}
Posted by doolak
on 09 February 2013 - 08:41 AM
doolak,you can adjust these settings in the config of the Module "InputfieldPagename".
There I have changed mine
Thanks, great - so no need to change it in the module itself.
Posted by doolak
on 07 February 2013 - 10:28 AM
As i said, i really don't like to give the costumers too much possibilities and try to avoid the WYSIWYG as much as possible - guess you all know why:

( Source: http://kopozky.net )
Posted by doolak
on 07 February 2013 - 10:19 AM
Great idea to build that site, Nico!
Christian Schindler
mediakreativ.de (very old homepage - no time to build a new one...
)
Posted by doolak
on 03 February 2013 - 11:09 AM
Yes, i am using it as a label for a Page Field - works fantastico now, thanks again!
Posted by doolak
on 02 February 2013 - 03:33 PM
Yes, I want to manipulate something on the admin interface side:
Each member of a sports club is saved as page, i don't want the website editor to have put in name and first name as title when adding a new member, maybe with a number if there are two members having the same first and last name - and then entereing first name and last name again when editing the member page to have both values seperatley.
So i first had the idea to populate the title field of a new added page during ProcessPageEdit dynamically, e.g. with a increasing number.
As i couldn't manage it to check the template of the new added page or the number of existing pages using this template - at least i was not able to check any parameters of the pages.
I found some information in this post, but this did not work for ProcessPageEdit (or i just made something wrong).
So i began to use just Jquery (as described above in my second post) and made a little module which populates the title dynamically with the name and the date of birth after they are entered in the edit page:
<?php
class PopulateTitle extends WireData implements Module {
public static function getModuleInfo() {
return array(
'title' => 'Populate Title',
'version' => 101,
'summary' => 'Populate the title field dynamically',
'singular' => true,
'autoload' => true,
);
}
public function init() {
$this->addHookAfter('ProcessPageAdd::execute', $this, 'addScript');
$this->addHookAfter('ProcessPageEdit::execute', $this, 'addScript2');
}
public function addScript(HookEvent $event) {
$this->config->scripts->add($this->config->urls->PopulateTitle . "populate_title.js");
}
public function addScript2(HookEvent $event) {
$this->config->scripts->add($this->config->urls->PopulateTitle . "populate_title2.js");
}
}
populate_title.js:
During ProcessPageAdd this script checks if the page which will be added is in a child of the "Members" page, if it is, the timestamp is added as title to keep it individual. Same for the page name. It hides both fields and triggers a submit, so the page is added automatically.
jQuery(document).ready(function() {
if($('input[name=parent_id]').val() == '1015') {
$('input[name=title]').val(new Date().getTime());
$('input[name=_pw_page_name]').val(new Date().getTime());
$('#wrap_Inputfield_title').hide();
$('#wrap_Inputfield_name').hide();
$('#submit_save').trigger('click');
}
});
populate_title2.js:
When editing a page it checks again if the page is a child of the "Members" page, empties the title, checks if the members name is already entered (mitglied_name) and displays "Neues Mitglied" (New member) as title if it is not.
If there is a members name entered (which is a required field) it concenates name, first name and date of birth (all required fields) and uses them as page title and, a filtered version as page name:
jQuery(document).ready(function() {
if($('input[name=parent_id]').val() == '1015') {
$('#title').empty();
if($('input[name=mitglied_name]').val() == '') {
$('#title').append('Neues Mitglied');
}
else {
$unfiltered = $('input[name=mitglied_name]').val() + ", " + $('input[name=mitglied_vorname]').val() + ", " + $('input[name=mitglied_geburtsdatum]').val();
$('#title').append($unfiltered);
$filtered = $unfiltered.toLowerCase().replace(/[\*\^\'\!\,]/g, '').replace(/[\.]/g, '-').split(' ').join('-');
$('input[name=title]').val($unfiltered);
$('input[name=_pw_page_name]').val($filtered);
}
}
});
So this does exactly what i want, even more (as it corrects the page name dynamically after name, first name or date of birth are changed later).
But i am sure that one could have done the same with PW API - without using just jQuery and that would make it possible to write a module which offers the possibility to choose the fields which should be used as title dynamically.
Hmm...
Maybe one could use a modified Fieldtype Concatenate for this?
Posted by doolak
on 02 February 2013 - 02:21 PM
Wow, great! Thanks ryan! (Do you ever sleep?)
Posted by doolak
on 01 February 2013 - 06:37 PM
I had to import over 500 of members as pages into PW, so i am using the Import Pages module.
I wondered why a lot of members are imported without their birth date and i found out that the module seems to import one date format wrong:
I was using the date format dd/mm/yyyy in the CSV - but it seems that it was imported as mm/dd/yyyy and the dates which have a day higher than 12 were not saved.
In PW FieldtypeDate everything seems to be fine, i guess there is just a problem in the Import module.
Now i changed the CSV to dd.mm.yyyy, changed the date to the same format in the PW date field and everything is imported correctly.
Posted by doolak
on 31 January 2013 - 06:14 PM
Would it be somehow possible to display a date field formatted in a concat field? This is displayed as timestamp at the moment.
Posted by doolak
on 25 January 2013 - 07:19 AM
I already posted this issue to GitHub, but i am not sure if i made everything right over there (i closed the issue accidentally and reopened it) - so i decided to post it here, too:
When i log in as a non-superuser and add an image to a repeater, it is loaded up but the image is not shown in the administration if the page is unpublished.
If I publish it, the image is shown correctly - everything is fine. This just happens for an image field which belongs to a repeater.
I tried to find out why this happens and it seems to have something to do with the minus-sign in front of the files folder which is used for unpublished pages.
When logged in as superuser the image link is the same like for a non-superuser - the files folder is shown in the path without that minus-sign:
/site/assets/files/1264/slide1.jpg
But although the folder is named "-1264" the image is shown for superusers.
Edit: Forgot to mention that i am using the latest dev version of PW
Posted by doolak
on 15 January 2013 - 04:40 PM
That's why I wanted to work this one out - I've got a lot of repetition in some templates on one site so this will streamline things nicely!
Exactly.
The second one sounds like WillyC
agree i.do
do.i thank y.ou so much
Posted by doolak
on 03 January 2013 - 04:19 PM
Find content