Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/28/2024 in all areas

  1. Comments.php isn't loaded automatically. It's only included when FieldtypeComments is loaded. The quickest way to access all the auxiliary classes for this fieldtype is to load the module by calling $modules->get('FieldtypeComments');
    4 points
  2. Have reworked all my projects with Latte and CustomPage classes and the code is more clean, way easier to read and maintain and more structured now. Definitely recommend diving into Latte and CustomPage classes for new projects to anyone. Both techniques were easy to learn and paid off quite soon in my projects.
    2 points
  3. @TomPich If the "date" field is an actual date field type (as opposed to an integer field storing the raw timestamp), this should work out of the box. The module knows about date fields and how to format them with using a custom format. If you're storing the timestamp as an integer, I'd suggest switching to an actual date field and getting the raw timestamp from that date field in the frontend instead: $page->getUnformatted('date') will usually get you the non-formatted timestamp as integer.
    1 point
  4. Imagine you want to display an image on your website. Easy. Imagine you want to open the bigger version in a lightbox. Easy when using UIkit (or any other framework). Imagine you only want to add the lightbox link only if there is actually a larger version than the one displayed. Easy when using LATTE ? <div n:if="$img = $page->image" class="uk-background-muted uk-padding-small uk-text-center" uk-lightbox > <a n:tag-if="$img->width > 800 || $img->height > 400" href="{$img->maxSize(1920,1920)->webp->url}" > <img src="{$img->size(800,400)->webp->url}" alt="{$page->title}" /> </a> </div> This takes care of so many things with so little and clean code: the n:if on the outer div makes sure that we don't get any errors if no image is uploaded the n:tag-if makes sure that the anchor wrapper is only added if the original image is larger than the thumbnail Note that you can assign $img directly in the n:if condition. No need for an additional {var $img = $page->image} at the top. For some that might be too short, but I like it ?
    1 point
  5. v1.5.0 adds support for directly using fontawesome icon markup like <i class="fa-brands fa-youtube"></i> Just download FontAwesome and start using FontAwesome markup in your PDFs right away! ?? Docs: https://www.baumrock.com/en/processwire/modules/rockpdf/docs/fontawesome/
    1 point
  6. Hey @Jon sorry for the trouble, but I have a little present for you ? v1.5.0 adds support for directly using fontawesome icon markup like <i class="fa-brands fa-youtube"></i> The release is less than 10 minutes young and ready for download at https://www.baumrock.com/en/releases/rockpdf/ Docs are already there as well: https://www.baumrock.com/en/processwire/modules/rockpdf/docs/fontawesome/ Hope that helps you and many others ?
    1 point
×
×
  • Create New...