Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

7 Neutral

About entschleunigung

  • Rank
    Jr. Member
  • Birthday 02/17/1968

Profile Information

  • Gender
  • Location

Recent Profile Visitors

1,176 profile views
  1. hi teppo, muchas gracias, i will try it on monday in office, but i think i could work. of course
  2. hi dragan, i tried page->save() but i ran always in "internal server error". i think page->save() and this hook addHookAfter('save', $this, 'checkStateAndHide') looped everytime. i can't solved it.
  3. Hello, i'm writing my first module to learn and i would give my editors a handy way to unpublish pages. (i know this is possible with the settings-tab, but i want to solve it this way) on a page i have a checkbox "not active". if a editor check the box, pw should unpublish the page. for this i modified the helloworld-module like this but nothing changing on the page. how should i do this? thx public function init() { $this->pages->addHookAfter('save', $this, 'checkStateAndHide'); } public function checkStateAndHide($event) { $page = $event->arguments[0]; if(!$page->active){ $this->message("{$page->title} now hidden"); $this->page->addStatus(Page::statusUnpublished); } }
  4. maybe you can find some useful tipps here: https://geoffkenyon.com/ecommerce/urls-parameters/
  5. thank you, adrian, that was a great hint. and thank you robin for this module. i used this selector and it works fine: parent.id=1053
  6. hello, id=7753 ist for a specific id, but how can i manage this for an id and his children? thx
  7. sorry for the late reply. i check everything but nothing works for me at this moment, i will try a new installation of pw, perhaps i misconfigured something ... ?! (abdus, your last tipp i didn't try because i want start with a fresh installation, but thanks for the hint!) thanks for all tipps.
  8. hi abdus, i know about bootstraping the index.php, but why the function works with direct call the function in home.php and with ajax not? and this is the message, when i bootstrap index.php: Error: Cannot redeclare doSomething() thx
  9. hi alxndre, hi Zeka, i use ProcessWire 2.8.62 and they said for this version namespace are not necessary, right?
  10. hello, i have a _func.php file with this function. in the documentation i read that some api variables in functions are not available, so i use wire('pages'). function doSomething($u, $p) { $p = wire('pages')->get("id=$p"); $u = wire('pages')->get("id=$u"); $p->of(false); { ... populate repeater field stuff } $p->save(); } if i call this function in my home.php like doSomething(41,1093) (only for testing!) everything is fine, the function works, it add items to a repeater field. the german says "Wenn es dem Esel zu wohl ist, geht er aufs Eis", so i play around with ajax to fire up this function. $(document).ready(function() { $("#hit").click(function(){ $.ajax({ url: '<?= $config->urls->templates?>includes/_func.php/', type: 'post', data: {userID: "<?= $user->id ?>", pageID: "<?= $page->id ?>"}, success: function(output){ console.log(output); } }) }) }) i read something about variable scopes and i think i understand it a little bit. but i don't understand why doSomething(41,1093) works in home.php the ajax call runs into a Call to undefined function wire() ? also i tried if ($config->ajax) but no luck ... that's the relevant party of _func.php. function doSomething($u, $p) { $p = wire('pages')->get("id=$p"); $u = wire('pages')->get("id=$u"); $p->of(false); { ... populate repeater field stuff } $p->save(); } if(isset($_POST['userID']) && !empty($_POST['userID']) && isset($_POST['pageID']) && !empty($_POST['pageID'])) { $u = $_POST['userID']; $p = $_POST['pageID']; { ... } echo sendLike($u, $p); } where is my mistake? any ideas? thx
  11. sagol, yuvarlanıp gidiyoruz iste. means for the non-turkish members: thanks, this is really a great community and i learned a lot of interesting stuff. god bless ryan.
  12. sagol abdus, your solution is great and your explanation too, i will save it for further & greater problems i think my problem is solved by bernhards way. it's easy enough to deal with my zipcodes 0 - 9: THX
  13. hallo bernhard, selam abdus, thanks for now, i will try it and reply when it works or not, but this for-loop i see the first time. this loop really works with the fragezeichen or really works? THX
  14. hello there, this is my first post, please excuse my bad english. simple site building is not my problem. create templates, fields and pages and some foreachs in the templates and my easy sites are ready, with this stuff i'm familar. but now ...! i will try to explain what i want to do. i have a template with this fields: - name (text) - zipcode (integer) - city (text) that's need for a register with ca. 1000 records. what i want is now group this fields like this in the frontend. [ PLZ 1 (23) ] --- [ PLZ 2 (12) ] --- [ PLZ 3 (8) ] --- and so on. these should be buttons and the number in the bracket should show the count of records with starts this zipcode. click on the button shows me on the next page all records with zipcode e.g. PLZ 8 - 80331 - Name - 80337 - Name - 80337 - Name - 80539 - Name - 80539 - Name - 80638 - Name i think the logic is simple to unterstand but for me as a non-programmer is it difficult to group the fields and build the page. Auf Deutsch könnte ich das natürlich besser erklären, but has anybody a hint for me? thanks & greetings from munich
  • Create New...