Jump to content

Search the Community

Showing results for tags 'api'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to ProcessWire
    • News & Announcements
    • Showcase
    • Wishlist & Roadmap
  • Community Support
    • Getting Started
    • Tutorials
    • FAQs
    • General Support
    • API & Templates
    • Modules/Plugins
    • Themes and Profiles
    • Multi-Language Support
    • Security
    • Jobs
  • Off Topic
    • Pub
    • Dev Talk

Product Groups

  • Form Builder
  • ProFields
  • ProCache
  • ProMailer
  • Login Register Pro
  • ProDrafts
  • ListerPro
  • ProDevTools
  • Likes
  • Custom Development

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

  1. Hi, On a project I'm working on I have a select options field that you can select what type of content you're posting. It has the following options: 1=Article 2=Q and A 3=Visual snippet 4=Gallery 5=List The assigned template has an icon (file-text-o), which is great for articles but maybe not so for galleries. Is it at all feasible/possible to change the assigned icon based on a field value within a page? Or even append a page title in the tree with an icon based on a field value?
  2. Hello, i try to write an Import Script. Some basic skills i've learned from different postst. But its not really enough so i try to start a new Topic. I have an zip file with xml and images inside. The different objects have three different actions "ADD | CHANGE | DELETE" so the Idea is at the ADD Action to check is the page ID I use for the ID the Object Number alredy exist. If not create page if the Change Action than check if ID exist grab this Page and write new values if Delete Action then Grab this ID if exist and change Parent. IMPORTANT: After all I have to delete the Zip file and all the TEMP Files. How to handle in the right way temporary fils with processwire ? Maybe i dont need the external extract Script ? This is my current CODE: <?php $userRolesSelector = 'superuser'; // bootstrap ProcessWire. Update the path in the include if this script is not in the same dir include("./index.php"); if( ! wire('user')->hasRole($userRolesSelector)) { header('HTTP/1.1 403 Forbidden'); exit(1); } include "import/op_file.php"; // Different functions to handle the zip file EXTRACT Read etc.... // here some (pseudo/example)code set_time_limit( intval(60 * 5) ); // give it 10 minutes, you may also increase this echo "<pre>"; readXML(); exit; //******************************************** /** ----------------------------------------------------------------- * @desc Finde XML/ZIP, entpacken und einlesen der daten */ function readXML() { $opfile = new OPfile(); // dbg is a wrapper for "echo", so you can ignore it via one Flag in op_tools echo "DOC ROOT: ".$_SERVER['DOCUMENT_ROOT']; // Set your path here ... $ropa=dirname($opfile->GetTheRoot())."/"; //opfile $ropa=$ropa . "demo/"; echo "ROOT: ".$ropa; $modpa=$ropa; $projpa=$ropa; $origfolderfrom=$ropa."import/ftpin/"; $ftptemp=$ropa."import/temp/"; $folderfrom=$origfolderfrom; // Find the ZIP/XML File in the FTP Folder // $fileinfo will be used by following functions. you can add more information if needed $fileinfo= $opfile ->GetUpload($origfolderfrom ); // return = assoc-array $fileinfo ['temp']=$ftptemp; $fileinfo ['folder']=$origfolderfrom ; // Extract or Copy the Files, so we can prozess the xml info if ($fileinfo['type'] =='zip') { // if it is ZIP , extract it to temp $xmlfilename= $opfile ->ExtractZIP($fileinfo); echo "<p> XML ist:".$xmlfilename."</p>"; echo "<p>Kopiere: " .$fileinfo ['folder'].$xmlfilename ." <br> nach: ". $ftptemp.$xmlfilename."</p>"; }else{ // if it is XML copy it to temp $xmlfilename = $fileinfo['file']; copy ($fileinfo ['folder'].$xmlfilename , $ftptemp.$xmlfilename); echo "<p>Kopiere: " .$fileinfo ['folder'].$xmlfilename ." nach: ". $ftptemp.$xmlfilename."</p>"; }//if // XML File from temp folder $stat = $opfile ->LoadXML($ftptemp.$xmlfilename); $path = $ftptemp.$xmlfilename; if (file_exists($path)) { $xml = simplexml_load_file($path); echo "<p>Erfolgreich geladen <br></p>"; $nodeList = $xml->xpath('//immobilie'); } // you can access the XML Object by: $opfile ->XMLdata; if ($stat == true) { // read basic infos form XML File $xinfo= $opfile->decodeUTF8($opfile ->XMLinfo()); // print_r($xinfo); echo "Objekte im Import: ".$xinfo['anzimmo']."<br >"; echo "Anbieter ID: ".$xinfo['anbieterid']."<br >"; }else { // Error in Processing. Stop the run. $xinfo['anzanbieter'] =0 ; $xinfo['anzimmo'] =0; echo "Fehler In der XML Datei"; // exit can be put away. The For Loop does not run with azi=0 exit; }//if $azi=intval($xinfo['anzimmo']); // get the number of Objects in archive // save our start time, so we can find which pages should be removed $started = time(); // keep track of how many changes we've made so we can report at the end $numChanged = 0; $numAdded = 0; $numTrashed = 0; // the parent page of our items: /about/what/ is a page from the basic profile // update this to be whatever parent you want it to populate... $parent = wire('pages')->get('/about/'); if(!$parent->id) throw new WireException("Parent page does not exist"); for ($ni=1; $ni<=$azi;) { //$xinfo['anzimmo'] echo "<h2>=======Object=".$ni."======</h2>"; $idata = $opfile->GetOneImmo( $ni, $xinfo); // $idata stores all the values in the Array for current Object $action=$idata['verwaltung_techn'] ['aktion']['aktionart']; if ($action =='') { $action="ADD"; }//if $page = wire('pages')->get($idata['verwaltung_techn']['objektnr_extern']); if($action == 'ADD') { if(!$page->id) { $page = new Page(); $page->parent = $parent; $page->template = 'immo'; // template new pages should use $page->name = $idata['freitexte']['objekttitel']; echo "Adding new page:".$idata['verwaltung_techn']['objektnr_extern']." Titel ".$idata['freitexte']['objekttitel']." <br>"; $numAdded++; } // print_r($idata); // now populate our page fields from data in the feed $page->of(false); // ensure output formatting is off $page->title = $idata['freitexte']['objekttitel']; $page->summary = $idata['freitexte']['dreizeiler']; $body = "<h2>".$idata['freitexte']['dreizeiler']."</h2>"; $page->body = $body; } if($action == 'CHANGE') { echo "CHANGE"; if(!$page->id) { $page = new Page(); $page->parent = $parent; $page->template = 'immo'; // template new pages should use $page->name = $idata['freitexte']['objekttitel']; echo "<h2>Change page data:</h2>".$idata['verwaltung_techn']['objektnr_extern']." Titel ".$idata['freitexte']['objekttitel']." <br><br>"; $numChanged++; } } if($action == 'DELETE') { echo "DELETE"; $numTrashed++; foreach($changes as $change) echo "\nUpdated '$change' on page: $page->name"; } $ni++; }//for Object echo "\n\n$numAdded page(s) were added"; echo "\n$numChanged page(s) were changed"; echo "\n$numTrashed page(s) were trashed\n"; }//funktion ?>
  3. Hello everyone, greetings from Belo Horizonte / Brazil. I'm on the process of converting a site from WP to Processwire, this one: http://www.ricardo-vargas.com I needed a simple Flickr Gallery and tried to find a way to create album pages via API and download the images to the local filesystem (just a few, for cache purposes). So I created yesterday a simple script that, given an album ID, download its data using cURL and save the photos to a temp dir. After that, add them to a new page under /pictures/ Feel free to comment on the code, I'm a designer, not a developer, and this is my first time using PW API You can grab it on GitHub: https://github.com/sjardim/processwire-simple-flickr-album Instructions Download the files Put the templates/get_flickr_sets.php on your templates/ folder. Create a page on Processwire using this template Create or edit the page where the albums will be created. In my case it was /pictures/ IMPORTANT: Add guest edit/create permissions to this /pictures/ page, otherwise the script won't work Create a temp dir on your server and set it on the previous file Get a Flickr API on https://www.flickr.com/services/apps/create/ Add one or more Flickr album IDs on get_flickr_sets.php Open the page using the get_flickr_sets.php template on your browser <?php include "../lib/curl.class.php"; // You will need to get a Flick API Key // Get it here: https://www.flickr.com/services/apps/create/ // Load it on the file below include "../lib/flickr_album_utils.php"; function download_file($url) { // Save the image on local filesystem (You need to create this folder first) // On your server it can be /var/www/name_of_folder/ $tempdir = '/Users/XXX/phpFlickrCache/'; $fp = $tempdir . basename(parse_url($url, PHP_URL_PATH)); // if we already downloaded the images for some reason (like testing), just return it if (!file_exists($fp)) { $fh = fopen($fp, 'wb'); $curl = curl_init($url); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_BINARYTRANSFER, 1); curl_setopt($curl, CURLOPT_FILE, $fh); curl_exec($curl); curl_close($curl); fclose($fh); } return $fp; } // Get some public album id to test $albumID = ["72157636029541784"]; //$albumID = ["72157649576832173", "72157633296236495", "72157644132091553", "72157636029541784"]; // Load ProcessWire API $pages = wire('pages')->get('/pictures/'); /* -------------------------- GET ALBUM INFO FROM FLICKR -------------------------- */ foreach($albumID as $album) { // Via GET, return album and its photos info $album = fa_get_album($album); // create a new post $page = new Page(); $page->template = 'picture_album'; $page->parent = $pages; // disable page output formatting $page->of(false); $page->name = wire('sanitizer')->pageName($album['title'], true); $page->flickr_album_id = $album['id']; $page->title = $album['title']; $page->generic_integer = $album['total']; //total number of photos on flickr album – OPTIONAL //My client albums descriptions have two phrases, one in English and other in Portuguese // let's separate then by the period, but sometimes there is no period, so the PT description will remain blank $description = explode('.', $album['description']); $en = $languages->get("default"); $page->summary->setLanguageValue($en, $description[0]); $pt = $languages->get("portuguese"); $page->summary->setLanguageValue($pt, $description[1]); $page->set("status$pt", 1); //activate portuguese page $page->save(); // We need to save the page BEFORE adding images /* ------------------------------------ DOWNLOAD AND SAVE IMAGES FROM FLICKR ------------------------------------ */ $images = array(); $i=1; $maxImages = 11; foreach($album["all_images"] as $f) { //we do not want all the photos, just a little bit if ($i >= $maxImages) break; // mount the flickr photo url using its attributes $photo_url = 'https://farm'.$f["farm"].'.staticflickr.com/'.$f["server"].'/'.$f["id"].'_'.$f["secret"].'_b.jpg'; // download and return the image file in the filesystem $images[$album['id']][$i] = download_file($photo_url); // add images to the current page in the loop $page->images->add($images[$album['id']][$i]); $i++; } $page->save(); echo "<p>Created page for album: <strong>".$album['title']. "</strong></p>"; // Tip: Now, after we saved the images to ProcessWire /site/assets/files/, we can safely delete them from the $tempdir if needed } print "<pre>"; print_r($images); print "</pre>"; Admin Screenshot
  4. I created fieldtype "select" for template (0:=Prepared, 1:=Done) And need to make for list of pages with this template value for this fieldtype to "1" from. There are to many pages to do it manualy. How to make it?
  5. wireshell 1.0.0 is out See Bea's post -------- Original post ----------- Now this one could be a rather long post about only an experimental niche tool, but maybe a helpful one for some, so stay with me Intention Do you guys know "Artisan" (Laravel) or "Drush" (Drupal)? If not: These are command line companions for said systems, and very useful for running certain (e.g. maintenance, installation) task quickly - without having to use the Admin Interface, first and foremost when dealing with local ProcessWire installations. And since it has a powerful API and an easy way of being bootstrapped into CLIs like this, I think such a tool has a certain potential in the PW universe. It's totally not the first approach of this kind. But: this one should be easily extendable - and is based on PHP (specifically: the Console component of the Symfony Framework). Every command is tidily wrapped in its own class, dependencies are clearly visible, and so on. ( Here was the outdated documentation. Please visit wireshell.pw for the current one )
  6. Hi, I'am at a loss ... I was absolutely certain that something like $wireData->has('key=value') or $wireData->is('key=value') existed. But it does not. has only takes a key name not a selector, and is does not exist on WireData. Is there another WireData method I am missing to accomplish this? I know there are simpler ways to get if a field has a certain value, but I need it as a selector string. Thanks!
  7. How can I get the index type of a mysql database table with pw-api? The Following doesn't work. Why? $table = 'pages'; $column = 'pages_id'; $sql1 = $db->query("SELECT DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = '$table' AND COLUMN_NAME = '$column'"); $options = array(); while ($row = $sql1->fetch_array()) $options[] = $row; var_dump($options); // return empty array
  8. Is there any way (module?) to execute basic api commands from inside the PW admin? For example, say I wanted to do a (one-off) something like set a field value to "this is a default value" for all pages with a specified template; What I do presently is temporarily add some code to a template file and then browse to a page which uses that template; Then once the commands are run I delete the code from the template..... $p = $pages->get("template=test"); $p->of(false); $p->set( 'fieldx', 'this is a default value' ); $p->save(); The PW API is so good, so coupling it with such a cumbersome method to achieve a simple pages update seems dodgy. Am I missing something? I find myself doing this type of thing quite often, so how does a real PW geek (as opposed to a wannabe PW geek ;-)) achieve the above?
  9. Hi everyone, I have a problem using the processwire api in my own system. I use it to configure some special pages (texts, images and so on). Everything is working fine so far. Except when I'm doing a POST-Request (a search for example). The request has nothing to do with processwire. As soon as I do a POST-Request I'm getting the following error-message: Fatal error: Call to undefined method Session::addHookAfter() in MY_PROCESSWIRE_PATH\wire\modules\Session\SessionLoginThrottle\SessionLoginThrottle.module on line 50 Error: Call to undefined method Session::addHookAfter() (line 50 of MY_PROCESSWIRE_PATH\wire\modules\Session\SessionLoginThrottle\SessionLoginThrottle.module) This error message was shown because site is in debug mode ($config->debug = true; in /site/config.php). Error has been logged. Here is my desperate attempt to workaround the problem //dirty workaround ahead $postData = $_POST; //save post data $_POST = array(); //clear $_POST include("../../processwire/index.php"); //include doesn't throw error $_POST = $postData; //write it back So what's the reason for the problem? Thanks in advance!
  10. Hi all. I have pages (templates) that are only accessible to certain users. Now I need to get all users that have view access to specific pages (they will get email when page updates). I thought of something like this: $template = wire('templates')->get($p->template); $roles = $template->getRoles(); $users = wire('pages')->find('template=user, roles=' . $roles); But it looks like getRoles() doesn't returns the roles for that template. Roles is an empty PageArray. What is wrong or is there another way to get those users?
  11. Hi Guys, I am working on a project for a startup company. I will be building a portal for users to access company related information. I am required to connect the portal to an LMS which is a learning management system. I am looking to hire someone to assist with the SSO since I have a lot of work already with the portal. The portal will be built on ProcessWire and require user management. Please message me if you are interested in helping out. I would like to get some quotes before the weekend is over. Looking to start ASAP on this project. Let me know if you have any questions. Also note, once we have the SSO out of the way, more work may arise from this project, since our timeline is somewhat short. Thanks!
  12. Hello, I remember recently using processwire's built-in json API in one of the dev builds. I can't seem to find any kind of documentation of that now. Since I switched my machine, I can't even find that code again.(I've been searching for hours) Can anyone please point me or provide me any clue about the above said json api? It worked something like this: If you need to find any pages using template basic-page, you can get it as follows: http://example.com/processwire/?template=basic-page hit above and it'll return the json output. Thanks.
  13. Hello PW'ers, I'm a PW newbie and my first post in this forum. In the last years i was a 'hardcore' Drupal user, but i'm confused about the 'bloated' code. Make your own Drupal-theme is a hell. A few days ago I find PW. My first impression, HOW WORKS THIS??? Reading many posts in this forum, and a lot of searching on the net for good simple tutorials to understand PW. Today follow a first 'beginner' tutorial, finding in Docs of the PW-site. Wauw!! Thats an amazing CMS/CMF. I searching for a tutorial how make a select/dropdown/tag-list (similar as 'Taxonomies' in Drupal) and find it: http://wiki.processwire.com/index.php/Page_Field I try it succesfully. Ok, I have a question: I found a good tutorial in this forum how make a simple form (thanks @soma!). But how know with options a module have? Example: $field = $modules->get("InputfieldText"); $field->label = "Name"; $field->attr('id+name','name'); $field->required = 1; $form->append($field); In the above code, i see a label, attr, required But how can I know with options are available for a module? PS: Sorry for my bad english Regards, Christophe
  14. I really wanted to create this post with some sample code to show that I at least tried to figure it out on my own first, but I'm really struggling with how hooks are even written. I know it's a very simple context for anyone who's already using them (and hopefully it will be for me, soon), but this is my first time. What I'm trying to achieve in this attempt is to verify/change the name and title fields of a page, of one specific template with one specific field, whenever the page is saved. Initially, I am using the Family / Name Format for Children to skip the name/title/confirm save page when an author creates a new page in my site using kongondo's ProcessBlog module. In English, I want to: Detect when a page of template blog_page is saved with the blog_categories field value of Swatch, and replace the title and name string with a concatenated version of the following fields (from the same page): blog_date, createdUser, blog_brand and blog_name. From what I've read so far, I should build this hook into site/templates/admin.php, and I should use the saveReady() and maybe saveField() hooks. Other than knowing I need to define a custom hook, I really haven't got any idea of where to go from here. Here's my mangled first attempt at coding my hook. Hopefully you'll be able to tell how I might be misunderstanding this from the following: $pages->addHookAfter('saveReady', $this, 'myPageRename); public function myPageRename($event) { } I'm afraid that's really as far as I've gotten because I have no idea what I'm doing. I try to follow examples but they feel really far removed from context for me. Thanks for any light that can be shed on this!
  15. public function init() { // add a hook after each page is saved $this->pages->addHookAfter('saved', $this, 'populateDefaults'); } /** * Populates model defaults after save for corresponding blank fields. * */ public function populateDefaults($event) { $page = $event->arguments('page'); if($page->template != 'vessel') return; //$this->message("hi {$page->model->hulls}"); if($page->model && !$page->hulls && $page->model->hulls) { $page->set("hulls", $page->model->hulls); $this->message("hi $page->hulls {$page->model->hulls}"); } } This sort of works; the message echoed is "hi 1082 1082". When I set the hulls to null in the above code, it then goes back to "hi 1082". However, it doesn't update the select input in the edit screen, and the "Missing required value" error for that field remains... Also the message shouldn't even be showing if $page->hulls is set... How can I get it to update the field value and the input?
  16. I have a page field 'make', which consists of manufacturer template pages. A new page can be created from that field, but I currently have that functionality disabled, since following that field is another page field 'model' with a custom selector, 'parent=page.make, template=model'. So since the model field parent is dynamic, new pages cannot be created from the field, as the first requirement for that feature is that a single parent and template be pre-selected... Is there some way I can hook into the options there and add an 'Add New' option at the bottom, opening up the new model in a modal? Thanks.
  17. I want to make a little module that tracks pageviews. This is my first module. I'm starting with a copy of helloworld.module. I already created the template pageviews and pageview manually, but I'll add their creation into the module later. Here's what I have: public function viewTracker($event) { $page = $event->object; // don't add this to the admin pages if($page->template == 'admin') return; if($page->template == 'vessel') { $r = new Page(); $r->template = 'pageview'; $r->parent = wire('pages')->get('/viewtracker/'); $r->user = $user->name; $r->vessel_id = $page->id; $r->name = $user->id . $page->id . date('YmdHisu'); //$r->status = $r->status | Page::statusLocked; $r->save(); } // add a "Hello World" paragraph right before the closing body tag $event->return = str_replace("</body>", "<p>Hello $user World!</p></body>", $event->return); } but the $user variable isn't coming through. How can I access the logged in $user? Edit: Got it. Replaced the $user with $this->user..... public function viewTracker($event) { $page = $event->object; // don't add this to the admin pages if($page->template == 'admin') return; if($page->template == 'vessel') { $r = new Page(); $r->template = 'pageview'; $r->parent = wire('pages')->get('/viewtracker/'); $r->user = $this->user; $r->vessel_id = $page; $r->name = $this->user . $page . date('YmdHisu'); $r->status = $r->status | Page::statusHidden; $r->save(); } }
  18. User input should be sanitized... If I use CKEditor at PW admin to change a field value it should be sanitized by CKEditor Advanced Content Filter (ACF) and HTML Purifier (activated at CKEditor Settings). At the moment I play with frontend edit solutions. Frontend form (based on form api and PW inputfields) with a custom save process (set and save field value with PW api) Inline edit (jquery plugins jEditable, x-editable, jinplace) and a custom save process (see above) So the values not saved by the PW admin / backend process and would be saved without sanitizing in both ways above... right?
  19. Hi Guys, So I am working on a project and wanted to get the best advice using the api on the next step. I have two image fields in one template. postimage which holds an image for the article and postimage2 which holds an image for the home page. Basically I want to make it so that when a user uploads postimage and not postimage2 the home page will just pickup postimage instead. If the user does upload postimage2, it should pick up postimage2. What I did: I did add a conditional statement to check if postimage2 was empty to simply default to postimage but I was not seeing any images display. Here is my code: <?php foreach($featured as $featuredp){ foreach($featuredp->postimage2 as $postimages2) { echo"<div class=\"row panel\" style=\"margin:20px auto;\">"; echo"<div class=\"large-4 columns\"><p> <a href='{$featuredp->url}'><img src='{$postimages2->url}' width=\"300\"/></a></p></div>"; echo"<div class=\"large-8 columns\"> <h4>{$featuredp->title}</h4> <p><em>{$featuredp->date}</em></p> <p>{$featuredp->summary}</p> <p><a href=\"{$featuredp->url}\" class=\"button tiny radius\">Read More</a></p> </div> </div>"; $found = 1; } } if ( ! $found ) { echo"<p>Sorry, no posts.</p>"; } ?> Any advice is appreciated? Also any suggestions or workarounds are also welcome!
  20. Hi Guys, I have created a slider using Bootstrap and in Bootstrap the slider image that is first in line is required to have the class active. In creating a repeater for my client to add images, I need to add a conditional statement to check if the item is first in the repeated elements and if it indeed is first, assign active as the class. Not sure what is best practice using a selector and the api to see if the the repeated element is first in the repeater list. Any light? Thanks guys!
  21. To get a page by index number from a PageArray is easy: /* returns a page object */ $pagebyindex = $myparentpage->children->eq(integer $num); Now I needed a function which returns the Index of the page from the siblings. It took me a while to figure this out, and I like to share this here: /* returns an integer */ $indexbypage = $myparentpage->children->getItemKey($page); // or $indexbypage = $page->siblings->getItemKey($page); Found this information in http://cheatsheet.processwire.com/ under section PageArray/WireArray and here: http://processwire.com/apigen/ To get complete information about API this page is your (and my) friend. Have a nice day
  22. Currently to change the 'summary' description in context of 'basic-page' we would have to do this: // get the template $t = $templates->get('basic-page'); // get the field in context of this template $f = $t->fieldgroup->getField('summary', $useFieldgroupContext = true); // value of the field $f->description = "'basic-page' summary description"; // save new setting in context $fields->saveFieldgroupContext($f, $t->fieldgroup); What I'd like is something like this // get the field $f = $fields->get('summary'); // value of the field $f->set('description', "'basic-page' summary description", $context = 'basic-page'); // save new setting, perhaps optional, because behind // the scenes `saveFieldgroupContext` has been called already? $f->save(); Similar for getting in context: $f->get('description', $context = 'basic-page'); Not only is it more intuitive, but less verbose, in my opinion. What do you think?
  23. I'm developing a site for a client which involves (non-logged in) users submitting resources which other anonymous users can then view or download. The final downloadable resources will be produced by my client from files and text (up to 10 files - pdfs, spreadsheets, images etc) uploaded by the user. So the flow goes something like this: User submits a frontend form containing a description of the resource, eg typical resource may be "Study of sustainability of commercial fishing in area X", along with a number of files, for example, shaded maps (image), spreadsheet of data, word or open document of evidence, and a number of other images. Files and text descriptions are emailed to my client Client reads through and organises the files and text into one or more PDFs. Client creates a new PW page, adds a description of resource, and uploads PDF(s) to the page Users then view the PW page and can download or view the accompanying PDFs Pretty simple kind of scenario. However, I'm conflicted as to how the upload/emailing of images should proceed; I could either: email the uploaded resources (up to 10 of) direct to the client, or use the API to create a PW page, add the uploaded resources to the page, save page, email resources from the page to the client, and then finally delete the page. Option 1 is simple, but there may be issues? - email failure would result in loss of the resources - large email (10 attachments of up to possibly 5Mb each) could be seen as spam? etc. Option 2 is a little more complex but allows resources to be maintained - in case of email failure resources could be downloaded manually I'm looking for suggestions here, which option would you choose to implement, or an alternative path altogether?
  24. What is the difference between $a->add($item) and $a->append($item)? I know there are some speed improvements in 2.5.x (comparing to 2.4) but is there room for more? I'm using caching in templates, I can not use ProCache. Looking at timers in debug mode I see: boot: 0.2262 boot.load: 0.1925 boot.load.fieldgroups: 0.0506 What is going on between loading fieldgroups and load?
  25. I would like to create sets of custom fields that can be added using the API to sites as I need them. For example, if one of my clients has an existing site developed in ProcessWire and needs a blog added, I would like to use the API to add a set of custom fields specific to a blog. As another example, I may need to add a set of custom fields for social media links. Unfortunately, I can't seem to find a resource that lists every property needed for each field type. How do I know which properties to set? Or is there a way to output fields and properties for an existing installation of ProcessWire?
×
×
  • Create New...