Leaderboard
Popular Content
Showing content with the highest reputation on 07/14/2020 in all areas
-
I know that headless cms has been a hot topic for a while. I've experimented with several frontend frameworks (Angular, React, Vue, etc) and I just don't get it. Maybe for huge corporations with multiple dev teams and big budgets, OK. For 95+% of use cases however, I find headless cms/js frontend to be a major pain with no discernible benefits. From a frontend web UX, they're often slower than a well built PW site with caching (eg ProCache). For native apps, something like api calls to/from PW/Dart via json would do the job. Am I missing something other than a desire for JS devs to earn extra $$$?4 points
-
I didn't want to create a topic for this, so I decided to use my existing thread , as mentioned, I am creating some Youtube tutorials around Processwire, I feel a video is much more easier to help people getting started with Processwire. So I did a first video introduction, However I quickly realized my dilemma with self expression skills when talking, so I am working on that but here is the first video and I hope to drop a Video per week or more depending on how fast I can get things out but I am also open to covering other complex topics too around Processwire. Thanks and I hope this helps out a lot of people. NOTE: LOL Working on how I sound too ?, bear with me Love from Nigeria3 points
-
There's really two reasons this isn't implemented: 1 — I don't think it's all that necessary. For actual browsing of data that requires state and pagination, there's much better tools available: PageList and PageLister, among others. The pagination info, as implemented currently, is merely meant to communicate that there's more results than currently shown and avoid any confusion there. 2 — It's probably not that trivial to build. The native pagination breaks down once you do any sorting or render multiple paginated panels on a dashboard. To make it work well, it would have to be a custom-built solution that fetches results via AJAX and does the sorting server-side. I'm not currently doing any substantial work on the module, however I'm planning to implement some missing features when I find the time later this summer. In the meantime, I'll happily accept pull requests for a working pagination feature.2 points
-
I've used PW in mostly headless mode for a recent project at work. A new client needed to add a map of case studies to an existing bespoke site that was built by another party, and an easy way to manage them. I set up a new PW site to manage the case studies, added a basic JSON API as the only bit of front-end, and made a simple Vue app (to be embedded on the client's site) to fetch the data, filter items, and render the map/markers and detail view. Didn't take all that long to build, and the client is happy with the functionality. Each case study is associated with other bits of information, like contacts, keywords, sectors, location - and PW really made this easy.2 points
-
Not sure if there is a hook that will exclude trashed pages directly, but you can very easily check status changes inside the Pages::saved hook, and abort the hook if the page is / was trashed. Use $page->statusPrevious to get the previous status, then you can compare it with the current status. See this hook in my TrelloWire module, which reacts to status changes. In this case I check both the current and previous status, because I'm only interested in the changes. Note that statusPrevious will be null if the status hasn't changed. If you only care about whether the page is currently in the trash, you can just use $page->isTrash().2 points
-
Yes, what I'm saying is that if you have HTML Entity Encoder enabled for the Title field then you wont get the cut off title, because < will be encoded to < and so strip_tags() will leave it alone. The issue you've raised probably hasn't been noticed before because PW has the HTML Entity Encoder textformatter applied to the Title field by default and it's rare to disable it. If you're wanting to avoid double-encoding by Twig then until the issue is fixed you could just encode the title field before Page List renders the label: $wire->addHookBefore('ProcessPageListRender::getPageLabel', function(HookEvent $event) { $page = $event->arguments(0); $page->title = htmlspecialchars($page->title); });2 points
-
Example implementation: Info: So this is very much an ALPHA version of what I hope turns into a swiss armory knife payment module. Currently you are able to take payments with the payments form or cross browser payments button (Apple Pay etc). Please read implementation details here and consider contributing https://github.com/benbyford/PaymentStripeIntents TODO: Add subscription functionality Add customer functionality More testing and code clean up More usage examples anything else?1 point
-
I generally prefer modules not to "pollute" anything with fields and templates. I believe it is also quite a rare need for modules to really to create pages, templates and fields. Of course you generally don't get "turnkey solutions" this way, but more lower level modules and building blocks. For simple example: any modules related to event calendars are just tools to help you build event calendars (render helpers, fieldtypes etc) until they actually create templates and fields for you.1 point
-
You might be interested in the ReachPHP project. (Not to be confused with the React from Javascript land). It also sounds like your setup could do with some caching layers, workers, or some abstractions to manage the data you're dealing with from different services?1 point
-
Personally I'd only do headless cms's with static sites. Where the static site generator pulls from the external cms for building its content. This is great because the cms is only concerned with providing data and the static site generator is concerned with rendering those into html.1 point
-
Yes, I am using a CandySkull Headset as mic, but I have a Lapel mic, I am looking to get those professional mics and also understand Adobe Premiere audio better, the next video will have a much better sound quality.1 point
-
$u = new WireUpload('fileinputname'); $u->setExtractArchives(true); But probably not useful in your case since you are downloading from GitHub1 point
-
Thanks Mustapha, I really appreciate the support, I am working on more content and also working on making the transitions and effect more jazzing. I'll update this thread as I push more contents1 point
-
Will add deleteLanguage as well, will add new PR soon(ish).1 point
-
@bernhard just created a new PR for basic language support (creating new languages and setting translation files for a language). Usage inside migrations is simple: $finnish = $rm->addNewLanguage("finnish", "Finnish"); $rm->setTranslationsToLanguage( "https://github.com/apeisa/Finnish-ProcessWire/archive/master.zip", $finnish->name, ); Or if you just want to set translations to default language: $rm->setTranslationsToLanguage("https://github.com/apeisa/Finnish-ProcessWire/archive/master.zip");1 point
-
1 point
-
I figure this could lead to a collision if there were someone with the e-mail jim@ex-ample.com and someone with the e-mail jim-ex@ample.com.1 point
-
@benbyf Actually wondering on this myself. I fell in love with Processwire because it was easy to organize the data and fields. But when it comes to giving users a different place (other than the ProcessWire platform itself), I'm at a limbo. Not a pro-programmer neither ProcessWire. Any leads would be helpful.1 point
-
I'm totally agree with your opinion. Even it's beta.. We could start to implement it, use it, find bugs, help to fix it etc. We could start our projects and show something to our clients, get familiar with the system.1 point
-
@kongondo, I am aware that this doesn't help, but I was wondering just how close are we to an announcement? The current COVID situation just brought so many extra ecommerce projects to life, a beta / alpha release could pick up great momentum with the PW community, I'm sure.1 point
-
That happens in ProcessPageListRender::___getPageLabel where strip_tags is invoked. So yes, it's a core issue. I'm not convinced strip_tags is necessary here at all since htmlspecialchars is called anyway.1 point
-
OMG, not again... https://www.pilcro.com/blog/headless-cms By that definition, PW is most definitely a HCMS...1 point
-
This thread is great, you are far more technical than me. I'm just a front end developer. So to see someone having such a good time with the advanced part of ProcessWire is really encouraging. I too came from WordPress. It was my main platform for developing everything, and had been for many years. As you can imagine, finding ProcessWire was a breath of fresh air. I must admit, I look at your code and I have no idea what's going off as I'm not that advanced. But you seem to find everything that is usually really difficult, easy in ProcessWire. I too have this. Only last year was I pulling my eyes out with pagination on WordPress. ProcessWire it's easy. As for official discussion for PW3, there really isn't one to my knowledge. However, I think something like Gitter would work as we can have trivial discussions without spamming the forum. I was thinking the same for the Brand refresh for PW.1 point
-
Best Part is that I have a Data used in Wordpress to get subscribers so without breaking changes , I could easily forgo the Page Object Mantra and also pull directly from the database private function getFollowers($member_id){ $database=wire('database'); $statement=$database->prepare("SELECT COUNT( * ) FROM `member_subscribers` WHERE member_id = :member_id"); $statement->bindParam(":member_id",$member_id,PDO::PARAM_INT); $statement->execute(); $result=$statement->fetch(PDO::FETCH_NUM); return $result[0]; } Luckily this is PDO and it's totally awesome, My Client is really happy with the outcome of the Project because she loves the backend of Processwire and also that Google analytics someone created, and really i was skeptical of PW at first (because if something is too good to be true, then something must be wrong secretly) but now i feel more comfortable with it more than ever, I could go the PW "Everything is a Page Model" or go Rogue and cook up some things, but I love the everything is a page in some scenarios, e.g getting Parent of pages and finding Children , in some ways it feels like JCR in Java but not that advanced though. However i still have much questions ? 1. Having Multiple Albums per User 2. Social Authentication Seriously guys give Dropzone.js a spin for frontend uploading, it's dead easy, good bye1 point
-
Uploading code in the BackendController public function upload(){ header("Content-type:application/json"); if($this->appContext->premium == 1){ if(count($this->appContext->images) >= self::PREMIUM_MEMBER_IMAGES){ return json_encode(array( 'status'=>'error', 'data'=> sprintf("Your Premium account has exceeded the maximum amount [%d]",self::PREMIUM_MEMBER_IMAGES) )); } } else if(count($this->appContext->images) >= self::REGULAR_MEMBER_IMAGES){ return json_encode(array( 'status'=>'error', 'data'=> sprintf("Your Premium account has exceeded the maximum amount [%d]",self::REGULAR_MEMBER_IMAGES) )); } $config=wire('config'); $file=$_FILES['file']; $wireuploader=new WireUpload('file'); $wireuploader->setDestinationPath($this->appContext->images->path); $wireuploader->setMaxFiles(1); $wireuploader->setOverwrite(true); $wireuploader->setValidExtensions(array('jpg', 'jpeg', 'gif', 'png')); $wireuploader->setTargetFilename($file['name']); $wireuploader->setAllowAjax(true); $resultSet=$wireuploader->execute(); if(!$wireuploader->getErrors()){ //Let's save the article to the page $this->appContext->of(false); $this->appContext->images->add($this->appContext->images->path.$resultSet[0]); $this->appContext->save(); return json_encode(array( 'status'=>'success', 'data'=> sprintf("The %s has been saved to your profile successfully",$file['name']), "count"=>count($this->appContext->premium) )); } else{ return json_encode(array( 'status'=>'error', 'data'=>$wireuploader->getErrors() )); } } } At first i was skeptical about it adding to the pages, because i felt it's too good to be true so checking the Real backend and viola this is the images added to it via the frontend1 point
-
URLSegments are awesome so i wanted to build a backend for the users , after cracking my head and losing confidence in my skills, I think at some point I was crying, till it hit me , wait a minute FrontDispatchers in Zend Framework take the route or the url and dispatches the Action to be called right, so I created a Module that alters my template when on a page called member-login and session is set, then it takes the user to the member-dashboard page, now on that page URL Segment has been enabled. Here is the source code that takes the url and handles the action: <?php $session=wire('session'); if($session->get('currentUserLogged') !== true){ $session->redirect($config->urls->root."/member-login"); } require (dirname(__FILE__)."/admin_url_segments/SegmentUrlRenderer.php"); //let's get the current page from the session $StyljunkiPageMember=$pages->get($session->get('SessionMember')); $segment=new SegmenturlRenderer($input,$StyljunkiPageMember); //If it is an Ajax Call return the call and nothing else if($config->ajax){ echo $segment->dispatch(); exit(); }else{ $content=$segment->dispatch(); } Here is the source code of the SegmentController: <?php /** * This class handles the Url Segment and selects a view to be rendered * */ class SegmentUrlRenderer { private $urlsegment; private $context; public function __construct($UrlSegment,Page $Context) { $this->urlsegment = $UrlSegment; $this->context = $Context; } public function dispatch() { //first get the controller folder return $this->processURL($this->urlsegment); } private function processURL($input) { //typical rules //URL 1: Controller Class //URL 2: Controller Class Method $controller_class = $this->urlsegment->urlSegment(1); $controller_action = $this->urlsegment->urlSegment(2); if ($controller_class === '') { $controller_class="Backend"; } if ($controller_action === '') { $controller_action = "index"; } //Get the matching controller $matching_controller = ucfirst($controller_class). "Controller.php"; $matching_controller_prefixless=ucfirst($controller_class)."Controller"; $controller_folders = dirname(dirname(__FILE__)) . "/controllers/"; if(!file_exists($controller_folders.$matching_controller)){ throw new WireException(sprintf('The Specified Controller File [%s] doesn\'t exist',($controller_folders.$matching_controller))); } require_once ($controller_folders . $matching_controller); //We need to introspect let's see that the method exists $controller = new $matching_controller_prefixless(); $controller->appContext=$this->context; //Add the prehook if (method_exists($controller, "prehook")) { return $controller->prehook(); } //does the method exist in the class if (method_exists($controller, $controller_action)) { return $controller->$controller_action(); } } } So i have a folder called "controllers" which has one controller class called backend so it the user types http://localhost/StyljunkiPW/member-dashboard/backend It resolves to the default controller which is index as seen in the code here if ($controller_class === '') { $controller_class="Backend"; } if ($controller_action === '') { $controller_action = "index"; } So it works and renders the dashboard this is the profile page which pulls information from the Page Object1 point
-
Just use $input->whitelist(key,value) to store get vars and pager will auto include it.1 point