gottberg
-
Posts
40 -
Joined
-
Last visited
Posts posted by gottberg
-
-
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
-
On 6/4/2019 at 8:13 PM, flydev said:
Looking at the error you got, you could fix it by enabling zlib.output_compression in your php.ini.
ps: to be clear, you have a server issue.
Thanks for the tip! Tried that but i doesn't help.. ?
-
On 6/4/2019 at 11:48 AM, bernhard said:
I'm sorry but I can't help you further than I did with this one. If you want me to have a look at your setup you can contact me via email/PM.
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! ?
- 1
- 1
-
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.
-
8 minutes ago, bernhard said:
view+edit: no (not by default)
delete: yes
Okey, but if i delete it does not do that. I just spins and when i refresh the page it is deleted.
Any ideas?
-
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"}]
-
On 5/21/2019 at 7:23 PM, LostKobrakai said:
It's probabably more like:
$pages->get("template=your-template, n1<=$myNumber, n2>=$myNumber")
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.
-
54 minutes ago, bernhard said:
Still don't get it. We have forms all over PW (and the web), so it's hard to guess which one you are talking about... and I have also no idea what you mean by using RockGrid "as usual" - but I'm curious: Are you using it on the Frontend?
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!
-
7 minutes ago, LostKobrakai said:
It's probabably more like:
$pages->get("template=your-template, n1<=$myNumber, n2>=$myNumber")
Thanks, this got it working! I tried this earlier but i must have had a spelling error. ?
-
4 minutes ago, louisstephens said:
I believe it is as simple as doing:
<?php $p = $pages->get('template=your-template, n1|n2=10'); echo $p->id; ?>
Thanks for the fast reply!
I still get zero results, so i seems like its not working. ?
-
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 30So 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?
-
21 hours ago, bernhard said:
Sorry, I don't get what you are saying ?
BTW: Of course you can just show a simple grid without modifying it via javascript. That's explained in the quickstart: https://github.com/BernhardBaumrock/FieldtypeRockGrid/wiki/Quickstart (actually there is nothing to explain if you don't use any javascript modifications). But as soon as you want to style or tweak your grid (eg custom Headernames) you need javascript.
Would be happy to see some screenshots so maybe others do also get inspired by your work ?
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!
-
1 minute ago, bernhard said:
Hi @gottberg
glad to hear that. Sometimes I feel that the potential of this or similar modules is underestimated. If you only need a HTML grid (table) then you might be better off using MarkupAdminDataTable. RockGrid is by design a grid with user input like filtering and sorting and custom colorizations based on cell values. If you don't need all that just create a plain html table.
Does that help?
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 ?
-
@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.
-
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?
-
Thank you @flydev and @thomasaull for your responses. I got it sorted out thanks to that! ?
-
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!
-
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. ?
-
Thank you both!
I will test both methods tomorrow ?
-
Thanks for the response!
Sorry I didn't clarify I'm creating the pages using the API not by backend.
-
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
-
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
-
Thanks, but what should it contain? Could you give some example of how to get it?
-
Its hidden by default right? Because when i make it visible and i see Article on the menu it says 404 error.
Add hook to custom module form changes to update childpages
in General Support
Posted
Hi,
Great, thanks for the help!