Jump to content

Soma

Moderators
  • Posts

    6,808
  • Joined

  • Last visited

  • Days Won

    159

Everything posted by Soma

  1. Sorry wrong brain. $allResults = $results1->import($results2)->sort('-modified')->find("limit=5"); Ryan can't help much here.
  2. $allResults = $results1->import($results2)->find("sort=-modified")->limit(5);
  3. PW variables in modules aren't same as in templates. you have to use wire("input") or $this->input.
  4. Thanks a lot for pointing that out. I'm not sure which would be the best solution. Also towards a solution that is compatible with most hosting environments. Thanks, I'd be glad to help getting this done, just think I could need some help in finding best methods to implement it and you know a lot more than I. It would be a great addition and already is. Well most important is that it is a nice put-on-top feature that still allows managing modules if no internet access is present or if the webservice is down. If anyone willing to help I would really appreciate it. Some more advanced users here? Originally this is meant to be proof of concept and makes a good module, but merging it with the already existing and coding all the "make it easy, nice and safe" will be some work. I just updated the Modules Manager module to have category select filter! It also show now the summary as tooltip if you hover module name I think if we take this route it would have to be well designed. I'm also wondering how it could be merged with the current with all the features needed. But have not made really come to conclusions. For sure some splitting and filtering would make sense using tabs or alike to separate core and third-party modules. Also some flags or categories to help filtering would be nice. What really is needed is still have the ability to keep it work without internet. Also deciding what we could do with modules like language packs, themes and such modules that are not meant to be installed. I'm a little fuzzy atm what all should be considered but it's a lot
  5. Not the first time I took a look again at how this could be done the most simple way, since page list tree is done using ajax php/js it's not really possible to hook or change it so it adds a class with the template name to the list item. If Ryan is willing to change two lines of code so a extra css class would be added, it would be easy from there to implement icons for different types of templates. Adding 1 more option here https://github.com/r...ist.module#L398 "template" => $page->template->name, Adding the class to the item here: https://github.com/r...ageList.js#L418 // change it to var $li = $("<div></div>").data('pageId', child.id).addClass('PageListItem ' + child.template); Voila, all items have the template name as class. Now one could create a module that adds a css file and some configuration on per template.
  6. If you say properties of the form, if you just want to change/add attributes of the InputfieldForm rendered you could do it like this with an auto load module: <?php class Helloworld extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'Hello World', 'version' => 100, 'summary' => 'An example module.', 'singular' => true, 'autoload' => true, ); } public function init() { $this->addHookBefore('InputfieldForm::render', $this, 'formHook'); } public function formHook(HookEvent $event) { // restrict to edit field form only if( $this->process == 'ProcessField' && strpos($_SERVER['REQUEST_URI'], 'field/edit?') !== false ){ $form = $event->object; $form->attr('class', 'MyCSSClass'); } } }
  7. If the returned html of the output is not enough, what do you want to change in it?
  8. There's been various mentions or requests already for something like page tree icons. Just to mention, there's also option to define the label rendered in the page tree using custom fields. You'll find this under tab advanced. Using this if you add an image field it will output the image name as label. Using this I did some hacking. After that I also created a module to add Image thumbnails to pages in the tree, http://modules.processwire.com/modules/page-list-image-label/, little different from the template icon, but it's in the similar direction. The process module responsible for creating the page tree list is https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/modules/Process/ProcessPageList/ProcessPageList.module Not sure what could or should be the way to implement such a feature, but thinking outputting the template name as class added to the pages could make it simple using css as you mention. The backend and everything in PW is using same API as you use (or can use) in templates, though using $this->pages or wire("pages") syntax instead of $pages, which makes it easy to get things done without the need to learn new things just because you're working on the backend. (although I seem to be repeating myself over and over, it can't be mentioned enough )
  9. Ah, well my AjaxSearch module isn't what he's looking for, it just to progressively enhance the search using ajax. Adding filter options is more about how you do it in regular html/php adding them to the form markup. PW then just plays a role when creating the query and performing the search according to those options. You could then simply filter by template or parent or anything you like. It would go too far writing example code down here, but I'm sure there's a thread about it, and if you give specific example what you want or even example code you're trying there's people here willing to help.
  10. Ryan, I'm trying to do ajax request to single modules. So far it would work (yes even cross domain), but the data returned is not valid. Can you check for ajax request and output the json different so it can be requested also from js? The trick is to add the callback get var and wrap the json in parathesis ( { json } ). Like this. echo $_GET['callback'] . '(' . json_encode($results) . ')'; Maybe you can test for yourself to make sure it works, or I will do. var jqxhr = $.getJSON('http://modules.processwire.com/export-json/'+mname+'/?apikey=pw223&of=1&jsoncallback=?', function(json){ console.log(json); } ); Thanks.
  11. Nice, also wanted to say I'd be happy if I can make it and it's depends on money and family. Need to maybe sell some modules
  12. Ok think it was only me being confused as you have 100 instead of 1.0.0 I'm sure I've seen 001 somewhere too. I always wondered but never bothered. I think all yours are correct, but here you go. class PagePathHistory extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'Page Path History', 'version' => 001, 'summary' => "Keeps track of past URLs where pages have lived and automatically redirects (301 permament) to the new location whenever the past URL is accessed. BETA TEST ONLY.", 'href' => 'http://processwire.com', 'singular' => true, 'autoload' => true, ); }
  13. No need to really learn OOP to make PW modules. What knowledge do you think you lack? As with everything, start simple learn from the big ones. Look at how modules in core or third party are done, look at HelloWorld.module. Basic modules mostly only require 1 file and it's more about what type it should be and how it's done in PW. Learning OOP will help you only understanding the backgrounds. Not saying it's not good, but maybe just start and see where you get stuck, then come here and ask. You might even figure it out on yourself, but count on the community to guide you. I mentioned I always have had problems understanding OOP and read about it for years (java, actionscript, js etc), I'm still bad in wrapping my mind around it and build something from scratch (even still now), but just starting to do something always helped me a lot. And not surprisingly PW lead me to understand even more as before while doing some fairly advanced modules I did not think was possible. The wonderful thing is learning PW will help you elsewhere too. The year using PW I learned more than the previous 5 years!
  14. Thanks Diogo, I think it dawns on me. So I have to write 010 or just 8. Got it. That has to be the most complex thing about modules in PW then. But why this method to write it in octal form? Is that common?
  15. Yeah so I'm utterly confused, can someone enlighten me? Ryan? I want to be able to write 008 version! Wait, is it supposed to only go from 0-8? And why you're telling you don't know why and don't know octals? Maybe I'm wrong but I would expect you know about that? *scratches head* Edit: I have no experience in proper versioning so forgive me my bothering, I'm might missunderstand this completely? Why is it using octals and the creator of it says he doesn't know? Sorry Ryan!
  16. Thanks Martijn! Yes there's many high quality modules as also exists in other frameworks or CMS' and I also think it depends a lot on the system and community. Yeah the simplicity and flexibility in PW is astounding and almost cries out "EXTEND ME!". The fact that it is a framework that is so well designed and using that foundation, the CMS as such is built using it makes it very versatile and logik. But the best part is that it is built modular using different types of modules and mini systems (process, fieldtypes, inputfields, js modules ...) and in the exact same way you can extend it and build modules that work exactly the same! You can take almost any module out from the wire/modules/ and move it to the site/modules/ folder modify it to your needs and install it. To go even further it uses same API as you use (or can use) in templates, the transition is almost seamless. So you can also look at core code and modules as reference and example. I'm not the very advanced php programmer and always got my problems with OOP, but after digging into PW after seeing how modules are done it took me no time to get into it and already built 15 modules in 1 year, AND IT WAS FUN! I'm the guy in love of least resistance and having fun . After using MODX 1-2 years, all I got was a half backed test module that had no purpose but was damn hard to setup, but also didn't attract me as much as PW did. Same goes for other systems that seem like having extra hard layer that's designed for modules, but too complicated to be fun, or like another system inside a system. So even if may not perfect in all regards PW is a great foundation that will show and have impact on other systems. MODX already is announcing a light weight distribution with 3.0, and I'm proud modern systems like PW played a role in it.
  17. Well I was mixing something, the octal was from the permissions. However, you really don't know why the versioning number in modules is bugged? Language Localized URl module has 008, but it show 0.0.0. Also 009 does. If entering 100 it works, or 007 too.
  18. Just made an update with some small improvements. Added also link to each module for its page on http://modules.processwire.com. I have now also added the module to the modules directory http://modules.processwire.com/modules/modules-manager/ so it can now also be updated using the Modules Manager. I just tried and it's possible so it updates itself!
  19. I just hit "refresh" in the admin and there it shows the updated version! So cool
  20. Thanks, can you clarify my last question from the previous post?
  21. I just commited an update with some things corrected and improved. Also changed install parent to "Setup". Not necessary now, but also added apikey and remoteurl config. Thanks Nik for the feedback. I changed the function to private and not static, so it should be ok. I haven't really tested it before, but should work now and throw some infos that if the dirs are not writeable. Thanks Ryan, very helpful infos. I removed the chmod 0777 as it was to test. And I use now wireMkdir. Good to know. Also corrected the deinstall typo! Point #5. Good point. I'll try to use the array keys for name => title. Will let it for now. As for the work on it and future. I'm pretty sure at some point I would love to get any help (any time), I would love someone with more experience in all those advanced stuff could help. Especially if it should be a core implementation once, I think you would be the person #1 to help and take it over. But I also think there's so much about it that can or should be done my head already explodes.
  22. Sorry, thanks for mention it, yeah it's under module page. I'll update so no confusion, lol I forgot to change the id. Am working on some things at the moment and coming back later. Thanks for the feedback so far.
  23. I noticed something also only while working on the Modules Manager module Ryan, what's about the module version in code (000)? Is it also valid to write 1.0 or 1.0.1 in getModuleInfo array? I noticed some people (diogo, nico) use this to write the version and I think it's wrong. Considering this it is a little annoying that one have to insert it manually and in two different formatting. On the module directory you enter 1.0.0 in the module code 100. Wouldn't it be better to make it consistent? Also to understand it in general, why does 008 not work and return 0 or 0.0.0 ? I figure it is because it's octal? But why?
  24. Just a simple Newsletter-Tool of a co-worker iframed.
  25. Thanks Pete. I'm not sure this should replace the PW module page, I see it more as a nice extension to it. So the current modules page is nice for installing and have a overview of ALL modules and still allow for manual downloading and installing. The modules manager is just for downloading and seeing what modules are available or already installed and to update them. Many things are still unconsidered and untested (only locally), but figured it would be a nice practice to see how far it can get with given new module directory.
×
×
  • Create New...