Jump to content

toni

Members
  • Posts

    59
  • Joined

  • Last visited

Everything posted by toni

  1. this can be closed (cannot find a close button ? time to shut down the computer.)
  2. Hi, I'm using the excellent Template Engine Factory from @Wanze and Smarty. One thing I can not figure out is how to use pw's `__('…')` translate function within my templates. This is how I tried: /site/templates/views/fundus-index.tpl <a href="{$page->httpUrl}">__("zurück")</a> <a href="{$page->httpUrl}">{__("zurück")}</a> I would expect to find `fundus-index.tpl` in translatable files. Unfortunately it does not show up even after refreshing the list (screenshot attached). When trying to enter the file directly I get a warning saying: ProcessLanguageTranslator: That file has no translatable phrases After that I've tried to setup a new php file `/site/translations.php` with content `__("zurück")`. This file shows up and I can successfully translate the string which I would expect that this string is globally available across all files (missing knowledge regarding the usage of translations ;) However my template file does not care about this newly created translation. So long story short. How can I use translations in smarty templates? Best regards, Toni
  3. Got it ? the field itself allows the output definition...
  4. Hi, templates the definition of fields shown in page lister. For example one can define {title}, {surname} to be shown. However, when choosing a datetime field {enddate} it's timestamp will be shown. How can I format the timestamp as readable time?
  5. ... and also in addition to a json object as I suggested above you could also simply use a plain textfield and store your ini there like: [names] me = "Hello" you = "World" [urls] first = "http://www.example.com" in your template you could access it as array with: print_r(parse_ini_string($page->ini)) Array ( [me] => Hello [you] => World [first] => http://www.example.com )
  6. @Vigilante A config page with simple textfields for storing settings might be the best way to go. Another option would be your config.php . But in your case this is rather inappropriate as it might be hard to edit for your client. By the way instead of creating several fields in your config page you could also create one text field and put a json object in it which you could access and parse when needed. (provided the customer can handle json.)
  7. Hi @Fanni, a little late and only litte information but here is my guess. As you say the error message points to thumbnail creation from pdf. Behind the scenes following modules are most likely used: Imagick (Php Extension) Ghostscript (PDF Interpreter) and maybe ImageMagick From other non-processwire projects I've experienced a similar behavior caused by the used ghost script version. So ghostscript is where I would start. (You can read about a similar issue here: https://stackoverflow.com/questions/53560755/ghostscript-9-26-update-breaks-imagick-readimage-for-multipage-pdf) You could check your gs version under linux with something like ` /usr/bin/gs --version 2>&1 on a shared host phpinfo() might tell you the used version as well. If not your hosting provider will for sure tell you.
  8. Nice option thanks Jens, thanks! Did not know of this plugin!
  9. @elabx thanks a lot this is a nice idea!
  10. Hi, hope this is the right place to ask. Let's say next to others I have templates exhibition and news. Those templates have fields like: Title, author, files, startdate, enddate etc... For some fields I now want to show "tags" or "bages" similar to those attached to this issues at my sites frontend. Each badge should count the total values of some field of all pages. For example badge "Files" should count all files across pages with templates exhibition|news and onclick present a list with all files as links to its page. Solutions I can think of A) Search for fields in question across pages, count the values and build an array with all links: for files this could look like: $all_files = $pages->find("template=exhibition|news, files>0"); foreach($all_files as $p) { print_r($p->files); // fill array with values // count results ... } The downside is this will be hard to manage, and maybe not quite performant? Thinking about using pro cache and maybe raw sql queries. B) Hook into page save, change, delete and update an array which I save in some textfield of a config page. This config page could be populated as api endpoint and return a full ready json object with count, links, titles etc. CON: More logic for building the array is needed, Pro: performance as the array is already built when a user visits the page? So long story short. This question is more about a start in the right direction. Thanks and merry christmas! Toni
  11. @Gadgetto Snipwire looks awesome. Many many thanks. I will give it a test run. May I ask you two questions. - with snipcart/snipwire is it easily posible to calculate price reductions before checkout. let's say you buy two t-shirts and like to reduce the second shirt by 10%? - I've seen the dashboard has links for bills. Are those in PDF Format and in case can one customize the PDF template? Much Kudos again! Great working and sharing!
  12. Hey ho! Sorry for late reply. All answers helped a lot! By knowing where to find the image sizer logs I could see that memory exceeded as horst suspected. I've tried the imagemagick module before but even if I checked everything I could it did not seem to work. Just before asking for help here and with my hoster. I found the mistake with rubber duck debugging ;)) -> The images where already generated (broken), so processwire did serve the broken images. After getting rid of them, the imagemagick module does a wonderful and ligthing fast job by recreating them. All fine! grazie mille! Toni
  13. In Addition, this is what a broken image looks like: $ cat /Users/base/Desktop/cmueller_dasstillebildverlassen4.780x0.jpg This is intentionally invalid image data.
  14. Hi, I'm facing a strang problem. In my template I'm setting different sizes for srcset: $view->set('images', $page->picture); <img srcset="{$img->size(780,0)->url} 780w, {$img->size(1024,0)->url} 1024w, {$img->size(1440,0)->url} 1440w" src="{$img->url}" class="col__image"> All fine. However, the moment I reorder images in backend the different generated image sizes are broken. Does somebody has an idea what could cause it? Version: ProcessWire 3.0.123 Thanks! Toni
×
×
  • Create New...