-
Posts
364 -
Joined
Everything posted by hellomoto
-
Virtual "vert chew/sho[o/e] wool", "per ah cess why['re/er/ err]", oo erred Language is binary or something It's very extensive
-
Uploading via the default file field when the size is on the larger side (like a song 374 MB; sorry to be so vague) seemingly very often freezes at 100%, never quite turning over, so I end up having to manually upload the file to the page assets dir. and update page field values in the database. Ring a bell for anybody? Any success in resolving this if so? It's much time lost. I don't work on live sites much, but from what I can recall this is true also in production. Thanks friends
-
All good sorry I'm burnt out. Please grant me the ability to delete my own posts, for the sake of us all, and I promise to be more careful hereon anyhow. public function hookAfterPageRender($event) { $page = $event->object; if (strpos($page->template->tags, 'crm') === false) return; $event->return = str_replace( '</head>', enqueuess(['crm' => $this->wire('config')->urls->templates.'css/crm.css']).'</head>', $event->return ); }
-
I was working on this: class PWCRM extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'Client Relationship Management', 'version' => .001, 'singular' => true, 'autoload' => true ); } public function init() {} public function ready() { $this->pages->addHookBefore('render', $this, 'accessHook'); $this->pages->addHookAfter('render', $this, 'hookAfterPageRender'); } public function accessHook(HookEvent $event) { $page = $this->wire('page'); if (!strpos($page->template->tags, 'crm')) return; if (!$this->wire('user')->hasRole('crm')) $this->wire('session')->redirect($this->wire('config')->urls->login);//throw new Wire404Exception(); } public function hookAfterPageRender(HookEvent $event) { $page = $event->object; echo $page->template->tags; if (!strpos($page->template->tags, 'crm')) return; echo $this->wire('config')->urls->templates; include_once($this->wire('config')->urls->templates.'functions.inc'); $pagehtml = $event->return; $pagehtml = str_replace( '</head>', '<link id="css_crm" rel="stylesheet" href="'.$this->wire('config')->urls->templates.'css/crm.css"> </head>', $pagehtml ); $event->return = $pagehtml; //$event->replace = true; } } I have tried placing the hooks into the init() function, and more... Neither method is effective. The echoes now output, but no redirection (although I have the access settings for the top-level template for this set to render a 404 for underprivileged users, which it does, overriding this, but nonetheless this should work aside from that. Then I wrote this up quick: <?php namespace ProcessWire; class MaintenanceMode extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'Maintenance Mode', 'version' => 1, 'summary' => 'Disables the website frontend for non-superusers.', 'singular' => true, 'autoload' => true, 'permanent' => false ); } public function init() { $this->addHookBefore('Page::render', $this, 'displayDecide'); } public function displayDecide($event) { $page = $event->object; if ($page->template == 'admin' || $this->wire('user')->hasRole('superuser')) return; // replace the method hooked $event->replace = true; $event->return = "Patience please while we undergo some brief maintenance work."; } } which likewise avails nothing. What the hell is my problem here?
-
Hey how do I get started? What I did was copy all the template files into my existing project and follow the instructions given for the templates setup. Then I deleted the homepage calls for a stylesheet and javascripts that don't exist (in client/dist/) and added vue.js... I'm totally new to vue.js so please excuse my ignorance and if you can give me any tips on how to begin I would deeply appreciate it... I know I'm being awfully vague... How can I pass all the pages to a vue instance to build a navigation, for starters? or should I just do that with PHP?
- 36 replies
-
- vue-router
- vuex
-
(and 2 more)
Tagged with:
-
Can't add sort to selector without crazy error
hellomoto replied to hellomoto's topic in API & Templates
That did it. I always have the trailing commas is why I didn't try it... oy thank you... -
I have $select = 'template=post, when<=now, sort=when, '; $results = $pages->find($select); then output the results' data. It works fine without the sort=when. With it, I get this: Error: Exception: SQLSTATE[42000]: Syntax error or access violation: 1066 Not unique table/alias: '_sort_when' (in /Applications/AMPPS/www/website/wire/core/PageFinder.php line 384) what is this I have this elsewhere $start = date('Y', $pages->get($select.' sort=when')->getUnformatted('when')); and it works fine, returns the earliest year.
-
I'm trying this out in PW 3. I have in my TextFormatterOembed field: Nothing happens in CKEditor or displayed output on page. Should this not work for PW 3 or am I doing something wrong? EDIT: Never mind, all I had to do was make it a link (& without target blank).
-
I have a project in progress of brokerage listings mainly. Things I need done are: currency conversion via ServiceCurrencyConversion module, implemented in search PDF generation email notifications & verification frontend admin (separate from default PW built-in) existing codebase audit & optimization I think that'll do. The PDF generation just needs to be a skeletal functionality, once doable I can further customize the template, just can't get it to work in the first place. Some frontend work maybe as well, such as implementing a JS framework (tbd) and some AJAX features. Please PM me with questions/quote. Thank you. UPDATE: I have opted to instead try out Laravel, for now. Wish me luck.
-
I have the template enabled in the module settings and the page is viewable. I would rather not have the ID in the download URL though. Currently I have the GET variable set to 'pdf', so it's ?pdf={id}. Since I'm linking from the page, can't it simply be ?pdf=1 for the pdf of the current page..? Thanks.
-
I want to implement tables with Dynatable populated via ajax. Here's what I could muster: if($config->ajax) { $results = $pages->find($sanitizer->selector()); foreach($results as $r) $array[] = [ $r->title, $r->modified ]; header("Content-type: application/json"); echo json_encode($array); exit; } $content .= <<<EOT <table id="my-ajax-table"></table> <script> $("#my-ajax-table").dynatable({ dataset: { ajax: true, ajaxUrl: '.', ajaxOnLoad: true, records: [] } }); </script> EOT; But that's really nothing. Pro tips?
-
I have reduced the module to this and the same error persists: <?php class PortalDashboard extends Process implements Module { public static function getModuleInfo() { return array( 'title' => "Portal Dashboard", 'version' => "0.1", //'permission' => array("page-lister"), 'autoload' => false, 'singular' => true, 'permanent' => false, 'requires' => array("PHP>=5.4.0", "ProcessWire>=3.0", "CatCoCustoms"), ); } public function init() {} In the red: Furthermore When I uninstall the aforementioned module this doesn't happen, oddly enough. What could be the problem?
-
and on the frontend my map is ghost; $modUrl = wire('config')->urls->siteModules.'MarkupLeafletMap/'; $styles = array_merge($styles, [ "leaflet" => "https://unpkg.com/leaflet@1.0.3/dist/leaflet.css", "leaflet-markercluster" => "{$modUrl}assets/leaflet-markercluster/MarkerCluster.css", ]); $scriptsH = array_merge($scriptsH, [ "leaflet" => "https://unpkg.com/leaflet@1.0.3/dist/leaflet.js", "leaflet-providers" => "{$modUrl}assets/leaflet-providers/leaflet-providers.js", "geocoder" => "{$modUrl}Control.Geocoder.js", ]); $map = $modules->get('MarkupLeafletMap'); $content .= $map->render($page, 'geolocation', ['height' => '500px']); returns visibly blank <div id="mleafletmap1" class="MarkupLeafletMap" style="width: 100%; height: 500px;"></div>
-
Nope! When there's a value input the map appears dutifully marked, however the Address input is still disabled, and clicking on it opens a search input within the map.
-
@adrian PW 3.0.42, PHP 5.6
-
Oh is it only supposed to populate via api?
-
I'm in PW 3.0.42 and in the page editor the entire fieldset is disabled, can't click on it, no map (just gray with +- zoom buttons).
-
I have this $pdf = $modules->get('Pages2Pdf')->render(array( 'title' => 'PDF', 'markup' => '<a href=\'{url}\' target=\'_blank\'>{title}</a>', 'page_id' => '', )); $content .= <<<EOT <script type="text/javascript"> $("h1").append(" <small>[$pdf]</small>");</script> </script> EOT; which outputs to /?pdf={pid} but clicking the link just opens the current page in a new tab, no PDF.
-
In PW 3.0.42 when editing a user this error appears up top:
-
When I click on any of the actions in the list I get this: Anyone know why
-
Cannot read/open CSV file from field in page under admin
hellomoto replied to hellomoto's topic in Module/Plugin Development
I tried using that with ../'s in the value to grab from the module's directory to no avail. Here is the module in progress: The file in question is import/csv.class.php. I appreciate any and all feedback regarding the makeup of this module. -
Cannot read/open CSV file from field in page under admin
hellomoto replied to hellomoto's topic in Module/Plugin Development
I have this happening in the template file: if(file_exists($filepath)) echo $filepath; echo "<a href='$filepath'>csv</a>"; $file = fopen($filepath, 'r'); print_r(fgetcsv($file, 0, ',', '"')); fclose($file); where $filepath = $this->source->url (in a class method). So it's the page's attached CSV file's URL. The link works and downloads the file, which supposedly doesn't exist, according to the preceding line. Why?? -
I am working on a module that runs/previews (for pub/unpub) imports on importer page view. The template has to be in site/templates, so far as I know, so one is created there on install which includes a file to run from within the module, but then when it's run and tries to read the importer csv file it cannot, since it's in the admin, I guess... Is it possible to set the template page to a file in the module directory? Will that work?