Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/20/2023 in all areas

  1. Here's a tiny module that I originally built for my own needs, but figured that someone else might find it useful as well: Textformatter Iframe Embed. It is a textformatter that (by default) turns this: <p>iframe/https://www.domain.tld/path/</p> ... into this: <iframe class="TextformatterIframeEmbed" src="https://www.domain.tld/path/"></iframe> Embed tag (iframe/) and iframe tag markup can be customized via module configuration screen.
    5 points
  2. Shoutout to @matjazp! Thanks for all your help!
    3 points
  3. Hey @howdytom I might be wrong, but I think that you misunderstand the concept of DPI on images on the web. This is a good blog post to read: https://daraskolnick.com/image-dpi-web/ So as far as I understand DPI should really not matter at all on the web. All that matters are the pixel dimensions of the image. More pixels --> bigger file size. Less pixels --> smaller file size. I think that this statements are wrong. I tried to prove that using affinity photo but it doesn't even offer a DPI setting for exporting JPG images. You only get a DPI setting if you export a PDF, which makes sense, because there the DPI define the size of the image when printed and there it makes a huge difference if you print 1000 pixels ad 72dpi or 300dpi ?
    2 points
  4. Following is how I've got it working. I haven't done major testing yet, but it appears to be working. /site/init.php (at end of file) require_once('./classes/CommonTemplate.php'); /site/classes/CommonTemplate.php <?php namespace ProcessWire; class CommonTemplate extends Page { function __construct($templates = array(), $parents = array()) { parent::__construct($templates, $parents); } function testClass() { be("This is working!"); } } /site/classes/[TemplateName]Page.php (eg: AboutUsPage.php) <?php namespace ProcessWire; class AboutUsPage extends CommonTemplate { function test() { $this->testClass(); // Works! } } This way I'm able to access methods from "CommonTemplate" in custom page classes as $this->methodName() and in actual template files it works as wire()->methodName(). So, for clarity: /site/templates/about-us.php <?php namespace ProcessWire; ?> <h1>Cool Macho HTML template stuff</h1> <?php page()->testClass(); // or $page->testClass(); // or $this->page()->testClass(); // or $this->page->testClass(); ?>
    1 point
  5. You can change the dpi in Document -> Resize Document by unchecking “Resample”, i.e. you’re just changing how big the image should appear on physical media but not its pixel dimensions: For example here’s a 300px by 300px picture of a salad. Both images are exactly the same, but if you import them into a DTP software like Affinity Publisher, InDesign or Scribus, by default one will be 8cm (96 dpi) and one will be 2.5cm (300 dpi). That is to say you’re correct and dpi don’t matter in terms of file size or pixel resolution on the web.
    1 point
  6. If I'm not mistaken, this is the same thing I'm trying to do right now but it's not working. I'm currently trying to figure out the best way to load the base class and use it with others in classes. JayGee, do you mean something like: /site/classes/CommonTemplate.php <?php namespace ProcessWire; class CommonTemplate extends Page { function __construct() { be("CommonTemplate initialized"); } function somethingAllPagesCanUse() { be("common template methods"); } } Then for specific pages: /site/classes/ContactPage.php <?php namespace ProcessWire; class ContactPage extends CommonTemplate { function __construct() { be("Not working"); } } Just typed that on the fly, sorry if there's errors. ?
    1 point
  7. Yes, that is the way. What are the contents of your DefaultPage.php file? https://processwire.com/blog/posts/pw-3.0.152/#new-ability-to-specify-custom-page-classes If you just want to add a method or property you can also use hooks for that: https://processwire.com/docs/modules/hooks/#how-can-i-add-a-new-method-via-a-hook
    1 point
  8. Dpi normally shouldn't matter. Are the problem images' px dimensions larger than the limits you have set? If using server side resize you could try client side.
    1 point
  9. The master/main branch is now updated to version 3.0.225. Early next week I'll be adding a git tag for the version number as well. I usually like to merge dev to the master/main branch first, let it marinate for a day or two, and then tag it. That's because once we tag it, it triggers other services to pick it up and broadcast it. So letting it marinate for the weekend just adds a layer of comfort, for whatever silly reason. That's pretty much how I've always done it. When I did the merge, it reported 511 files changed, 76421 insertions(+), 23539 deletions(-), so there's quite a lot in this version. There's enough, that I'm going to need another week to document it all into a new blog post, which should be ready by this time next week. Our contributors list also continues to grow nicely with this new version. Thanks to all those that have submitted PRs, reported issues, and submitted feature requests. Big thanks to @matjazp in particular who has been helping a lot in identifying, testing, organizing and even coding the solutions for numerous issue reports. More details on this new version next week. Until then, thanks for reading and have a great weekend!
    1 point
  10. With the Less Module you can place a admin.less inside your templates folder. .PageList .PageListItem { &[class*="PageListTemplate_component"], &[class*="PageListTemplate_section"] { background: #f3f3f3; border-bottom: 1px solid #e0e0e0; &.PageListItemOpen { background: #e0e0e0; border-bottom: 1px solid #c9c9c9; } > a { padding-left: 10px; &:before { content: "\f061" !important; margin-right: 10px; } } } } so all Component Template begins with „component…“ (section is only a older version)
    1 point
  11. $_POST is an associative array of variables passed to the current script via the HTTP POST method when using application/x-www-form-urlencoded or multipart/form-data as the HTTP Content-Type in the request. Not when using application/json. For json, you'd typically do something like this: $data = json_decode(file_get_contents('php://input'), true); AJAX is Javascript, and Javascript libraries often use the JSON method. I'm not sure if jQuery does, but I had the same issue when working with AngularJS in the past.
    1 point
  12. I also get these from time to time and find them quite annoying. I just delete them. Would be great to disable these emails ?
    1 point
×
×
  • Create New...