Jump to content

psy

Members
  • Posts

    632
  • Joined

  • Last visited

  • Days Won

    8

Everything posted by psy

  1. Hi @bernhard love your work. Is RF2 upgradeable to RF3 or is RF3 a completely different module?
  2. It's fun and wildly different to what I'm used to. It's tight integration with VS Code makes learning much easier. Definitely worth a look
  3. @picarica all good, glad you solved it and no need to apologise ?
  4. @kongondo Have been studying/playing with Flutter and catching up on latest trends in CSS, Photoshop, and other stuff during "all this sh*t" (that's what we in Australia call the pandemic that will never be named). Can't "asynch await" to put new knowledge into action ?
  5. You are looping through the repeater field items (buildings) but not their images (one or many per building) as well. By default an 'images' field can hold multiple images and you simply loop through them. If the only field in your repeater is 'r_galeria_image' then it's unnecessary to have a repeater. foreach ($page->r_galeria_image as $image) { $thumbnail = $image->size(450, 250); echo"<article>"; echo "<a href='{$image->url}' class='fresco' data-fresco-caption='{$image->description}' data-fresco-group-options='preload: [1,2], effects: {spinner: {show:150, hide:150 } }' data-fresco-group='kolace'><img src='$thumbnail->url' alt='obrazok'></a>"; echo"</article>"; }
  6. @shogun This module may help or provide a good starting point: https://modules.processwire.com/modules/admin-restrict-page-tree/
  7. @JoshoB In my case the user is already logged in on the Front End, but you could test with an $input->get var: <?php $vars = ['page'=> $yourPageObject]; $out = $files->render('your-template', $vars); echo $out; exit();
  8. @Robin S Thank you! So many options and as said to Bernhard, will explore when I have time. Right now RockMarkup2 is doing the job with FB and elsewhere in the project. Will replace when the pressure is off
  9. Thanks @bernhard, after looking at your RockMarkup2 and Adrian's RuntimeOnly modules + your tutorials, am sure I could figure it out. For this project however, I'm under the gun with a rapidly approaching deadline. Will explore creating my own module when the pressure is off.
  10. Thanks @adrian @Robin S's module is simple and sweet. Sadly cannot use in FormBuilder as it has both the Inputfield class and the Fieldtype class within the FieldtypeRuntimeOnly.module file. FormBuilder looks for module files prefixed with 'Inputfield' in its list of approved input types. I use @bernhard's module 'RockMarkup2' elsewhere in the project and only discovered that it's designed to only work in admin and it's been deprecated. However, just tried it in FormBuilder and it works a treat. Maybe Robin and Bernhard can get together to come up with an easy to use module that has separate files for Fieldtype & Inputfield. That would be awesome!
  11. Encountered this issue too. The following change to InputfieldRuntimeMarkup appears to have fixed the missing utilities class: <?php public function init() { // parent::init(); // get the helper class (included in FieldtypeRuntimeMarkup.module file) $this->classLoader->loadClass('FieldtypeRuntimeMarkup'); // add this line to ensure the RuntimeMarkupUtilities class is available $this->rtmUtilities = new RuntimeMarkupUtilities(); } Can now install, uninstall, create & delete fields, etc without problems. I needed this module for a FormBuilder form but sadly the module's configurable fields aren't available in FormBuilder ?
  12. Yep, that's a solution - 20yrs ago HTML/CSS ? In my particular case there are other factors. The user can choose to include/exclude bits which makes it an ugly, logistical nightmare.
  13. Hi @bernhard Yes, RockLESS, SCSS and other CSS preprocessors can be useful. One thing I learned the hard way however is that the header is loaded before any HTML or CSS. The only way I could style the header to look as intended was with inline styles. I certainly used classes with the limited CSS styling available from mPDF in the body. Maybe there's a better way, just didn't have the time or patience to explore. Another limitation was with tables... I needed a centered heading and left aligned text within a table cell. Nope, if the <td> is left aligned, so is everything within the cell. Had to revert to divs which had an impact on the design. Told the graphic designer to live with it - it is what it is! LOL Having said that, love your module and mPDF, even with its constraints, is still the best HTML to PDF converter.
  14. @bernhard Oh so true! Pdf's can look different between browser views and Acrobat Reader too.
  15. Thanks for another great module @bernhard Wanted to share my experiences changing from Pages2PDF to RockPdf. Wasn't quite as straightforward as I'd hoped. Such is life, but I got there. Pages2Pdf uses mPDFv5+ while RockPdf uses mPDFv7+ and I needed some of the newer features. Things Iearned along the way: 1. If you need to use @page, you lose everything in the template $pdf->set('header', '...'); settings. This has nothing to do with RockPdf but a 'feature' of mPDF 2. It's much easier to add custom fonts to RockPdf than Pages2PDF 3. You can display images in a circle using background-image but they don't print so that's not helpful, LOL This is NOT a full tutorial but hopefully will give you some pointers on how I got RockPdf working for a fairly specific PDF design. RockPdf template settings: <?php $pdf = $modules->get('RockPdf'); $pdf->settings([ 'fontdata' => (new \Mpdf\Config\FontVariables())->getDefaults()['fontdata'] + [ "montserrat" => [ 'R' => "montserrat-regular.ttf", 'B' => "montserrat-bold.ttf", ], "montserratlight" =>[ 'R' => "montserrat-light.ttf" ], "montserratthin" => [ 'R' => "montserrat-thin.ttf" ] ], 'defaultheaderline' => 0, 'font_size' => 9, 'mode' => 'utf-8', 'font' => 'montserrat', 'page_format' => 'A4', ]); $css = wireRenderFile($config->paths->templates . 'RockPdf/styles-v3.css'); $pdf->write("<style>" . $css . "</style>"); $body = wireRenderFile($config->paths->templates . 'RockPdf/profile_pdf_cv-v3.php'); $pdf->write($body); $pdfFile = $sanitizer->pageName($profile->title) . "-" . $profile->id . ".pdf"; $pdf->show($pdfFile); die(); // Remove old Pages2PDF settings // $mpdf->markupMain = $config->paths->templates . 'RockPdf/profile_pdf_cv-v3.php'; // $mpdf->markupHeader = $config->paths->templates . 'RockPdf/_header-v3.php'; // $mpdf->markupFooter = $config->paths->templates . 'pages2pdf/_footer-v2.php'; // $mpdf->cssFile = $config->paths->templates . 'RockPdf/styles-v3.css'; // $mpdf->pageOrientation = 'P'; // $mpdf->pageFormat = 'A4'; // $mpdf->topMargin = 9.5; // $mpdf->rightMargin = 0; // $mpdf->bottomMargin = 9; // $mpdf->leftMargin = 0; // $mpdf->headerMargin = 0; // $mpdf->footerMargin = 0; // $mpdf->fontSize = 9; // $mpdf->mode = 's'; // $mpdf->font = 'montserrat'; Header code: <div style=" background-color: #007ee5; height: 10mm; margin: 0; top: 0; left: 0; right: 0; width: 100%; "> </div> Page layout code: <?php // header is the same on all pages but need more spacing on all pages except the first $header = wireRenderFile($config->paths->templates . 'RockPdf/_header-v3.php'); ?> <htmlpageheader name="myHeaderFirst" style="display:none"> <?=$header?> </htmlpageheader> <htmlpageheader name="myHeader" style="display:none"> <?=$header?> </htmlpageheader> <sethtmlpageheader name="myHeaderFirst" value="on" show-this-page="1" /> <sethtmlpageheader name="myHeader" value="on" /> <div class="user-dets"> CSS: /* Additional fonts added to: site/assets/RockPdf/fonts */ @page { margin: 15mm 0 0 0; /* <any of the usual CSS values for margins> */ /*(% of page-box width for LR, of height for TB) */ margin-header: 0; /* <any of the usual CSS values for margins> */ margin-footer: 9mm; /* <any of the usual CSS values for margins> */ marks: none;/*crop | cross | none*/ header: html_myHeader; } @page :first { margin: 9.5mm 0 0 0; /* <any of the usual CSS values for margins> */ /*(% of page-box width for LR, of height for TB) */ margin-header: 0; /* <any of the usual CSS values for margins> */ margin-footer: 9mm; /* <any of the usual CSS values for margins> */ marks: none;/*crop | cross | none*/ header: html_myHeaderFirst; } Hope this is useful. Cheers psy
  16. Hi @Jozsef The module defines a special fieldtype of FieldtypePushAlert - this generates the message title, content etc sub-fields in the template for the push notification. It's used in various ways under the hood to send and gather/display stats about the notification. So, no, you can't use the existing title, headline, summary fields with this module.
  17. I used Canvas HTML theme which overlaid Bootstrap then added my own customisations which often overrode the Canvas theme CSS which overrode Bootstrap. The code bloat was stupid. Going back to pure SCSS/CSS with smarter use of CSS Grid, Flex & media queries. Can now place things where I want depending on screen size/device without unnecessary HTML for purely structural purposes, eg floated divs etc and much less CSS download. The page file size difference is incredible. Also trying to wean self off jQuery. That may take a little longer especially as PW is so dependent on it.
  18. [SOLVED] I've used this module in the past and it's been great but now I'm having problems. Scenario Page to output as PDF is different to current page so included link in the template as per instructions Created template in pages2pdf/ templates dir with same name as page template Configured module to use header & footer Set Cache time to 1 to minimise caching while testing Configured Creation Mode to "On click..." as there is no need to store the PDF's on the server All good so far. Just needed to tweak the topMargin to that the header didn't overlap the main content. That's where I got into trouble. To eliminate any caching issues, I change $config->debug to true and this was the result: It went on with a lot of garbage and nothing was downloaded. Switched $config->debug back to false and at least got the download happening. I need to increase the size of the header so it doesn't overlap the main content. Read the doco and tried to implement the recommendations in every place possible without success. Question: How do I change the top margin without hacking the default "30" in the module? Using PW v3.0.148 and Pages2PDF v1.1.7 Solution: WirePDF requires the pdf to be saved in order to apply any config changes such as the top margin.
  19. @prestoav I needed something similar however I did not want to give the front end users all the features available in the PW CKEditor menu. It was more difficult for me to reduce the feature set than start afresh for the front end and I chose TinyMCE over CKEditor. In the form, I created a textarea field with no textformatters and a limit of 5000 characters. In my template: <script src="<?=$config->urls->templates?>scripts/tinymce/tinymce.min.js"></script> <script> // NoMinify tinymce.init({ selector: '#Inputfield_introduction', height: 300, menubar: false, plugins: [ 'advlist autolink lists link image charmap print preview anchor', 'searchreplace visualblocks code fullscreen', 'insertdatetime media table paste code help wordcount' ], toolbar: 'undo redo | formatselect | bold italic backcolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | removeformat | help', setup: function(ed) { var maxlength = parseInt($("#" + (ed.id)).attr("maxlength")); var count = 0; ed.on("keydown", function (e) { count++; if (count > maxlength) { alert("You have reached the character limit"); e.stopPropagation(); return false; } }) } }); </script> And the end result on the front end: Data is saved correctly in the DB and all good. PS: If anyone tries to add in a sneaky <script>, it throws 403 Forbidden error
  20. psy

    ProcessWire on the web

    Another thing I love about PW is the friendly, supportive forum. I certainly don't want to be accused of trolling the guy. He put his opinion out there based on his experiences, as is his right. Should he venture here though, I'd be more than happy to help him with his PW site
  21. psy

    ProcessWire on the web

    https://dougmcarthur.net/
  22. psy

    ProcessWire on the web

    "You can't fix 'stupid'" is an old saying. Sure PW is not for everyone and as the guy said, "Great for developers (I assume), pretty bad for everyone else". What got up my nose was he presents himself as a web developer/designer/guru and his own site is technically bad. Done well, PW is great for everyone. I suspect where he got lost was "assuming" that PW was a load the app, apply a FE theme, bung in a few plugins, squeeze your content to fit the theme and away you go. The thing I love most about PW is the exact opposite. I have complete freedom to build my sites, backend, frontend & user-friendliness
  23. psy

    ProcessWire on the web

    After looking at his site, my guess is "You can't fix 'stupid'"
  24. I usually do a combination of both - separate 'Business Info' page that stores stuff like logo versions, etc and a functional field that stores common text phrases. All editable by admin on that page and (I believe as don't use it), editable for multi-lang sites. Even go so far sometimes to make the page a link in the admin main menu, with or without a custom module
×
×
  • Create New...