Jump to content

gottberg

Members
  • Posts

    40
  • Joined

  • Last visited

Posts 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. 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! ? 

    • Like 1
    • Thanks 1
  3. 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!

  4. 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?

  5. 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! 

  6. 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 ?

  7. 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!

  8. 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. ?

  9. 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

×
×
  • Create New...