-
Posts
15 -
Joined
-
Last visited
Recent Profile Visitors
1,286 profile views
Pravin's Achievements
Jr. Member (3/6)
1
Reputation
-
want to show data from Form fields in XML document
Pravin replied to Pravin's topic in API & Templates
Thanks a lot @flydev.. But I have multiple forms so how do I select a particular form from the many? -
want to show data from Form fields in XML document
Pravin replied to Pravin's topic in API & Templates
@flydev 1. so using the form-upload.php file i can have the desired form-fields and later upload it in a template. 2. Can I use the form entries saved to create xml file -
@Marcel Epp so did you use the file-upload.php to upload the form details into xml file? and where do i have to invoke the create xml code snippet at ?
-
Pravin started following Christophe
-
delete orphaned files/images from site/assets/files
Pravin replied to interrobang's topic in General Support
clean-file.php this is the code <pre> <?php namespace Processwire; ini_set('max_execution_time', 1200); // 5 minutes, increase as needed include("./index.php"); $dir = new DirectoryIterator(wire('config')->paths->files); foreach($dir as $file) { if($file->isDot() || !$file->isDir()) continue; $id = $file->getFilename(); if(!ctype_digit("$id")) continue; $page = wire('pages')->get((int) $id); if(!$page->id) { echo "Orphaned directory: " . wire('config')->urls->files . "$id/" . $file->getBasename() . "\n"; continue; } // determine which files are valid for the page $valid = array(); foreach($page->template->fieldgroup as $field) { if($field->type instanceof FieldtypeFile) { foreach($page->get($field->name) as $file) { $valid[] = $file->basename; if($field->type instanceof FieldtypeImage) { foreach($file->getVariations() as $f) { $valid[] = $f->basename; } } } } } // now find all the files present on the page // identify those that are not part of our $valid array $d = new DirectoryIterator($page->filesManager->path); foreach($d as $f) { if($f->isDot() || !$f->isFile()) continue; if(!in_array($f->getFilename(), $valid)) { echo "Orphaned file: " . wire('config')->urls->files . "$id/" . $f->getBasename() . "\n"; // unlink($f->getPathname()); } } wire('pages')->uncache($page); // just in case we need the memory } ?> </pre> -
delete orphaned files/images from site/assets/files
Pravin replied to interrobang's topic in General Support
Why is it throwing out the following error? -
want to show data from Form fields in XML document
Pravin replied to Pravin's topic in API & Templates
@Robin S do you have any suggestions regarding this issue? -
Thanks a lot @Robin S
- 8 replies
-
- 1
-
- image quality
- images
-
(and 2 more)
Tagged with:
-
I need all the images on my site to be optimised so should i set it in the config file with 'forceNew'=> true or is there any alternate solution for the same @Robin S..
- 8 replies
-
- image quality
- images
-
(and 2 more)
Tagged with:
-
Thanks a lot @Robin S for your feedback. So all I have to do is add 'forceNew' => true in the array right
- 8 replies
-
- image quality
- images
-
(and 2 more)
Tagged with:
-
Yeah missed my cup of coffee so the things got messy a bit @szabesz..
- 8 replies
-
- image quality
- images
-
(and 2 more)
Tagged with:
-
How to set the image quality as per desired.. I tried using the above code but I get the original image size.. <!--Content with Image left--> <?php $i = 2; foreach($page->page_content as $each) { if( $i%2 == 0 ){ ?> <section class="imageblock about-1"> <div class="imageblock__content col-md-6 col-sm-4 pos-left animated fadeInLeft"> <div class="background-image-holder"> <?php $option1 = array( 'quality' => 60, 'upscaling' => true, 'cropping' => true, ); $pravin= $each->single_image->size(790,650,$option1); ?> <img alt="image" src="<?php echo $pravin->url; ?>" /> </div> </div> <div class="container container-body"> <div class="row"> <div class="col-md-5 col-md-push-7 col-sm-8 col-sm-push-4 animated fadeInUp"> <?php echo $each->body; ?> </div> </div> <!--end of row--> </div> <!--end of container--> </section> <!--Content with Image on left--> <?php } else { ?> <!--Content with Image on right--> <section class="imageblock about-1"> <div class="imageblock__content col-md-6 col-sm-4 pos-right animated fadeInRight"> <div class="background-image-holder"> <?php $pravin= $each->single_image->size(790,650,$option1); ?> <img alt="image" src="<?php echo $pravin->url; ?>" /> </div> </div> <div class="container container-body"> <div class="row"> <div class="col-md-5 col-sm-8 animated fadeInUp"> <?php echo $each->body; ?> </div> </div> <!--end of row--> </div> <!--end of container--> </section> <?php } ++$i; } ?> <!--Content with Image on right-->
- 8 replies
-
- image quality
- images
-
(and 2 more)
Tagged with:
-
<!--Content with Image left--> <?php $i = 2; foreach($page->page_content as $each) { if( $i%2 == 0 ){ ?> <section class="imageblock about-1"> <div class="imageblock__content col-md-6 col-sm-4 pos-left animated fadeInLeft"> <div class="background-image-holder"> <?php $option1 = array( 'quality' => 60, 'upscaling' => true, 'cropping' => true, ); $pravin= $each->single_image->size(790,650,$option1); ?> <img alt="image" src="<?php echo $pravin->url; ?>" /> </div> </div> <div class="container container-body"> <div class="row"> <div class="col-md-5 col-md-push-7 col-sm-8 col-sm-push-4 animated fadeInUp"> <?php echo $each->body; ?> </div> </div> <!--end of row--> </div> <!--end of container--> </section> <!--Content with Image on left--> <?php } else { ?> <!--Content with Image on right--> <section class="imageblock about-1"> <div class="imageblock__content col-md-6 col-sm-4 pos-right animated fadeInRight"> <div class="background-image-holder"> <?php $pravin= $each->single_image->size(790,650,$option1); ?> <img alt="image" src="<?php echo $pravin->url; ?>" /> </div> </div> <div class="container container-body"> <div class="row"> <div class="col-md-5 col-sm-8 animated fadeInUp"> <?php echo $each->body; ?> </div> </div> <!--end of row--> </div> <!--end of container--> </section> <?php } ++$i; } ?> <!--Content with Image on right--> How to set the image quality as per desired.. I tried using the above code but I get the original image size..
-
- images
- imagesizeroptions
-
(and 2 more)
Tagged with:
-
I want the data inserted in the forms to be fetched into a XML document is it possible or any other alternate options to do the same
-
I have issues regarding responsive images. I have used Markup srcset for images but the problem is I am not able to call the images added in repeater field as well as Multiple image field.. My code <?php $i = 2; foreach($page->page_content as $each) { if( $i%2 == 0 ){ ?> <section class="imageblock about-1"> <div class="imageblock__content col-md-6 col-sm-4 pos-left"> <div class="background-image-holder"> <img alt="image" src=" '<?php echo $each->single_image->srcset('mode07');?>' "/> </div> </div> <div class="container container-body"> <div class="row"> <div class="col-md-5 col-md-push-7 col-sm-8 col-sm-push-4"> <?php echo $each->body; ?> </div> </div> <!--end of row--> </div> <!--end of container--> </section>
-
Hey I'm pretty new to Processwire.. I need to have responsive images and using the Markup Srcset so could anyone brush up on how to use it and about Breakpoints and Image sets JSON array thing..