Jump to content

horst

PW-Moderators
  • Posts

    4,088
  • Joined

  • Last visited

  • Days Won

    88

Everything posted by horst

  1. currently this is not supported, but I build a new version of the module and will try to include this, because it is a useful feature.
  2. You mean for multilanguage usage?
  3. @kunago, here a screenshot with the selections for a 1920x750 px variation and a mobile version of 960x750 px: The live site of this example is https://www.die-wurzen-studie.de/ , where all of those fullwidth images (1920x750 px) have a mobile version of 960x750 px for the smaller screen resolutions.
  4. @kunago: CroppableImages only purpose is the creation of variations with fixed aspect ratios. But you need to define it in pixels. Lets say you need a 3:1 result, your original image is 3000x3000 px, you need to define the outcoming pixeldimensions, for example 900x300, or 1800x600, or 3000x1000, ... Then you will get a fixed aspect ratio rectangle to select your desired area. The result then is rendered as variation with your defined pixel dimensions.
  5. horst

    SeoMaestro

    Yep. ?
  6. there is a thirdparty module available, that let you define different crops with absolute width x height sizes. It is called CroppableImage3.
  7. horst

    SeoMaestro

    then you can let this out. try it like this: $p->of(false); $title = trim($p->get('seo_title')); $title = $title ? $title : 'inherit'; $desc = trim($p->get('seo_description')); $desc = $desc ? $desc : 'inherit'; var_dump($title); var_dump($desc); $p->seo->meta->title = $title; $p->seo->meta->description = $desc; echo $p->save() ? " - 1" : " - 0";
  8. horst

    SeoMaestro

    so you need to check that the fieldnames (your old fieldnames and the new ones) are adressed correct in the script part that came from Wanze. Also you can output the result of the save() method, for example by using var_dump($p->save());
  9. horst

    SeoMaestro

    Hi, you need to remove my name from the check, if its a Superuser, who called the script. Please follow the comments in the script to adapt all parts to suit your needs, (selector, fieldnames, ...), and you may add some temporary checks when testing the script first time. AT FIRST, uncomment the //die('BREAK!!'); line, so that you only test with one page. (Script stops after first loop). Maybe this is already all what is to do. If not, come back and tell what is missing or has happened.
  10. horst

    SeoMaestro

    Hi @Ben Sayers, are you sure that you need to use the migration module for that onetime migration? For me it looks like you simply can run this example script once (with your fieldnames) and then you are ready. To do this, you can create a php file with a name you like, in your root directory, besides the index.php. Calling this script will bootstrap PW and do all your desired work. Here an example. NOTE: Not tested, written in the browser! Before running this, do a BACKUP-COPY of your database, so have option to roll back, when something went wrong. <?php namespace ProcessWire; // prepare server for continuous output if(function_exists('apache_setenv')) @apache_setenv('no-gzip', '1'); @ini_set('zlib.output_compression', 'Off'); @ini_set('output_buffering ', '0'); @ini_set('implicit_flush', '1'); @ob_implicit_flush(true); @ob_end_flush(); //if(isset($_SERVER['HTTP_HOST'])) header('Content-Type: text/plain'); // bootstrap PW require_once('./index.php'); // here you bootstrap PW, after that line you will have available the most PW variables and functions. if(!$user->isSuperuser()) { // when using those scripts online, I do secure them with forcing a login in the admin as Superuser, ... echo "ACCESS DENIED! ($user->name)"; exit(1); } elseif($user->isSuperuser() && 'horst' == $user->name) { // and where are multiple superusers registered, additionally limited to my username echo '<pre>'.$_SERVER['HTTP_HOST'].' :: '.basename(__FILE__)."\n"; $selector = " DEFINE YOUR SELECTOR HERE TO GET A PAGE ARRAY WITH YOUR PAGES "; $pa = $pages->find($selector); // or: $pa = $pages->findMany($selector); $max = count($pa); $cur = 0; foreach($pa as $p) { // loop over all collected pages set_time_limit(30); // renew the time limit for each loop, so that you may run this script long times, but lets it time out on failures in a reasonable short timeframe $cur++; // following do your work if(!$p->hasField('seo')) { continue; } echo " - [$cur / $max] {$p->title}\n"; $p->of(false); foreach (wire('languages') as $lang) { wire('user')->language = $lang; $title = $p->seo_title->getLanguageValue($lang); $desc = $p->seo_description->getLanguageValue($lang); $p->seo->meta->title = $title ?: 'inherit'; $p->seo->meta->description = $desc ?: 'inherit'; } $p->save(); $pages->uncacheAll($p); // after saving, uncahe the current page //die('BREAK!!'); // just when first test the script before processing all items } die('<p>READY!</p>'); } die('RIP');
  11. Hi @szabesz Interesting workflow. Just a sidenote from me: if you want to start right now, you may store the new page class files within your workflow structure and additionally maintain the given site/classes directory by just give it proxy files that include or require the files from your internal structure. Just as a temporary workaround. And if Ryan cannot implement your request, it would be easy to use a script that scans and create / sync the proxy files directory for you in regard to portability. @ryan Well done! ?
  12. @ryan many thanks for that useful piece of code. I used it a lot lately, also on sites that changed during my locally work. Therefor I need to adapt it a bit to first check if the remote file is available (and the optional use of basic auth). So, if it is of use for someone too, here it is: // use assets from remote host on demand for local development copies $wire->addHookAfter('Pagefile::url', function($event) { fetchRemoteAssetsToLocalDev($event); }); $wire->addHookAfter('Pagefile::filename', function($event) { fetchRemoteAssetsToLocalDev($event); }); function fetchRemoteAssetsToLocalDev($event) { if(!$event->wire('user')->isSuperuser()) return; // only my personal preference $config = $event->wire('config'); if(!$config->Remote2Local) return; // I set the domain name of a remote host in the site/config.php $remoteHost = 'https://' . $config->Remote2Local; // I always use https these days $file = $event->return; if('url' == $event->method) { $file = $config->paths->root . substr($file, strlen($config->urls->root)); // convert url to disk path } if(!file_exists($file)) { // download file from source if it doesn't exist here, but exist on source $src = $remoteHost . '/site/assets/files/'; $url = str_replace($config->paths->files, $src, $file); $http = new WireHttp(); if($config->Remote2LocalBasicAuth) { // optionally use basic auth with credentials from config.php $http->setHeader('Authorization', 'Basic '.base64_encode($config->Remote2LocalBasicAuth)); } // check if file exist on remote host $http->head($url, [], ['use'=>'curl']); if('404' != substr($http->getHttpCode($url), 0, 3)) { // file is available if($config->Remote2LocalBasicAuth) { $http->setHeader('Authorization', 'Basic '.base64_encode($config->Remote2LocalBasicAuth)); } $res = $http->download($url, $file, ['use'=>'curl']); } else { // file is missing, log it $event->wire('log')->save('remoteFetch404', $url); } } } // use assets from remote host on demand for local development copies
  13. Hi, here is some code written in the browser that may do it. You should doublecheck if your $file variable is the right file basename! $p = $pages->get($album); // get the page $p->of(false); $p->images->trackChange('description'); // prepare page to keep track for changes $selectedImage = $p->images->getFile($fileBasename); // Get the Pagefile having the given !basename!, or null if not found. $selectedImage->description = "Test description"; // set new description $p->save('images'); // save the page $p->of(true);
  14. AFAIK, you can't uninstall any Filetype module that is in use. My experience is that I have to drop the fields out of all templates before I'm able to uninstall field-modules. And this makes sence. :-)
  15. There is currently no support for webp with CAI3 master. There (only) is a different branch with webp support on github. But I haven't got any feedback about it, so it shouldn't be called "production ready". 5 months ago, I locally started a complete rewrite of CAI3 to only use native core images support. But I get distracted from it. If I remember right, I have included it in one client project that is live since september. But not sure how stable it is. If you have some time for testing and you like, I send you my current version of CAI4. (?)
  16. Hi @astock, ok. I think then something is not working as expected, and I cannot help any further here, as I never used this module. Maybe we can ping @Soma, or we need the help of someone who already used this. What is the PW version you are using?
  17. Hi @astock, welcome to the PW forums. I haven't used this module myself, but looking at the code I think you need to configure it not to check by cookies | IP | UserAgent, but by user! Then there is a public function that you may query in your template file(s) before you display a poll form: https://github.com/somatonic/Pollino/blob/master/Pollino.module.php#L460 Can you check that you have configured all right for using users? Can you test if the above mentioned method is of any help in your case, or at least shed some light? As far as I understand this, after the first vote of a loggedin user, this method should return that he already has voted. If this doesn't help to bring you further, please come back again here. :-)
  18. Hi @elabx. Maybe it's an option to find another developer to fill in for Joshuaq? If you are a team again and not alone, maybe this will result in fresh energy? Also, if you later will release it as paid module, you may be able to follow Jens suggestion, once to block some time only for its development (to get more focused). So, not easy tasks nor easy decisions. But worth to think it over. ?
  19. Hi @LAPS, current implementation only allows one signature, set in the config screen. The option only defines when it should be send: never everytime or defined via API. Maybe it would be a nice addition to have a API method to pass in different signatures.
  20. Hi @ak1001, many thanks for your investigations. Please can you provide me with some informations, so that I can test it locally here, and try to update the ___isVariation stuff to fit with recent PW versions? (When pim was build, we don't have had imge-rendering-engines and the image structures as it is today. We only have had the imagesizer.php and the pageimage.php, where I copy pasted that method from.) Which version of PW are you using: Do you use Pim1 or Pim2: Which module version of Pim: What is the exact full URL of the image(s) in question:
  21. Hi and welcome @uncle_bobson. A good start is to look into the DOCS section of this website, maybe starting with a tutorial or the "Getting started" part. (Depends on your skills and knowledge). Reading a bit about and deciding for a "output strategie" may help to. Also you can download the latest PW and play around a bit with the included different site profiles. If you have additional or specific questions after that, please post and ask here again. :-)
  22. Hi @JC_G it can be and in most times it is that simple. Only thing I spotted is the version 2.5.7. I remember that there were some changes in regard of image (naming) processing around 2.5.11. So it can be a good additional check to look if there are some image related inputfieldtypes in use. (Check the modules - site screen, and if you find something like thumbnail- or croppable-image modules, please post there names here and I may provide some tipps or links, if necessary). But you also just can install it in a testversion on the new server, upgrade Processwire core to the latest stable and test and look if everything is working as expected.
  23. Hi, I found this: https://processwire.com/api/ref/pagefile-extra/url/ Can you test it with passing a boolean false in the method call: webp->url(false)
  24. Hi @eutervogel, I believe it has to do with a automatic optimization that Ryan has build into the webp->url method. Given that webp is used to get smaller filesizes, and that sometimes a png or jpeg can be smaller than its webp pendant, the smaller one of them is put out by the webp->url. In general a nice idea, but only when one output a single src url in an img tag. For the more advanced usage in picture or srcset elements it is wrong and also irritating the devs. If I remember right, there must be a config setting to disable this. If I find it, I post it here. If someone else reading this and knows where it is and how it is named, please shime in!
×
×
  • Create New...