Jump to content

gottberg

Members
  • Posts

    40
  • Joined

  • Last visited

Everything posted by gottberg

  1. Hi, I have a custom module i made a few years ago from where the users can add pages and PW automatically adds some children for them. The children have some of the values same as the parent. Now I need to update some fields for the children always when the parent is updated. I have never worked with PW hooks before but if iI understand them correctly it should do the trick? Could someone help me and give a few pointers so I can get a grasp on how I should do it? ? Simon
  2. Thank you so much for the help you gave! Bernhard helped me through Skype and TeamViewer and solved the issue. I have and had some issues with MAMP. He also gave me some pointers of how to use RockGrid and best practises etc. Worth every €!!! I recommend to use RockGrid if you need to list and edit data. I also recommend to contact Bernhard and buy some support if you want to quickly learn how to use RockGrid! ?
  3. Sorry, didnt think that through ? I get the same errors i Firefox: JqueryCore.js?v=1545420649:2 POST http://localhost/celsa/pw/celsacalc/?RockGrid=1&field=Transportzoner net::ERR_CONTENT_DECODING_FAILED 200 (OK) Could i have some issues with the Module? Also shows undefiend: 25 Edit: Trashcan also shows as undefined.
  4. Okey, but if i delete it does not do that. I just spins and when i refresh the page it is deleted. Any ideas?
  5. Should the page refresh when using the view, edit, delete if i would delete the page through RockGrid? col = RockGrid.colDefs.rowActions(col); col.pinned = 'left'; col.width = 120; For now it just spins and if i refresh the page it shows that the deletion worked. My console: [{action: "trash", payload: ["1949"], response: "Trashed 1 pages"}]
  6. Hi, This works great for numbers above hundred but it does not work when the range is 61-99 for example. Do you know what could cause the problem? EDIT: I solved the issue by using findOne(), wierd but now i get the results i wanted.
  7. Sorry, im bad at explaining. It's a backend module and i use RockGrid to display lots o different data. The data is loaded from PW. The question i had from the beginning was if i could create a RockGrid with plain PHP. The module has a form that gets submited with data, and i wanted to create a RockGrid just with the POST data, that originally was not getting saved. Now the data gets saved to a page and i can easily use RockGrid with that data. Small offtopic question: Can i change the separator to comma somehow? Thanks!
  8. Thanks, this got it working! I tried this earlier but i must have had a spelling error. ?
  9. Thanks for the fast reply! I still get zero results, so i seems like its not working. ?
  10. Hi, The template has 2 fields with numbers, lets call them n1 and n2. I want to find the page which fits my current number. For example my number = 10 Pages: PageID 1: n1 1 - n2 10 PageID 2: n1 11 - n2 20 PageID 3: n1 21 - n2 30 So i want this to return the pageID 1. With mySQL it would be something like this: SELECT * FROM numberTable WHERE 1265 BETWEEN `FROM` AND `TO`; I have tried multiple selectors but can't get it to work. Any suggestions?
  11. I meant that i would create a template to which the form would be submited so that i could use RockGrid as usual. I did that and i works great for this use! ? I would love to share but since its for the customers internal use im not allowed to share anything.. ? Once again thank you!
  12. Thanks for fast reply! Well in this case i would want the export to csv which would be convenient since the project uses RockGrid for many of the listings. ? I could save the form to a own template which would only be updated on submit, then i would get the export feature too ?
  13. @bernhard Thanks for the great module! Just started to use in in a project and it has helped me save a ton of time! Is it possible to create a grid just by PHP? Saw that there was a Javascript possibility but i would need to create grid from a form submit.
  14. Hi, thanks for the great module! Will be default in all my next PW-sites! I wonder if there is anyway to setup a mail trigger if a page gets unpublished/published?
  15. Thank you @flydev and @thomasaull for your responses. I got it sorted out thanks to that! ?
  16. Hi, how do i get multiple images when i query the API? My code: public static function getPage($data) { $data = RestApiHelper::checkAndSanitizeRequiredParameters($data, ['id|int']); $response = new \StdClass(); $p = wire('pages')->get($data->id); if(!$p->id) throw new \Exception('Page not found'); $response->id = $p->id; $response->name = $p->name; $response->title = $p->title->getLanguageValue('default'); $response->body = $p->body->getLanguageValue('default'); $response->sidebar = $p->sidebar->getLanguageValue('default'); $response->summary = $p->summary->getLanguageValue('default'); $response->images = $p->images; return $response; } My response now: { "id": 1002, "name": "child-page-example-1", "title": "Child page example 1", "body": "<h2>Ut capio feugiat saepius torqueo olim</h2>\n\n<h3>In utinam facilisi eum vicis feugait nimis</h3>\n\n<p>Iusto incassum appellatio cui macto genitus vel. Lobortis aliquam luctus, roto enim, imputo wisi tamen. Ratis odio, genitus acsi, neo illum consequat consectetuer ut.</p>\n\n<blockquote>\n<p>Wisi fere virtus cogo, ex ut vel nullus similis vel iusto. Tation incassum adsum in, quibus capto premo diam suscipere facilisi. Uxor laoreet mos capio premo feugait ille et. Pecus abigo immitto epulae duis vel. Neque causa, indoles verto, decet ingenium dignissim.</p>\n</blockquote>\n\n<p>Patria iriure vel vel autem proprius indoles ille sit. Tation blandit refoveo, accumsan ut ulciscor lucidus inhibeo capto aptent opes, foras.</p>\n\n<h3>Dolore ea valde refero feugait utinam luctus</h3>\n\n<p>Usitas, nostrud transverbero, in, amet, nostrud ad. Ex feugiat opto diam os aliquam regula lobortis dolore ut ut quadrum. Esse eu quis nunc jugis iriure volutpat wisi, fere blandit inhibeo melior, hendrerit, saluto velit. Eu bene ideo dignissim delenit accumsan nunc. Usitas ille autem camur consequat typicus feugait elit ex accumsan nutus accumsan nimis pagus, occuro. Immitto populus, qui feugiat opto pneum letalis paratus. Mara conventio torqueo nibh caecus abigo sit eum brevitas. Populus, duis ex quae exerci hendrerit, si antehabeo nobis, consequat ea praemitto zelus.</p>\n\n<p>Immitto os ratis euismod conventio erat jus caecus sudo. code test Appellatio consequat, et ibidem ludus nulla dolor augue abdo tego euismod plaga lenis. Sit at nimis venio venio tego os et pecus enim pneum magna nobis ad pneum. Saepius turpis probo refero molior nonummy aliquam neque appellatio jus luctus acsi. Ulciscor refero pagus imputo eu refoveo valetudo duis dolore usitas. Consequat suscipere quod torqueo ratis ullamcorper, dolore lenis, letalis quia quadrum plaga minim.</p>", "sidebar": "<h3>Sudo nullus</h3>\n\n<p>Et torqueo vulpes vereor luctus augue quod consectetuer antehabeo causa patria tation ex plaga ut. Abluo delenit wisi iriure eros feugiat probo nisl aliquip nisl, patria. Antehabeo esse camur nisl modo utinam. Sudo nullus ventosus ibidem facilisis saepius eum sino pneum, vicis odio voco opto.</p>", "summary": "Dolore ea valde refero feugait utinam luctus. Probo velit commoveo et, delenit praesent, suscipit zelus, hendrerit zelus illum facilisi, regula. ", "images": [ {} ] } Thanks for the great module!
  17. Thanks for the great module! When i use it for normal page sizes (A4,A3.. etc) it works fine but i don´t understand how i could get custom sizes for some templates. We sponsor the local football club and want to helt them generate tickets. The tickets look good but i dont find a way to get the custom sizes needed. Edit: How can i i create a file with multiple pages? My code: $options = array( 'title' => 'Skapa PDF', 'markup' => '<a href="{url}" target="_blank">{title}</a>', 'page_id' => 1043, 1044, 1045, // Pass a page ID if you want to download the PDF for another page ); $pdf = $modules->get('Pages2Pdf'); echo $pdf->render($options); Edit again: I added a custom pagesize in the mpdf.php file found i the mpdf folder under modules. I also solved the multipage problem with another template. ?
  18. Thank you both! I will test both methods tomorrow ?
  19. Thanks for the response! Sorry I didn't clarify I'm creating the pages using the API not by backend.
  20. Hi, How do I create a page with another user than the user currently logged in as? Example. Im logged in as Simon (superuser) and would want to create a page in the name of Jesper(regular) user. I could of course set a custom field named userid in the form but is there another way? So if I would select Jesper from the dropdown of users it would add Jespers ID to the page. Am I on the wrong track? Couldn't find a answer by googling. Coming back to PW from a 6 year long break! :D
  21. Thank you! That solved everything! i have one last questetion, how could i get the time posted? The time when the post was created. Simon
  22. Thanks, but what should it contain? Could you give some example of how to get it?
  23. Its hidden by default right? Because when i make it visible and i see Article on the menu it says 404 error.
×
×
  • Create New...