Jump to content

bernhard

Members
  • Posts

    5,714
  • Joined

  • Last visited

  • Days Won

    270

Everything posted by bernhard

  1. @Zeka this wont work because it means that either first_name or last_name has to contain all the words (john doe). also something like this would be not exactly what you are looking for, i guess: first_name|last_name=john|doe ...because it would also find "hans doe", "maria doe", "john müller" etc. i think the best is to populate a hidden search index field with what you want, for example: $wire->addHookAfter('Pages::saveReady', function($event) { $page = $event->arguments(0); if($page->template != "yourtemplate") return; $page->searchindex = "{$page->forename} {$page->surname} # {$page->surname} {$page->forename}"; }); and the selector $pages->find('searchindex~=john doe');
  2. so why don't you just load your children via their regular url? seems that there is no need for url segments here or you modify your url segment and add some kind of prefix that you strip off when requesting the child.
  3. i don't know of any ready solution, but as soon as you have your data in some nicely structured way on the joomla-side it should be very easy to do on the pw side: for csv there are some modules available. maybe you can use an RSS module on the joomla side. or maybe just scrape the information from the HTML, for example i used http://simplehtmldom.sourceforge.net/ some times good luck and enjoy the move from joomla to processwire
  4. hi @kongondo did you think about my suggested new render method? another thing that would be good imho is to mention in the docs / in the first posting that you can do this return ProcessWire\wireRenderFile('fields/myfieldsphpfile.php', ['page' => $page]); To have the currently edited page available in your file. It's very basic, but might help some beginners. I would also suggest to update my render-method passing the $page and $pages variables to the renderfile: // change this $str = wireRenderFile($root.$file); // to that $str = wireRenderFile($root.$file, [ 'page' => $page, 'pages' => $pages, ]); what do you think?
  5. thank you robin, that worked! it's not directly what i wanted but almost the same
  6. I understood it like this, my workaround would work I'm quite sure. Though I would file a github issue as I think it should work as you expect...
  7. hi everybody! i'm linking directly to some tabs in my processpageedit form and it works great for my custom tabs. it does not work for the system tabs unfortunately /page/edit/?id=123&field=mycustomtab (fieldset tab in the template editor) shows only the fields inside this tab. I tried this: /page/edit/?id=123#ProcessPageEditDelete ...but this does not work inside a pw-panel any ideas?
  8. If I understand your setup correctly you could do one field for each language then? Modified de ... Timestamp Modified en ... Timestamp You could populate all fields on save and then just sort on the appropriate field ('..., sort=modified_' . $lang)
  9. Hi webaff, I would create a hook on saveready populating a (hidden) field with whatever value you need and use this field for sorting. This way you have any freedom that PHP and the PW API give you Hope that helps
  10. hi alyxgd and welcome to the forum besides all the links you already got i would recommend you proceed like this: backup your existing site bring a copy of your existing site to your local computer do your changes on your local computer create a copy of your website on your web-server (eg on a subdomain: new.yoursite.com) bring your local copy to your live server and test if everything works if everything works, overwrite your old site with the new one caution: all data that is created between downloading the website and uploading it again will get lost. so if you have something like a guestbook or any other user generated content that could maybe get lost or you would have to deactivate your site for that time. if you only have a simple site (like it sounds from your description) that will not be an issue. people here are always really quick with answering questions so i'm sure you will always find a helping hand. if you want to save time and only focus on point 3 i'm sure you'll find someone here that can help you and has all the other points done in under 2 hours... good luck and i hope you enjoy processwire...
  11. thanks, got it have to start using it. i understood the multilanguage part but never needed it so far. but it seems that i will use more tags and less imagesfields in the future (i used to create single fields for what you describe) thanks!
  12. could anybody of you guys using image tags please give me an example when and what for you use it? i've never used image tags in the past 3 years and would like to make sure if i was missing something or if i just had no use for it thanks!
  13. Hallo GGTB und willkommen im Forum, es gibt auch ein paar Österreicher und Schweizer hier... da wäre die sprachliche Barriere vernachlässigbar Also definitiv nur Deutschland oder deutschsprachig / EU ? LG
  14. @joe_g keep in mind that whenever you update your processwire installation this issue will return (if your hoster didn't change the config until then)
  15. thank you robin, it worked! still i would like to know what's going on and why it does not work as expected...
  16. hi robin, coming from other cms the widgets seem to be quite common. i created somthing like this some time ago and never needed it again until now. but you will find some useful information here: and here: in the screencast you see it starting at 2:15
  17. took me some time today to find out why my page was not showing up... i ended up creating a hook that does what apeisa had in his mind some years ago // set all languages active automatically $wire->addHookAfter('Pages::added', function($event) { $page = $event->arguments(0); foreach ($this->wire->languages as $lang) $page->set("status$lang", 1); $page->save(); }); does anybody see any danger in that? i'm not so experienced with multilang yet... edit: somehow it seems that ->setAndSave(...) does NOT work in this situation. @Can or @dragan can you confirm that?
  18. please see this screencast. i have two questions: dou you also experience the bug related to inputfield toggles that i demonstrate at 0:09 ? one does not see it clearly but i click the inputfield but the field does not get collapsed. i have this in all my installations. you have to click the chevron icon on the right first. after you clicked it once you can click everywhere on the inputfields label to toggle it. why is the opened and openReady event fired twice? i tried to understand the code but i have no explanation yet. the trigger is here: https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/templates-admin/scripts/inputfields.js#L1018 i put a console.log() here: https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/templates-admin/scripts/inputfields.js#L1000 (fired only once) but if i catch the opened event like this, i always get 2 logs: <script> $(document).on('opened', 'li', function(e) { console.log('opened!'); console.log($(e.target)); }); $(document).on('openReady', 'li', function() { console.log('openReady!'); }); </script> i thought maybe the event is fired on different li elements, but e.target returns the same element...
  19. in fact this is wrong! this is correct: $pages->get(123); // returns also hidden and unpublished pages $pages->find('id=123'); // returns a "PageArray", but only published + visible pages $pages->findOne('id=123'); // returns a single "Page" object, also only published + visible pages find and findOne can be modified with your selector like "include=hidden"...
  20. unfortunately i can only quote soma here. though it would be interesting to hear @ryan s opinion in this case...
  21. i had something similar 2 times until now...
  22. hi everybody, I'm working on my new datatables module. i pass a pagearray (rows of the table) and for each column i call the column callback that returns the value of the cell: // check type if(!is_array($rows) AND !($rows instanceof PageArray)) throw new WireException("Data must be an Array or a PageArray"); // create objects for each row (page) foreach($rows as $row) { $obj = new \stdClass(); // create property for each column foreach($this->cols as $col) { if(is_callable($col->data)) { $obj->{$col->name} = $col->data->__invoke($row, $col); } } $json->data[] = $obj; } return json_encode($json); $col->data->__invoke($row, $col) makes it possible to define the tables columns like this: $col = new ProcessWire\dtCol(); $col->name = "id"; $col->title = "Page ID"; $col->data = function($page) { return $page->id; }; $this->cols->add($col); the problem is, that $page inside the $col->data function has of(false)! what i need to be able to do is this: $page->of(true); return $page->title; // return current's language title doing a $this->wire->pages->of(false); works, but that's no possible solution. does anybody know whats going on here? thank you! edit: maybe this could be related to that i'm including the code via eval() ?
  23. hi dweeda and welcome to the forum, not sure what you are trying to do exactly. maybe you can be more clear about what you are trying to achieve? if you need the script to run as a special user you can use https://processwire.com/api/ref/session/force-login/ but your question sounds a bit strange. maybe (as often in pw) there is a much more elegant solution and you don't need all this bootstrapping
  24. you can report issues here: https://github.com/processwire/processwire-issues but i think it's too early to report this as an issue since the image field is commonly used without any problems. i guess it is somehow related to your setup. what is the output of your response (you see it in the network tab of your dev-tools)? it seems that you have an error that throws only when debug is ON. when you switch it off the error is supressed and therefore the upload works. check also your error logs of processwire and your server. i'm quite sure you'll find valuable information there
  25. Hi HarryPhone, sounds like you are just a little too early. Your usecase looks like a perfect fit for my new modules agree with this, would do it a little different though: i would use my RockDatatables instead of the Core AdminDataTable. you will be much quicker and you will have much more options regarding rendering the table (coloring cells, rendering linked icons and the like). regarding the import you have serveral options (there are several csv modules around). it's also very easy to write your own XML importer: using my module you can build highly customized listers. its also very easy to create processmodules to make them available as single pages in the pw admin. the module is not released yet and has some drawbacks (like mobile usage or handling large datasets is not yet implemented, that would be a case for regular listers), but maybe it's interesting to know that something like this is coming up.
×
×
  • Create New...