Jump to content

Stikki

Members
  • Posts

    55
  • Joined

  • Last visited

Everything posted by Stikki

  1. So that's no i guess Thanks for the answer tho.
  2. Hello people! I was trying to look way where i don't need to include .php file for each template, is this really mandatory? As in most cases prepend and append files are enough, templates folder gets full of stub files with <?php in em and nothing else, any cool work around to this? Cheers
  3. I really like this project, but something that i got annoyed is that there is no uniformity how command name:action pair is formed. I don't personally care which way they are but currently there are: mod:enable backup:db I would like to see that it's either of, where it's name:action or action:name pair, so i can rely on some logic. Not a biggie but still Cheers
  4. Okey, i'll consider it but since it's not currently core module use own custom version of this or alter it by hooking, if more people vote for MapMarker it gets in more likely, thanks for awesome documentation tho. However i'll change file and image files to support description by default just like you suggested. Those who already use this module, notice that this will break your JSON streams when it comes to files and images.
  5. Was MapMarker currently core module? If so i'll add it then.
  6. You can try override default behavior: wire()->addHookAfter('Pages2JSON::getValue', function($event) { $value = $event->arguments(0); if(!is_object($value)) return; if($value->className == 'Pageimage') { $obj = new stdClass; $obj->url = $value->url; $obj->description = $value->description; $event->return = $obj; } }); Didn't test this btw, you could let ppl know if it works, thanks.
  7. I like this due it's minimalistic footprint. http://responsiveslides.com/
  8. Well, it just reads attached fields and outputs data as fields provide it in that context, i didn't test with MLE fields, but i would assume output is in language that is currently in use as this is purely just JSON parser, it doesn't change data anyhow by default. If this behavior ain't correct in your opinion, please open ticket to Github and i'll take a look.
  9. Where do i get? From here: https://github.com/IDT-media/Pages2JSON (thanks to LostKobrakai for "bug" report) What does this do? Simply adds method toJSON() to Page and PageArray elements, is capable to converting image and file arrays to URL containers, travels recursively all objects before outputs actual JSON. How to use? Simply install this module, configure data you want it to export in JSON result (similar to Ryan's ServicePages, thanks btw used some of ur code here). in templates or anywhere you need JSON output, call: $page->toJSON(); or $pages->toJSON(); Live example with template: search.php /***************************************************************** Do search *****************************************************************/ $term = $sanitizer->text($input->term); $results = array(); if($term) { $input->whitelist('term', $term); $term = $sanitizer->selectorValue($term); $limit = (int)$input->limit; $limit = $limit ? $limit : 50; $limit = $sanitizer->selectorValue($limit); $selector = "title|categories|content*=$term, limit=$limit, template=default|product"; // Prevent admin pages. if($user->isLoggedin()) $selector .= ", has_parent!=2"; // Find pages that match the selector $results = $pages->find($selector); } /***************************************************************** Output *****************************************************************/ header("Content-type: application/json"); echo $results->toJSON(); exit(); Customizing values: if(wire('config')->ajax) { wire()->addHookAfter('Pages2JSON::getValue', function($event) { $value = $event->arguments(0); if(!is_object($value)) return; $page = wire('page'); if($page->template == 'thumbs' && $value->className == 'Pageimage') $event->return = $value->size(28,28)->url; }); } Here i swap URL of all Pageimage objects in JSON response to match thumbs. Simple hu?
  10. Alright, thanks Antti. was just mainly checking if this is something new, old, commonly used or not, but what you'r saying makes completely sense. Cheers for answer(s) guys.
  11. In nutshell it checks if url method is having anything hooked into it, if it dosen't, it calls real method locally directly from class and by passed hook system completely, cause there is nothing to run for, which obviously saves some micro seconds of time. So asking if there is any benchmark data, or something i could check and compare how big performance boost it actually is to check against local method vs run method via hooks (backbone). But yeah if you don't understand question, this might be for Ryan, thanks anyways Soma.
  12. Sorry, was refering class Wire to backbone, cause that's what it is. So backbone = Wire Also local vs hooked, when speaking about methods...
  13. Howdy So i'v been checking core modules past month now? It all looks good and i figured out this and that, but then i saw there this: /** * Return the web accessible URL to this Pagefile * */ public function url() { return self::isHooked('Pagefile::url()') ? $this->__call('url', array()) : $this->___url(); } /** * Hookable version of url() method * */ protected function ___url() { return $this->pagefiles->url . $this->basename; } When creating module or what ever it is, how often and when should i consider using local vs backbone(wire) methods? Is there how huge impact in processing if everything is driven trough backbone? Is this some old code that is still there and everything should be driven via backbone nowdays? Thanks for possible answers
  14. This is so cool! Thanks for creating.
  15. More elegant way to fix this is simply remove wire document root assumption and expect real DOCUMENT_ROOT to be replaced with Minify_CSS_UriRewriter::rewrite() method. So simply: Line 590: $_css_src = (!empty($_css_src)) ? Minify_CSS_UriRewriter::rewrite($_css_src, dirname($stylesheet['absolute_path']),wire('config')->paths->root) : $_css_src; To: $_css_src = (!empty($_css_src)) ? Minify_CSS_UriRewriter::rewrite($_css_src, dirname($stylesheet['absolute_path'])) : $_css_src; Fixes this issue, and all URL rewrites are done from DOCUMENT_ROOT instead of wire root
  16. Hi Nico, This looks great module and works perfectly. Some suggestions / ideas: 1) file name could be hidden by default 2) option to define ignore list for files / folders Even without those it's great, my 2 cents Cheers
  17. Great module, how ever it bugs with Reno theme, requires following: .colorpicker input { background-color: transparent !important; border: 1px solid transparent !important; color: #898989 !important; padding: 0 !important; } Because (/wire/modules/AdminTheme/AdminThemeReno/styles/classic.css): input:not([type=submit]):not([type=file]):not([type=checkbox]):not([type=radio]), textarea { background: none repeat scroll 0 0 #eaf0f2; border-color: #aec5cd #c7d7dd #c7d7dd; border-style: solid; border-width: 1px; color: #2f4248; line-height: 1.3em; padding: 0.4em; } So either Reno could strict it's styling rules, or module should add !importants, i'd go with first one Cheers
  18. Thanks for the answer kongondo, I mean that module classes are autoloaded and modules are loaded on demand (memory), yeah got that part. Cheers for answer, was just wondering since didn't see this anywhere.
  19. Howdy, Like topic states, is this how bad idea in general? I'v seen people ship own classes with modules, but didn't see people to extend modules to other modules, why? Is this because of bad practice? After all, modules are being autoloaded by system on demand, therefore classes are being available, and as far i saw, you can't install module that has dependency to other module, if parent module ain't existing. I am just asking if this is bad PW coding in general or just something no one really done before? Cheers
  20. Howdy, Just tried this module and it works great, but when used with some other markup manipulator module like TemplateEngineFactory which also hooks into Page::render, hook priority could be handy. As TempalteEngineFactory, like any view engine should output first, before any other manipulator hits the ground. I looked into it and since PageRender::renderPage() runs prior 110, TemplateEngineFactory, cannot TemplateEngineFactory run lower than that, or else its overrided by original PageRender. Also if AdminBars is installed, it's natural load order becomes before TemplateEngineFactory, so it gets rendered before actual output and is never visible. Therefore i suggest that either core priority level for PageRender::renderPage() is lowered or AdminBar::pageRender() is rised in order to get around this "problem". Before: $this->addHookAfter('Page::render', $this, "pageRender"); After: $this->addHookAfter('Page::render', $this, "pageRender", array('priority'=>1000)); This is only reasonable solution i came around with. Nice module btw, good job.
  21. This looks very nice module Wanze, thanks. One thing i don't understand. Why people hook into Page::render instead of TemplateFile::render, which is actual ultimate output buffer for templates. Forked your module and trying to figure out this and that, i like it mostly, just few things i wanted to test out. Sorry if this post is on wrong forum section, feel free to move it to proper place.
  22. Peter: I was CMS Made Simple Core dev until now, long story. Then we started looking new system with my partner and tested over 40 systems? Didn't first find suitable for our needs and i almost started building my own and then we found this, which architecture is closest what i had in mind myself. Plus whole ideology behind this system seems close enough what i would prefer. We maintained similar blog for CMSMS that Teppo maintains for you guys, dunno what will happen to that in the future, you can check that in here if you want http://www.i-do-this.com/ And thank you Now i gotta hurry for party, so check you guys later, have a good one
  23. Thanks for the answer Pete. I figured out this already and you can actually change process of home to point down the admin, which redirects you down to the admin, no matter what. Was looking for way to by pass PW bootstrap ProcessPageView and inject admin directly, but that didn't work, so i assume it was actually intended as it is. Anyways system looks awesome no matter what. Have a good new year change.
×
×
  • Create New...