Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/27/2013 in all areas

  1. Oh, I've found a sponsored version: kongondos avatar was dressed up by: Beechfield, Amazon & brille-24.de If you want sponsoring on your own, here is the photoshop-file: kongondo_avatar_dress-up__psd.zip
    5 points
  2. ------------------------------------------------------------------- LanguageFieldTabs is now included in ProcessWire by default (version 2.4). Unless you are using version 2.3 DO NOT install this module, instead navigate to Modules and then core and you will find the module in the Language section ------------------------------------------------------------------- LanguageFieldTabs Beautify and organize you Field Languages into tabs! DOWNLOAD - Github DEFAULT UI UI IN "UNIFY" ADMIN THEME Sorry for the lack luster write up, will add to Modules Directory later, late, long day tomorrow. Enjoy! (very much beta maybe alpha, minimal testing, just quick evening idea at this point). Changelog v1.0.2 Improved styling capabilities (added surrounding class "LangTabsContainer" ) Added admin wide support Fixed description text order (was being pushed to bottom) v1.0.3 Added support for toggling tabs display and faded labels to represent empty fieldsv1.0.4 Fixed tabs destroy error Moved toggle into Inputfield ui-widget-header
    3 points
  3. I like it! I'll take it! Just what the doctor ordered, thanks, hehe!
    3 points
  4. I'm really liking this module. Thanks for making this! I used it yesterday, all day on a multi-language site that I'm developing with 5 different languages. It has really made the interface a lot nicer to look at and use. It makes me think we should have this in the core. There are two things I think I'd personally add to it though: I'd make the tabs that have un-populated text a little different, perhaps a little faded or lighter text or something to indicate the empty state. Either that, or the populated tabs bold. I'd add an option to to switch between tabbed view and regular stacked view. The reason is that I anticipate clients have cases where they are translating and want to see the text in multiple languages at the same time. But overall tabbed view seems like a much better default than what we've got now. Has anyone tried this with Teppo's text version control module? I'm wondering if it would break that... will probably find out later today.
    3 points
  5. I've been lurking these waters for quite some time now, being a mildy inactive frequenter of the forums. Almost everything I do on my own is PW-based now (I work as a frontend developer for a University, on my "day job"), but I just realized I had never published any work here! This is a website for which I did the implementation (it isn't my design). PW makes creating specific hierarchies amazingly simple, so I can build a very specific html history-driven website in a snap, which is amazing... So here it is: http://mmbiotechnology.com/ (It is all in Portuguese, I'm afraid. On a related note, it uses the amazing language localized url module... Or rather is doesn't, as no one bothered to write up the english version -,- ) Cheers
    3 points
  6. Thanks for working on this. It works perfectly with PHPStorm and makes writing templates even faster and more precise than before. Please keep up the good work!
    2 points
  7. Don't suppose you want to send a copy my way to have a peek at before you disappear for 3 weeks on your InterRail trip? You're such a tease!
    2 points
  8. WireArray implements PHP's ArrayAccess interface, so actually the something like $images[0] ideally would work. The reason for the inconsistent behavior is that images are indexed by filename, not by number. So $images['filename.jpg'] would be the actual ArrayAccess implementation. However, I think I could find a way to make it work by re-implementing the offsetGet() method in the Pagefiles and having it do a slice() to return a specific index. Thanks for reporting it!
    2 points
  9. First of all, create a template called "tags". It is totally fine to leave as it is, just a "title" field, no need for a PHP-file (for now). To be sure, only allow children with template "tags" in the template "family" tab. Then create your hidden "tags" page. Put same tags in it (that means: create children pages with your tags as title) if you like. Correct. Template for selectable pages is "tags". You can also define your hidden tags page as parent. No template file needed (for now). Not necessarily. or from the page select field itself (very convenient). So for that you need to have a .php file as template for the template "tags". First, create your tag list like this: echo "<ul>"; foreach($pages->get('/tags/') as $tag){ //iterate over each tag echo "<li><a href='{$tag->url}'>{$tag->title}</a></li>"; // and generate link to that page } echo "</ul>"; (totally untested, but you'll get it). Since the tag pages have no template yet, this will throw an empty page (or 404, don't know). So let us create a template for the tag pages, which lists all pages with that tag: // Beginning of your template here (head etc.) // select all pages with the tag of this tag page $thisTag = $page->title // Current clicked tag $tagPages = $pages->find("Tags.title=$thisTag"); // select all pages where page field "Tags" contains a page with title of our tag foreach ($tagPages as $tp){ // iterate over the pages with that tag // and generate some teasers (or what you like) echo " <div class='teaser'> <h3>{$tp->title}</h3> <p>{$tp->summary}</p> <a href='{$tp->url}'>Read more...</a> </div>"; } // Rest of your template here (footer, javascripts etc.) as I said, totally untested, but this should point you in the right direction.
    2 points
  10. i don't know very much about india (you are based there, right?) and the market there. but what i see from your portfolio website you are a professional. so my advise would be to take at a minimum the average rate that good professionals get in india and to stand it if clients refuse to pay this rate. of course, this requires a second income as long as your client base isn't strong enough. if you have no other choice than accept lower rates for low-level jobs but never advertise that you've worked on this projects and never tell everybody. they simply doesn't exist. if everything you do in public is focused on professional rates you WILL get better clients.
    2 points
  11. I've tagged release 1.0.0 and the module is now listed in the modules directory.
    2 points
  12. You can't do this just out of the box but with a autoload module you could easily accomplish this. Also there's useful needed features in there for an editor. Why is this a problem? It may not necessary in most cases... In PW, almost all of these things can be changed modified using hooks on what builds them in the admin. So if you really want to do it, the best way would be through a module like the /site/modules/HelloWorld.module It shows some example of hooks and is worth a look and have a play anyway. This following module hides the InputfieldWrapper "Who can access this page"? in the settings tab for user having a role "editor". <?php class AdminHelperHooks extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'My Admin Helper Hooks', 'version' => 1, 'singular' => true, 'autoload' => true ); } public function init() { // add hook to the page edit module and the method that creates the wanted fieldset $this->addHookAfter('ProcessPageEdit::buildFormRoles', $this, "removeSettings"); } function removeSettings(HookEvent $event){ // check what role the user has, if not has editor role do nothing if(!wire("user")->hasRole("editor")) return; // $event->return being the inputfield wrapper $wrapper = $event->return; // set the inputfield wrapper to hidden $wrapper->collapsed = Inputfield::collapsedHidden; // we're done } } Create a new file AdminHelperHooks.module with this code in a new folder /site/modules/AdminHelperHooks/ Install and test with editor user.
    2 points
  13. Hi everyone! With Batcher you can batch-edit and create Pages in the Pw Admin. If you install this module, you get a new Page "Batcher" under Setup. Modules page: http://modules.processwire.com/modules/process-batcher/ Github: https://github.com/wanze/ProcessBatcher Editing How does it work? Search your pages with a selector. You can check if you want to include also hidden/unpublished pages with the filters. Select the pages you want to execute an action (the action only gets executed on "checked" pages). Select the action and if necessary, additional data like the new parent or the new template. Execute. Supported actions: Publish/Unpublish Pages Hide/Unhide Pages Lock/Unlock Pages Trash Pages Delete Pages Change Parent Change Template Batcher does the following permission checkings for the current user: Don't display pages that are not editable Remove Actions if the user doesn't have the permissions (page-delete, page-move, page-template, page-lock) Important notes: When changing a template, data in fields of the old template which are not assigned to the new template gets deleted. When changing the parent, the template of the new parent must accept the pages template as children. This is a setting in the template under "family". Creating How does it work? Select a parent where your new pages will be added as children Add as many pages as you want by clicking "add Page" Click "Create Pages" You must enter a title and choose a template. The name is optional: If left empty, Pw will generate this for you. Includes permission checking and Family template restrictions. This means in detail: The selected parent must accept children and their template The pages template must accept the parents template User needs the permission to add children to the selected parents template User needs the permission to create Pages for the chosen Template Batch-creating tips The chosen template and the statuses are always cloned from the last row. So if you need to add 30 pages with the same template, define it first and the click "add Page" - it'll make your life easier ;-) You can drag & drop the table rows should you want to change the order. The dragging looks ugly but it works. For the lazy dogs and keybord hackers among us, you can add a new row by pressing "ctrl+n". This works (at least in firefox) only if no input has focus. After adding a new row, the title input gets the focus. By pressing 3 times tab you arrive at the published-checkbox, here the short-cut works. Restrict Batcher for a user to only allow editing or creating Create permissions "batcher-edit" and/or "batcher-add". As soon those exists, the module checks if the current user has the permissions. If you only need batch creating, check out the following module by Soma: http://processwire.com/talk/topic/2138-process-tools-create-pages-wip/ Cheers
    1 point
  14. Textformatter for Google Maps https://github.com/teppokoivula/TextformatterGoogleMaps This module looks for Google Maps URLs (such as https://maps.google.fi/maps?safe=off&ie=UTF-8&q=disneyland,+paris) within paragraph (<p></p>) HTML tags and automatically converts them to embedded maps. Configurable options include embed type ("static" or "iframe"), API key, responsive embedding and Google Maps for Business settings. Other than that, it's pretty basic stuff. Original regexp for grabbing maps links was posted by Ryan (I believe) here on the forums, but I couldn't find that post anymore. I've altered it to better suit the needs of this module, added some configurable features (part of which, such as makeResponsive() method, are again based on Ryan's TextformatterVideoEmbed module) and so on. Hope someone finds it useful. (By the way: if you're going to use Google Maps for Business settings, please read the notes there carefully. Google doesn't exactly recommend storing your private key the way module settings are stored..)
    1 point
  15. This module generates a "stubs.php" file containing PHP-classes with documentation for the properties of each Template, based on it's fields - which means IDE support (auto-complete, inspections, documentation) for templates in modern IDEs that perform static analysis, such as PhpStorm. The output looks like this: <?php /** * Generated by TemplateStubs module 2013-04-13 15:29:33 * This file may be overwritten at any time. */ namespace tpl; use Page; /** * "basic-page" template * * @property string $title Title * @property string $headline Use this instead of the Title if a longer headline is needed than what you want to appear in navigation. * @property string $summary Summary * @property string $body Body Content * @property string $sidebar Sidebar * @property Pageimages|Pageimage[] $images Images */ class basicpage extends Page {} To use the generated documentation, start your template-file like this: <?php /** * @var tpl\basicpage $page */ Documentation and more details on this page: https://github.com/mindplay-dk/TemplateStubs You can consider this an alpha-release - I haven't tagged a release yet, and some details like template-class naming convention may change before I tag release 1.0.
    1 point
  16. I'm pretty close to having native core support for multi-language page names. It's something I wanted to add originally in 2.1, but just didn't know exactly how without adding lots of overhead. After marinating on it for a long time, an easy way to accomplish it finally became apparent. A nice thing about it is that it does it with near zero overhead. It won't be as fancy as the LanguageLocalizedURL module, but it should be good for people that have relatively simple needs. It's the one feature that we were missing that would really let the multi-language fields sing, and it should lead the way for making more fieldtypes multi-language capable. It works by enabling you to specify an alternate name for each page, for each language. When a page is accessed at its alternate URL, then the language is automatically detected and set for the request. Combined with multi-language fields or multi-language alternate fields, it provides a full multi-language solution without need for multiple trees or having to use any code to set the language. It's not the right solution for all situations, but for some situations, it'll be quite nice. Lets say you've got the page /about-us/contact/. For the "about-us" page you've set the Spanish language name to be "quienes-somos", and for the "contact" page you've set the Spanish language name to be "contacto". When the URL /quienes-somos/contacto/ is accessed, it's technically referring to the same page as /about-us/contact/, except that the user's language is automatically set to Spanish, and thus any multi-language fields output in Spanish. Calls to $page->url on any other pages also output the Spanish URLs. You don't have to define alternate labels for all pages if you don't want to. So long as there is just one of them in the URL (like in the rootParent, for example) then it'll be able to detect the language automatically. In order to avoid problems with having multiple URLs displaying the same content, it doesn't let you access the page with a URL like /about-us/contacto/ (English and Spanish mashup), because both of those pages have their names translated. So if you accessed such a URL, it would 301 redirect to the Spanish version. Here's a screenshot that might help to explain how these things are defined. This will be committed to the core within the next few days, as part of the LanguageSupport group of modules, but I'm going to leave it as an uninstalled alpha then beta module, until ProcessWire 2.4.
    1 point
  17. click edit, then click use full editor, then edit topic title
    1 point
  18. Added support for toggling tabs display and faded labels to represent empty fields. Rough for now but useful for feedback I'm sure. Thanks guys.
    1 point
  19. I prefer the faded style suggested by Ryan rather than a strike-through...
    1 point
  20. Is this what you are looking for: http://processwire.com/talk/topic/519-pagelistselect-issue/
    1 point
  21. Hi I know this is an old thread now, but I'm hoping I can provide some useful information relating to this error, as I encountered it myself recently when installing ProcessWire on Vidahost Cloud hosting. I eventually managed to trace the problem back to a probable cause, and a solution - please bear with me The "non-object" mentioned in the error was the "type" property (which was NULL) of the fieldtypes list for a template (the loop in Pages.php). It was NULL because fieldtype information was not set when initialised. ... because the list of modules could not be loaded and returned to the functions relying on them. I think this was caused by the findModuleFiles() function. Although it seemed it could create the file on the first call of this function, the combination of network file system in the cloud hosting (which introduced a delay in file access) and the LOCK_EX parameter meant that the data couldn't actually be written to it. On next calls to the findModuleFiles() function, the cache file "exists", but its empty contents are returned - resulting in the error. From testing, my proposed change removes the LOCK_EX parameter, which allows the data to be written to the file correctly. In addition, if the cache exists - the content is only returned if the array isn't empty. My proposed code changes are a pull request on GitHub if anyone else encounters this problem.
    1 point
  22. I'd probably need to see your configuration for the module, as well as exactly what you've put as the link in CRON - you can PM me a screenshot of the config if you like.
    1 point
  23. Problem now solved! I should have used the site profile exporter module from the start - I started fresh with it, and it did the trick without any problems at all (though I did make sure to change htaccess.txt to .htaccess before I ran the installer.) Thanks for the great module, Ryan!
    1 point
  24. Found the solution myself, I can't just set the second parameter of pageName to true, I have to set it "Sanitizer::translate". Correct code that works: $page->name = $this->sanitizer->pageName($page->title, Sanitizer::translate)."-".date("d-m-Y", $page->getUnformatted(date));
    1 point
  25. A coincidence, hide it with a module http://processwire.com/talk/topic/3159-hide-settings-tab-in-page-edition/
    1 point
  26. Given that this piece is informational only, and not tied to any user input, hiding it with CSS or JS seems adequate. This one may be tricky to target with CSS since it doesn't have a defined id attribute. But I think you could do it with: #ProcessPageEditSettings .InputfieldMarkup:first-child { display: none; } You can put this in your own css file in /site/templates/styles/admin.css. Then edit your /site/templates/admin.php and put this at the top (after the opening php tag): $config->styles->add($config->urls->templates . 'styles/admin.css');
    1 point
  27. Doesn't matter in the main.js or inputfields.js inside the document ready. Speaking of the /site/templates-admin/scripts/main.js Depends if you have a custom admin theme installed already or not. If not and you use default admin theme, you can copy the /wire/templates-admin/ folder to your sites folder and edit away.
    1 point
  28. Ok think I got a way to change the axis on sortable. Problem was that PW only inits the sortable for list greater than 1. So I got an error with the script that it can't set the "option" prior to initialisation. I made it work with: $sortableLists = $(".InputfieldFileList"); $sortableLists.each(function(){ if($(this).children('li').size() > 1) { $(this).sortable( "option", "axis", "none"); } });
    1 point
  29. @kongondo - I noticed when adding this that Firebug shows lots of images not working so will look into this later on. @teppo - Not sure. Might be possible, might not, but I didn't see a setting for it. @Nico - yep, so we should probably add more people as moderators for more forums
    1 point
  30. @Macrura - Most minified files have worked for me, but now I see that setting I guess they didn't have .min in the filename. @totoff - I just put everything on there usually as I didn't want to faff around with the core Minify directory for when I update the module, but I guess it's safe to run it without that folder. Best way to check is upload everything, check it works and then delete that folder and check it still works - not a lot can go wrong and it would be easy to put the folder back again
    1 point
  31. Maybe you can recover your avatar from the MODX forums
    1 point
  32. You need an Avatar one of these days Kongondo! If I recall, WillyC made you a pretty awesome one awhile back. Though if you like the anonymous man one, maybe we can at least dress it up a bit (perhaps a hat, ears, gratuitous lens flares or something?)
    1 point
  33. Name is a special property not a field same as other fields, so you need to tell it what language you want. echo $page->localName($user->language); or echo $page->get("name$user->language");
    1 point
  34. Fantastic job mate. I love that it's embraced larger screens yet the text remains more or less where you'd want it as a user. Animations look slick to me (Chrome OSX). Nice one!
    1 point
  35. Hi everyone. I'm coming to an old thema of mine. When it comes to present different sized and different orientated images on screens, it is always a bit frustrating. Maybe most time (on desktop) there is a landscape oriented widescreen, on which you can show a panorama image (2:1) very large but that it fits into the viewport. If you want to show a square image (1:1) you only have the half (content/amount?) of surface area. (The image only has half superficial content). And if you want show a Portrait (maybe 2:3) this image is somewhat more smaller displayed than the square one. So, I'm searching for some math that calculate dimensions depending on a equivalent superficial content and depending on the available viewport. Puh! But maybe it also shouldn't be a (technical) linear one. when downsizing the panorama to an equivalent, it looks a bit poor, alone in the viewport. For example, with the width and height of an image one can create a superficial content number: 100 is a square, 200 is a 2:1 and so on: 1:1 = 100 5:4 = 125 4:3 = 133 3:2 = 150 2:1 = 200 Is there anybody on the forums who can build a elegant maths formula for that? Or there are other suggestions, thoughts to that?
    1 point
  36. There's a little glitch in this module. It tries to create tabs in fieldsets. Though not ideal, the code below will remove the unused div with uncomplete ul. $(".ui-tabs-nav").each(function(){ if($(this).find('li').length == 0) { $(this).parent('.langTabs').remove(); } });
    1 point
  37. Oh man, I love this idea, installing!
    1 point
  38. You misunderstood what I meant with max width. I meant the width of the larger viewport side. So maybe what you have in mind already. It was just a little confusion what the desired result is with all those screenhots . I'm just curious what you plan to do if ratio/orientation changes or if images have extreme ratios? Meaning to calculate the space of the area and resize the images according to that may result in having a image larger than viewport... Well I once I had such a calculation (can't remember exactly) It should be pretty easy to get a max width or height depending on orientation ratio. $vw = 600; $vh = 600; $spacing = 50; $images = array( array(3000,1800), array(2300,2300), array(1500,2000) ); $ratio = $vw/$vh; if($ratio < 1) { // portrait $max = $vw - $spacing; } elseif($ratio > 1){ // landscape $max = $vh - $spacing; } else { // square $max = $vh - $spacing; } foreach($images as $im) { if($im[0] > $im[1]) { // landscape image echo "w: ". $max . " h: " . round($max/$im[0] * $im[1]) . "<br/>"; } elseif($im[0] < $im[1]) {// portrait echo "w: ". round($max/$im[1] * $im[0]) . " h: " . $max . "<br/>"; } else { // square echo "w: ". $max . " h: " . $max . "<br/>"; } } And this would be a area square calculation and you'll quickly see what I mean. $vw = 800; $vh = 600; $images = array( array(3000,1500), array(2300,2300), array(1500,2000) ); $area = $vw*$vh; echo "area: " . $area . "<br/>"; foreach($images as $im) { $r = sqrt($area/($im[0] * $im[1])); $w = floor($im[0] * $r); $h = floor($im[1] * $r); echo "w: ". $w . " h: " . $h . " (area = " . ($w * $h) . ")<br/>"; }
    1 point
  39. Not sure what you mean with these .json and .zip files, but I'm guessing you're saying that they weren't there in some language pack you've downloaded? Not all language packs contain all files -- there may be more translatable phrases now than there were when the language pack was created etc. so you'll have to either translate these manually or post a heads-up about these to the maintainer of that particular language pack. Anyway, if you want to translate this file manually then just follow these steps: Log in, go to Setup > Languages and select target language At the bottom of "Language translation files" follow the "translate new file" link Type whole path (\wire\modules\Inputfield\InputfieldPage\InputfieldPage.module) in the "File to translate" input Translation page should open -- now you'll just have to translate phrases manually and save If I'm understanding something wrong here, please provide some extra information about what you're exactly trying to do.
    1 point
  40. Happy Birthday Roope! I personally don't like having arrays in GET variables (they are overly verbose and make ugly URLs). But if you want the MarkupPagerNav to keep arrays in their native GET variable state, you can tell it to by using the 'arrayToCSV' option and setting it to false. echo $mypages->renderPager(array('arrayToCSV' => false));
    1 point
  41. @pwired, there isn't any software that keeps compatibility with old versions of modules forever. That's why I think it's great that you don't have to use lots of third party modules with ProcessWire, and everyone should be aware of the risk of making a website completely dependent of them. Anyway, no one is forced to upgrade immediately to a latest version (or even at all), and Ryan shows he is always very concerned about breaking things for people, so I'm pretty sure that when it comes the time when that step really has to be taken, all modules (or a good alternative to them) will be already compatible. One thing I think it's important to keep in mind here is that software has to evolve. And this evolution will always be a balance between backwards compatibility and new and better features. You really don't want to use a software that stopped in time...
    1 point
  42. But now cheatsheet is a PW site and Ryan can edit it easily himself.
    1 point
  43. Glad you guys like it, Pete did a phenomenal job and was great to work with. More modules to follow soon, standby!
    1 point
  44. PS: things are already simple - nothing wrong with making them simpler though, especially when it's no additional work or overhead for those using the module and working with an IDE. For me, personally, having full IDE support for any piece of PHP software has become a sign of high quality - it means everything can be validated automatically, which usually means it has been. You can't expect a person to do the same for 10,000 lines of code on every release. And vice versa, if a computer can't infer the meaning of your code, how can you expect a person to? Whether you have IDE support for the users who use an IDE or not, having IDE support means you have automatic safeguards and checks that cannot be performed by a person.
    1 point
  45. You only have a handful of Page objects and Fields? I think you misunderstood - this does not provide IDE support for ProcessWire (which still needs a lot of work in this area) but for your templates and fields. I'm sure you have more than a handful on complex sites, and I'm prertty sure they're not always the same? It's not about simple or difficult, it's about proofing your work - knowing in advance if you misspelled a property-name, or not having to go back to find the name of a property on an admin-screen, it saves time. With inspections in PhpStorm, there is also the added benefit of being able to automatically find errors - if you have dozens of templates and you have to make a change like renaming or deleting a field, automatic inspections will instantly reveal which templates are affected. Most of my day-to-day work is not little projects, but large complicated business-systems - while I used to be able to keep it all in my head, I'm not getting any younger. A good IDE will help you stay fast and accurate when you grow older, wait and see
    1 point
  46. I've been asked how to integrate Will Bond's Flourish library with ProcessWire so I thought I'd post the code I use. I downloaded the Flourish classes (not the whole flourish project) and put them into /site/.flourish. I then pasted the following into the top of my head.inc file. function flourish_loader( $class_name ) { // Customize this to your root Flourish directory $flourish_root = wire('config')->paths->root . 'site/.flourish/'; $file = $flourish_root . $class_name . '.php'; if (file_exists($file)) { include $file; } } spl_autoload_register( 'flourish_loader', true ); After that, you should be able to use flourish classes anywhere in your templates. NB, if you do download the whole flourish project into .flourish, then read Alan's post on how to adapt the above to your layout.
    1 point
×
×
  • Create New...