Leaderboard
Popular Content
Showing content with the highest reputation on 01/08/2017 in all areas
-
v0.0.2 released - a complete overhaul of the module. Custom Inputfield Dependencies now does the same thing but in a completely different way (thanks to a great idea from @adrian) The module no longer requires Hanna Code and inputfield dependencies are now set on the "Input" tab of "Edit Field". See the first post for all the details. If you are using v0.0.1 of the module then this is a breaking change and you will need to redefine your dependencies (sorry ). But the new approach taken in v0.0.2 is so much better that hopefully you'll find the change worthwhile.5 points
-
You maybe need to replace 'admin' with the name of your superuser, if it is not 'admin'. If your 'superuser' is 'admin' check in the database if a page (user) named 'admin' exist and if the correct parent (29) is assigned.3 points
-
Hi @Sebastian. Welcome to the forums. The real answer is that these forms were never intended for use in the frontend. Their purpose and design was for backend use only where trade-offs have had to be made between complying with standards versus delivering a usable and highly efficient UI, taking into account the underlying complexities that constitute the PW Admin. Using them in the frontend is just a bonus, but it comes at a 'cost'. You are probably better off using your own forms, or investing in Form Builder or similar.2 points
-
Blog post in Norwegian on setting up https with PW: https://www.asbjornness.no/blogg/https-med-processwire-hos-proisp/2 points
-
When you request $page->url, ProcessWire generates it on the fly, kind of: it's a combination of $config->urls->root and the path of current page. Root URL is defined when the system is started, and $page->path is constructed from the names of parent pages. Similarly $page->httpUrl is a combination of protocol, hostname and $page->url2 points
-
Hi @holmescreek I see you are working with mp3 files. One of my first (learning)-projects with PW was a local Music-DB with importfunctions of ID3-tags into page fields. If this is of interest for you, here you can find some examples and libs: (function to retrieve infos from a mp3 file) https://github.com/horst-n/LocalAudioFiles/blob/master/LocalAudioFilesImportShellScript.php#L108 (the libs that are used in the importer class) https://github.com/horst-n/LocalAudioFiles/tree/master/site-default/modules/LocalAudioFiles (the old project page here in forum) https://processwire.com/talk/topic/3604-release-localaudiofiles-mp3-db/ (a online demo, where you can log in as "myusername" with the buttons top-right, and inspect the Admin, - how pages and sections are sorted with the auto-importer) http://pwlaf.biriba.de/dbinfo/2 points
-
You will have to tell ProcessWire to add that file to the file field and supply an absolute path (I don't think a relative path will work). See @adrian's example here if you want to add multiple files or my example here if adding single file. In my example, the file could also be in a sub-directory and the code will still work (i.e., it's recursive). Here's some code (it's not recursive and it's not namespaced). Note that you will have to first create the page and save, then add the file(s) and save again. Also note this will add all songs in the /temp/ folder to the one page. If you want different songs in different pages we would have to change the logic. // your previous (create page) code here $path = $config->paths->templates . 'temp'; $dir = new DirectoryIterator($path); foreach($dir as $songFile) { if($songFile->isDir() || $songFile->isDot()) continue;// skip system files and directories/folders $mypage->song_mp3_file->add($songFile->getPathname()); unlink($songFile->getPathname());// if you want to delete the mp3 files in the temporary folder } // save the page again $mypage->save('song_mp3_file'); //rmdir($dir);// if you wish to remove the temp directory Untested, but should work2 points
-
Hi kongondo, thanks! That didn't accour to me at all. Makes a lot of sense too, I was working aroung the <button> instead of <input> for form submission already and was wondering why these elements were used insted of the more standard ones I've been working with pw for at least 3 years now (also reading the forums, registered back then etc.) but that somehow never came up. I also appreciated your work on modx extensions in the past btw! Might have a question regarding your dynamic selects module soon ;-)1 point
-
OK, we are getting somewhere. In my previous testing I had one or two issues with comments but was never able to replicate the issue further. I suggest the following: Do a cleanup (but do no uninstall Blog) Make sure you have both Comments field and Schedule Pages modules installed Run Blog install wizard Enjoy your new Blog...hopefully1 point
-
Fixed, thank you kixe. I thought I had to use `admin` as a generic name...1 point
-
1 point
-
Thanks @kongondo - I was PHP was strict on function name case! I think I inadvertently copied the case of $fieldName through to the getPathname() method. Anyway, it's fixed in the latest version - thanks for noticing and pointing it out.1 point
-
I just checked Ryan's most recent commit (https://github.com/processwire/processwire/commit/43986173fb449bf0fb967a0d613896f2e3d6b4da) and the problem is now fixed for 3.0.48.1 point
-
For now, maybe a manual upgrade is what you need, exactly what you are doing. Use this gist to cleanup, via the frontend as follows: Copy the code into a template file Login as superadmin In the frontend, visit a page that uses that template and follow the instructions Revert your template file to what it was before step #1 I suggest you also clear your file compilter. You can then install Blog. There are no changes in the latest version that would stop Blog from installing (compared to the older version). In fact, the newest version was one to make it compatible with PW 3.X. Let us know how it goes.1 point
-
@LostKobrakai just a quick heads-up: your elixir link was broken, so I pointed it to elixir-lang.org. Hope that's the correct destination1 point
-
I've used method 3) before, though I don't consider it a hack at all. That being said, I chose this route mainly because I strongly dislike a) complexity and b) dependencies, and that right there is a straightforward way to get some asynchronous PHP magic up and running in no time. I also didn't have any need to track the return values etc. of started processes, so no real need to keep track of them either; that alone adds quite a bit of complexity, and may be a valid reason to use something like React instead. Anyway, I think @netcarver's solution makes most sense here. I'd also opt for a JavaScript based solution. If the generated data is going to require some heavy lifting behind the scenes, you should consider (pre-)caching it, but other than that a client-side implementation often makes most sense.1 point
-
I'm not sure I follow. What do you mean you upgraded to the latest version of Blog. I assumed this was your first time installing Blog, hence had the latest version already? Did you follow the normal upgrade process or did you create a second blog folder under /site/modules/? If you have two Blog folders in there, that would lead to the the 'redeclare' error. Since you have the Fatal Error alongside the Compile Error, I don't think it is a compile issue, but a 'two-folders' issue. Perhaps you have a /site/modules/processblog/ and a /site/modules/blog/? If that's not the case, could you clear your cache (Refresh button when in Modules view). You might need to do that several times. I haven't tested Blog in 3.0.39, but did test in 3.0.42 so maybe that is not the issue. Please refresh the cache and try reinstalling. This time, install without enabling comments. Secondly, could you confirm that Blog components are installed, i.e. blog_xxx_fields and blog-xxx-templates.1 point
-
I am on a vps with transip and my sites all run processwire, all working like a charm. very fast sites - I do use procache as well with the cdn function.1 point
-
The following solution with 2 separated rules should produce only one redirect. RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] RewriteRule ^(.*)$ https://%1%{REQUEST_URI} [L,R=301] RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] This one should work for your domain with a single rule RewriteCond %{HTTP_HOST} ^www\.grantdb.ca$ [OR] RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://grantdb.ca/$1 [L,R=301] The issue in my suggestion above was that the first condition fills the variable %1% with the trailing slash which results in redirecting to https:///1 point
-
Use the method 'add' . $mypage = new Page(); // other code...for $mypage template, parent, title, etc... // find songs to add $songSelections = $pages->find('template=song-selections, limit=50'); // if we found songs if($songSelections->count()) { foreach ($songSelections as $song) { $mypage->song_artist_selections->add($song); } } $mypage->save(); References: http://processwire.com/api/ref/page-array/add/ (of main relevance in your case; see the examples on that page as well) http://processwire.com/api/ref/page-array/ http://processwire.com/api/arrays/page/ http://processwire.com/api/ref/wire-array/add/ (this and below, mainly FYI) http://processwire.com/api/ref/wire-array/ http://processwire.com/api/arrays/1 point
-
Try rolling back your PW version to 3.0.47 - https://github.com/processwire/processwire-issues/issues/1511 point
-
@adrian, I know function names are case-insensitive, but maybe you could change this line from $destinationPage->$fieldName->add($item->getPathName()); to... $destinationPage->$fieldName->add($item->getPathname());// @note: lower 'n' in getPathname to match what's in the docs...Just me being silly.1 point
-
I haven't tried removing www from urls via htaccess. I have always used my registrar dns wildcards to direct to my servers. Does your registrar offer the same?1 point
-
You could use this // the parent <?php echo $pages->get("template=recommendations")->title;?> // children <?php foreach($pages->find("parent=recommendations") as $child) { ?> <?php echo $child->title;?> <img src="<?php echo $child->post_image->first()->size(200,0)->url;?>"> <?php } ?> or this: <?php // flag to track if parent title was shown $parentTitleShown = false; ?> <?php foreach($pages->find("parent=recommendations") as $child) { ?> <?php if(!$parentTitleShown) { // parent echo $child->parent->title; // set flag $parentTitleShown = true; } // children echo $child->title; ?> <img src="<?php echo $child->post_image->first()->size(200,0)->url;?>"> <?php } ?>1 point
-
@FrancisChung Is this for a search you want to kick off via a page on your PW site - where the user can enter some variable search term? If so, how about a Click() handler on the submit button that issues 3 distinct ajax searches against the backend? Here's some pseudo-JQuery to illustrate the idea. To keep it shorter, this example kicks off two async ajax calls to the back-end to get search results as JSON and then renders the output once both calls have returned (either with or without data.) $('#submit-button').click(function () { var searchA = false, searchB = false; // Kick off asynchronous call to get results for search A... // return results as JSON jQuery.ajax({ url: '', // Construct a url to trigger search A success: function (result) { searchA = true; // Add code to store result JSON... rendezvous(searchA, searchB); } }); // Kick off asynchronous call to get results for search B... // return results as JSON jQuery.ajax({ url: '', // Construct a url to trigger search B success: function (result) { searchB = true; // Add code to store result JSON... rendezvous(searchA, searchB); } }); }); function rendezvous(A, B) { if (A & B) { // Use JQuery to combine, format & render search results in your current page } }1 point
-
Syntax of your apache directive is fine. Just to mention you are using AND for the conditions. You maybe prefer OR? RewriteCond %{HTTPS} !=on [OR] RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] RewriteRule (.*) https://%1%{REQUEST_URI} [L,R=301] EDIT: This code has issues, go here: #1360461 point
-
Yes - sorry, I thought I had linked to it earlier: Blog post documentation: http://processwire.com/blog/posts/introducing-tracy-debugger/ Forum thread: https://processwire.com/talk/topic/12208-tracy-debugger/ Modules directory: http://modules.processwire.com/modules/tracy-debugger/1 point
-
I've done a thing like this: Here (not in this part of the script) I test for all variables, when oké, I'll post to the same URL with an added URLSegment called 'curl'. So the the script will be executed again, but then over shell_exec an out of the session. You should note that all output even errors will have a nice journey into /dev/null so they are gone. For error handling you're on your own. // Success if (!count($this->errors)) { $query = http_build_query($this->postArray); // point output to /dev/null/ shell_exec("curl --data '$query' " . $this->page->httpUrl . "curl/ 2>/dev/null >/dev/null &"); $this->json['success'] = true; // Show errors, abort } else { $this->json['errors'] = $this->errors; }1 point
-
Afaik the most mature tool for async php is reactphp. But really async code is not a peace of cake and there are probably better languages out there than php to execute code concurrently.1 point
-
I misread your post and thought you meant Select Multiple rather than Page List Select Multiple - the latter is fine for thousands of pages as it is ajax-paginated.1 point
-
Not very well - that's when you would want to use an inputfield that loads options on demand with AJAX. I think Autocomplete is the only core inputfield that does this. Misread your post and thought you meant Select Multiple. Page List Select Multiple uses the standard ajax-paginated page tree so that is fine for thousands of pages, although slower to use than Autocomplete. Inputfield Selectize is based on selectize.js which does have an AJAX load feature but I'm not sure this is available for pages in the PW module.1 point
-
Great blog post Ryan, thank you! Great year behind and even better coming! What comes weekly news, I think maybe @teppo and PW Weekly could report interesting new stuff from dev branch - instead of full blog post by @ryan each week? Also I think what would really help PW as a community project is that modularity would be more easily seen from code repositories also. I mean separation of /wire/ from rest of the stuff, keeping admin as own project and making several core modules as their own projects (although they could be "essentials" that would always be installed with ProcessWIre). What comes to Avoine, I hope I found time to write case story about how we use ProcessWire as backend solution to our member register platform Avoine Sense. Sense was released early 2016 and it already hosts about 10 member registers that together hold about 150 000 members. Feature-wise Sense already has newsletters, custom reporting tool, invoicing, model based templates/fields, background jobs, client specific procedures build by chaining actions (ie. create excel, connect ftp, deliver file and finally send sms to admin), full read/write REST API with Oauth2 authentication, mobile application, embeddable login/edit forms etc... ProcessWire has been amazing platform for our application development (currently we have 4-5 developers working on it). I strongly encourage that you all consider ProcessWire as a viable alternative for serious application development also. It is perfect platform for building dynamic websites, but it is also pretty brilliant platform for application development!1 point
-
ProcessWire Forum Rules Version 1.1. Last updated November 10, 2014 Purpose of the Forums The ProcessWire forums are a self-help support forum where users can also contribute towards the future of ProcessWire. It is comprised of individuals from across the globe who want to help each other and who are giving much of their free time to do so. Many members have commented that the ProcessWire forums are exceptional in how equally friendly and hospitable they are to those who are very knowledgeable and those who are only just beginning to learn. A word about the rules The rules are here for the benefit of everyone. It says something about a community that we have not required any for four years despite the occasional heated debate. However, as the community has grown it seems only fair to create rules for both members and staff alike. Rules are not the same as laws. They are applied to each individual situation as the need arises and can be interpreted by the staff after reaching a consensus, where appropriate, or they may be enforced quicker in the case of situations requiring immediate attention or that are in very clear violation of the rules. Please respect the outcome of any decisions made by the staff. Rules for posting No Flaming. Never threaten the project, developers or other forum members. Threatening behaviour will be dealt with swiftly by staff and may result in a ban.. No Spamming. Spamming violations may result in your post count being reset, revocation of posting privileges, or even permanent banning from the site. There are several types of spam: Off-Topic posts outside the off topic “Pub” forum. If you wish to make an off topic post, please do this in the “Pub” forum. Multiposting. Multiposting is repeating the same message several times in the same topic, or, making a post directly after another, when you could have edited the additional comments into your first post. Multithreading. Multithreading is posting the same message in several different threads. If you do not receive a reply to your post, it may be that people do not have an opinion or are simply not online. Be patient. Unauthorized Advertising. Any unauthorized advertisements will be deleted and the offending member may be banned. Please note that linking to your company website is permitted in your signature as a plain text link. No discussion of politics or religion anywhere on these forums including the Off Topic boards - there are many other websites where you may discuss these topics. Please avoid very bad language. This is not an adult only forum so treat it as being family friendly. Please respect others’ opinions. Do not state that they are wrong and dismiss them in a derogatory manner. Please try and offer constructive counter-arguments when joining a topic containing a debate. If in doubt, don’t post. Please don't tell other people to go and search if they ask a question that has been asked before. If you like, inform a member of staff or a moderator via the reporting feature and we will do our best to merge it into a relevant topic, or you could suggest in a polite manner so as not to offend that they Google the forums via this link - just remember to be friendly as a link on its own can be mistaken for frustration or impatience. Please do not make demands of the developers of this project or of those who manage the forums. It is disrespectful to the people who give so much of their free time to this community Please contact us if you have an issue with another member or even a staff member - the relevant points of contact are at the bottom of this post Please respect the privacy of others. If a member chooses to use a pseudonym rather than their real name, that is their privilege. Please respect their wishes and do not out them even if their real name is common knowledge. Keep to one identity. Do not create alternate avatars and just stick to the one. If there are technical reasons why you need a new one (can’t rescue the old one, perhaps) be open about it. If you are angry about something, step back, take a breather and try to post a reasonable reply. If you feel that someone is being wholly unreasonable or stubborn, please contact a member of staff. Please try and use Common Sense. No set of rules can cover everything. If you think about what you are posting before posting, you shouldn’t run into any trouble. Remember, this is a forum about a software project, not world peace. It is doubtful ANY argument is important enough to be angry about. Please note that these rules may be updated from time to time. If you continue to use these forums it is assumed that you agree to them. Rules for using the Personal Message system The boards have a simple and unrestricted personal messenger - please use this responsibly. In addition to the above rules regarding posting: Please do not use the personal messenger to threaten anyone, tell them off or send a message that is likely to upset or offend. Please respect every member’s privacy and only PM someone if you feel they will be happy to receive a message from you. If you receive any messages that you feel are inappropriate, please contact a member of staff rather than taking matters into your own hands. Please do not copy and paste private messages into the public forums without the consent of the sendee. Actions we might take At the sole discretion of the forum staff and/or administrators, you may be given a warning if you break the rules. If the infraction is deemed severe enough, you will be banned. If you repeatedly break the rules or are belligerent in your response to staff/admin messages about an infraction then you will also be banned. If we do contact you it will be via the personal messenger system on the forums or, in the event of a ban, we will contact you via your registration email. We will not conduct conversations in public nor will we reply to any public conversations about a particular case. Points of contact If you have an issue that requires staff attention, in the first instance you should report the content using the “Report” link at the bottom-right corner of the relevant post. If you wish to, please contact a particular member of staff directly about an issue. If your issue is about a particular member of staff, please contact Pete and/or ryan via Personal Message. Please don't be put off by these rules. They are in place to help make sure that the site keeps its nice and friendly atmosphere. We're not here to rule with an iron fist - we’re here to discuss ideas and help one another, but we will act when people disregard the rules or ruin the atmosphere.1 point
-
Posting Guidelines In addition to the rules, it is recommended that you read the following guidelines to get the most out of your interactions with this community. Interpreting other members’ posts Our community is a global community and as such posts and intentions can be misunderstood. If you encounter a reply that seems “short” and contains links to other topics that may answer your question, this may be due to the large number of members who use the forums on their mobile devices and want to help but don’t have time for a more complete reply or for whom English is not their first language. Please try and give people the benefit of the doubt when posting. Please do not dismiss their views out of hand (constructive replies are welcome). The forum language is English. We really appreciate the effort everyone makes from countries around the world to post in English. After careful consideration and experience on other forums, it makes sense to have one common language for discussion here so that ideas can be shared and not missed in language-specific forums - the same applies for debates that might get out of hand as we do not want to miss those either. There are more and more country-specific ProcessWire websites cropping up however so if you find that a group of you are in agreement and wish to set up a language-specific forum of your own then please feel free. Suggesting new modules/features Many of the features of ProcessWire have been born out of suggestions by users or discussions within the community, but that does not mean that every suggestion can be taken on board or that it might even be in tune with the overall strategy for the project. If you have suggestions for new features or modules, please feel free to propose them in a simple, open way in the Wishlist & Roadmap forum, but don’t be upset if no one is interested. Developer’s needs vary greatly. Your suggestion might well be something that is better developed as a third party module; in fact that is often the case. You are free to develop that yourself or work with others on a project, or even post a job to get help in the jobs board. However, whatever your idea or wish for a new feature, please do not make your suggestion sound like a demand, or tell the developers they have “got it all wrong,” or that you know what is best for ProcessWire. That is simply unfair to those who have been working on the project for free for years. Answering topics If you can help your fellow members then that’s great! Giving something back to the community in a constructive manner is always welcome. If someone replies in a topic you started and you think it is the best answer then please click the “Mark Solved” button at the bottom-right of the relevant post. Staff may mark a post as the best answer for you or change the chosen answer at their discretion if there is a better/more comprehensive answer later on in that topic. Some of the most prolific posters in the community do not count themselves at experts, but are very good at pointing new members in the right direction - you don’t have to be an expert in order to help out. Please don’t tell someone off for asking a silly question - there is no such thing! Every question is being asked because the person genuinely does not know the answer and might not know where to look. Raising issues or disagreements Nobody frequenting this forum should feel threatened when voicing their opinion as long as they are doing so constructively. Please be mindful however that everyone is unique and may interpret situations differently which could lead to misunderstandings. If you find that you disagree with someone, they may simply have a different point of view - this does not automatically mean that their view is wrong or your view is right. If multiple people disagree with you, it could be that a point has been raised many times before and/or that your point is not clear. Please seek clarification and remain calm or go talk about something else. If someone appears to be being simply argumentative, repetitive or belligerent in their replies then please do contact a member of staff and refrain from being drawn into the discussion further. To repeat, we are not solving world issues here, nothing is really so important that you HAVE to say something. If in doubt, say nothing and read another topic.1 point
-
Hello Processwire folks, today I want to show how to implement piwik into Processwire to show some specific site details to visitors or, if you create a special frontend login, for yourself. First Step (preparation): What do we need? Well, to grab piwik data we need the piwik open source analytics suite. Grab your copy here: http://piwik.org/ Now copy piwik right into your Processwire folder, you get a folder structure like: piwik, site,wire next install piwik! After installation log into your piwik dashboard and setup your site, we need some information from piwik later in the tutorial, so just let the piwik dashboard open in the background. Now we have to think about data presentation. I´m currently working on a Webapp to let customers create their own Landing Pages and measure their performance, to show the data I´ve choosen morris.js a goodlooking javascript based on raphael.js and jQuery. So, we need jQuery. morris.js and raphael.js. jQuery : http://jquery.com/ morris.js : http://www.oesmith.co.uk/morris.js/ raphael.js : http://raphaeljs.com/ Install all three scripts in your Processwire templates folder and dont forget to copy the provided .css file, too. Second Step (Connect to the piwik API): To grab data from piwik we have to include the piwik API in our Processwire installation and we need some special settings to do. We need 2 informations about our piwik installation: 1st our own Auth Token 2nd the SiteID of our tracked page You could find your Auth Token in the piwik Dashboard. Just click on API in the head menu and there it is, in this little green box. Now we need to know the site id of our page we want to show in our template files. If you only setup one page in piwik the SiteId is 1, if you setup multiple sites click on "all websites" in the head menu now click on add new site. Now you could see all your pages and their own site Id. Remember where to find this informations, we need them in our next steps. Third Step (templating and API connection): Go to your PW Admin and create a new Template. We don´t need any fields so far, so title and body would be enough, now create a new page with your new template. Thats it on clicki bunti side, we now have to open our favorite ninja code editor. Create a new file in your templates folder named like the template you created. Create a new file in a subfolder of your templates folder, maybe if exists in scripts or includes, wherever your include files are. Name this file analyticSettings.php This is our piwik API connector. Copy and paste the following code: <?php // if you don't include 'index.php', you must also define PIWIK_DOCUMENT_ROOT // and include "libs/upgradephp/upgrade.php" and "core/Loader.php" define('PIWIK_INCLUDE_PATH', realpath($config->paths->root.'/piwik')); define('PIWIK_USER_PATH', realpath($config->paths->root.'/piwik')); define('PIWIK_ENABLE_DISPATCH', false); define('PIWIK_ENABLE_ERROR_HANDLER', false); define('PIWIK_ENABLE_SESSION_START', false); require_once PIWIK_INCLUDE_PATH . "/index.php"; require_once PIWIK_INCLUDE_PATH . "/core/API/Request.php"; Piwik_FrontController::getInstance()->init(); function piwikRequest($piwikSiteId,$piwikMethod,$piwikPeriod,$piwikDate,$piwikSegment,$piwikColumns, $piwikColumnsHide) { $piwikGetData = new Piwik_API_Request (' method='. $piwikMethod .' &idSite='. $piwikSiteId .' &period='. $piwikPeriod .' &date='. $piwikDate .' &format=php &serialize=0 &token_auth=AUTH TOKEN &segment='.$piwikSegment.' &showColumns='. $piwikColumns .' &hideColumns='. $piwikColumnsHide .' '); $piwikGetData = $piwikGetData->process(); return $piwikGetData; } ?> line 1 - 14 sets the paths to the piwik API and setup some error handling for piwik. Enter your own Auth Token in line 26. Thats it, connection to piwik allready done. Now lets see how we grab our data. There is a function beginning in line 15. I named this little friend piwikRequest. You could pass 7 values to our function to define which, how many, which date,period and method we want to request from piwik. $piwikSiteId = from which tracked page we need data. $piwikMethod = which data method do we need? You could find a full list here: http://piwik.org/docs/analytics-api/reference/#toc-standard-api-parameters $piwikPeriod = day, year, moth, week $piwikDay= today, yesterday $piwikSegment = Segment of data, e.g. pageTitle==home $piwikColumnsShow = Only grab Data from this columns in the piwik database $piwikColumnsHide = Do not grab data from this columns So, if we want to grab the visitor count from yesterday we could call our function like this: <?php echo piwikRequest('3','VisitsSummary.getVisits','day','yesterday' ?> 3 = id of tracked site from piwik (I use piwik to track frontend, backend and the user created landing pages in its own site) VisitsSummary.getVisits = our API Method to tell piwik which data we need day = our period yesterday = well yes, data from yesterday This request returns just a neat integer so there is no need to do additional logic, if we use methods providing more data the function returns an array which could be displayed by an print_r() or json_encode() Well our piwik connection is ready, now we want to show some data on our template file. The Templating: Open your template file, make sure you included all needed files from jquery, morris and raphael. Include on top of the page your piwik api connector file. Make sure that jquery, morris.js and raphael.js are included in this order and above the html code. Order: jQuery Rapaehl.js Morris.Js We now want to show 2 Donuts with 2 data values each. Visits today and Yesterday. Total pageviews from this year, unique and all. Copy and paste the following code to your template file: <h2>Visitors</h2> <div id="donut" style="height:200px;"></div> <h2>Page Views</h2> <div id="donut2" style="height:200px;"></div> <script> Morris.Donut({ element: 'donut', data: [ {label: "Yesterday", value: <?= piwikRequest('3','VisitsSummary.getVisits','day','yesterday') ?>}, {label: "Today", value: <?= piwikRequest('3','VisitsSummary.getVisits','day','today' ) ?>}, ] }); Morris.Donut({ element: 'donut2', data: [ {label: "unique", value: <?= piwikRequest('3','Actions.get','year','yesterday',' ','nb_uniq_pageviews') ?>}, {label: "all", value: <?= piwikRequest('3','Actions.get','year','yesterday',' ','nb_pageviews') ?>} ] }); </script> We add 2 empty divs with some inline css. You could change this via a stylesheet. In this 2 divs the morris script will draw a donut with the grabbed data from piwik. Right under the divs we are calling our morris.js and provide data from our piwikRequest function. Thats all You could find all piwik methods, dates, periods and so on in the piwik api reference here: http://piwik.org/docs/analytics-api/reference/#toc-standard-api-parameters1 point