-
Posts
6,798 -
Joined
-
Last visited
-
Days Won
158
Everything posted by Soma
-
Sorry to bother you, any news on this?
-
Have you added the check already? Creating modules means also maintaining them, continue to fix stuff. Edit: I also would suggest to name the module "PageListActionDelete". So it's a little more clear its extending the actions on the page list. Also before I forget it, would be nice to have it translateable too.
-
+1 look here and there
-
Image Thumbnail Module - Images not displaying
Soma replied to NooseLadder's topic in Getting Started
To get url of an image: echo $page->image_uploader->url; And from the thumbnail doc: echo $page->image_uploader->eq(0)->getThumb('thumbnail') If single image field echo $page->image_uploader->getThumb('thumbnail') -
So cool what you have done here. I'll for sure check it out a little closer soon. This is actually nice food for the community to learn and checkout, but also a very nice blog system. And even responsive! Keep up the good work, thanks!
-
Thanks Nico, this is basicly what I do. Though I got other github url to deal with (though it could be easily changed) but good to know github api.. I actualy also looked at your module when creating my module. New update 0.0.8 I commited a new update yesterday. Added additonal check for "allow_url_fopen" and throw error if not enabled. I changed to use copy() instead of curl. I tested it locally and on a low budget hosting and a good one, now it works on all without problems (though locally I got permission problems though not relevant). I found that using copy or file_get_contents would work better, curl gave me "open_basdir" (low budget shared hosting) error on which would cause problems if not configured correctly on server. So this should be better now. Not sure about other restrictions and limits (size?). Also improved the remove function to recusively remove the extracted folder after content is copied, it now also deleted .* files like .htaccess. If you already got it installed just click "refresh" then "update" the module. Oh and let me know if any issues arises. Edit: Heh, just refreshed and new categories and modules pop up! Love it.
-
have you tried to write checked="checked" ? Also PW I think stores it using value 1 or 0, but for the input html field you either only need checked="checked" or nothing (no value) attribute and it will be in the post as 1 or not at all, depending on it.
-
does that help ?
-
Thanks Ryan it works! Like this it can be used with a callback. Not sure what about jQuery adding it's own with random number and =timestamp, but using data: {} to overwrite it works. function callback_json(data){ console.log(data); } $(function(){ var $res = $.ajax({ url : "http://modules.processwire.com/export-json/admin-hot-keys/?apikey=pw223", dataType: 'jsonp', data: {callback : 'callback_json', 'of' : 1 } }); });
-
What apeisa said -
-
I know apeisa. If adding this callback it will be valid. I know I could also cache it and download it but wanted to have it responsive for mouse hover. But I added the summary as this is loaded already. I think any makes not much sense to show whole description in the admin. It would be nice to be able to make requests using ajax.
-
MacOSX Github App first steps Since ProcessWire modules directory supports and encourages you to use github for publishing modules and third-party content here's a little help getting started with github for mac. Go and install the app for mac here http://mac.github.com/ You'll have to first create a github account to where you can connect. Creating public repos is free, on top you'll see a "Free for open source" and a small button. https://github.com/plans Login in from your newly installed github app. Create new local repository by simply dragging the folder (your module) right into the app. The folder can be anywhere on your computer, maybe you choose to use the github folder automaticly created under ~user folder, or you decide. After you added it to github you'll see added a ".git" folder in your local repositiory. Now you'll see your files added in the app. Maybe you'll see the annoying ".DS_Store" file in there too. To ignore files simply right click on them and select "ignore". It will get added to the .gitignore file which now also appears in the files. Do the same and ignore it too. Now push the newly created repo to github using the button top right "Push to github". You'll be asked to enter a title and description then you can push it. It now will appear on github, but still empty. Now make your first initial commit, add a description i.e. "inital commit" and press "Commit" button. You'll see it add's a "Unsynced Commits" panel underneath. Press the button on top right "Publish branch" button and it will push it to the remote repository. You should now be able to see the files commited on your github page. On the repository page you'll see a "ZIP" download button. You can use that url to enter in the download field for the module when you add it to http://modules.processwire.com. Once you update the module, you have to enter a new version both in the module getModuleInfo() and on the module page. This makes sure people, also some apps using the webservice, know it is new and can update it. Screencats The following is a short screencats (no audio) showing me adding a new repositiory to github and update it using the mac github app. Screencast using MacGithubApp
-
Getting current template name - Adminbar bug?
Soma replied to thetuningspoon's topic in General Support
https://github.com/apeisa/AdminBar/blob/master/AdminBar.js#L4 -
"Allowed memory size" issue when working with many large $pages calls
Soma replied to evanmcd's topic in API & Templates
Yeah, I was faster and even right this time maybe! -
"Allowed memory size" issue when working with many large $pages calls
Soma replied to evanmcd's topic in API & Templates
Maybe using ..."limit=5")->getTotal() ? -
Sorry wrong brain. $allResults = $results1->import($results2)->sort('-modified')->find("limit=5"); Ryan can't help much here.
-
$allResults = $results1->import($results2)->find("sort=-modified")->limit(5);
-
PW variables in modules aren't same as in templates. you have to use wire("input") or $this->input.
-
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
-
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.
-
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'); } } }
-
If the returned html of the output is not enough, what do you want to change in it?
-
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 )
-
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.
-
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.