Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/04/2016 in all areas

  1. Hi Spica At my company, I've needed the same functionality so I've been trying to work it into the module. It pretty much works, but I'm not sure if this is the best way to modify the fieldtype module to work like this with a 'virtual' field and multiple selectors - it seems like a bit of a hack. It will also order results by distance regardless. https://github.com/CloudDataService/FieldtypeMapMarker/tree/develop I apologise for the formatting/whitespace diff. Example - assume the MapMarker field is called 'geo', I would search like this to get all 'place' pages where the map marker is within 30 miles of lat/lon 54.97,-1.62. template=place, geo.unit=mi, geo.distance<30, geo.point_lat=54.97, geo.point_lng=-1.62 In the results, you can display the distance like this: // Centre of the search area: $lat = 54.97; $lng = -1.62; $results = $pages->find("template=place, geo.unit=mi, geo.distance<30, geo.point_lat={$lat}, geo.point_lng={$lng}"); foreach ($results as $result) { // Calculate distance between result's marker and our search centre $distance = round($result->geo->distance($lat, $lng, 'mi')); echo "<li>{$result->title} ($distance miles away)</li>"; } ?> Hope it helps anyway.
    7 points
  2. hey kixe, also the best wishes to you would you mind doing a short screencast so that we do not have to install it, create the fields etc... http://www.cockos.com/licecap/ is a cool small tool to do that in seconds on win/osx. it creates a GIF so you don't even have to upload it to youtube or the like. just record and post it directly here in the forum. thank you for sharing your module
    5 points
  3. To put some light on the differently shaped symbols you're describing: The straight ones are from an typographically background not even quotes, but unit-symbols " for inch or arc-minute and ' for arc-second. The slanted ones you're describing are the typographically correct symbols for quotations and are most of the time formed like commas. As TextEdit is not a code editor, but a simple text writing tool it can be the case that quotes are automatically converted to the correct ones, which, as you noticed, do not work in code as they are other symbols. For those questioning, why correct quotes are most of the time not even on the keyboard layout, that's a remnant of the time of typewriters, where space, material cost and letter distribution where driving the keyboard layout evolution. Typographic correctness just wasn't valued as much as those other issues. Edit: For code editing I'd suggest using dedicated software, which won't make any automatic typography replacements and sometimes even highlight such errors.
    4 points
  4. I was looking for a more comfortable solution to add pages from a PageField Select. I ended up in this small module. Which is quite simple, but very useful. I created a PageField and another field of Type AddPage (requires FieldtypePageTable) with same settings for template and parent. Now I can easily add the page in the Modal. If you need it, take it as a Christmas Present from my side. (no christmas smiley available ... ) Dear Ryan, dear community, I wish you all the best for christmas and the upcoming year. <?php /** * Excellent side dish to Fieldtype Page. Doesn't store any data. Provides comfortable page creation. * * made by kixe (Christoph Thelen) 22.12.15 * Licensed under GNU/GPL v3 * * ProcessWire 2.x * Copyright (C) 2015 by Ryan Cramer * Licensed under GNU/GPL v2, see LICENSE.TXT * * http://processwire.com * * */ class FieldtypeAddPage extends FieldtypePageTable implements Module { public static function getModuleInfo() { return array( 'title' => 'Fieldtype Add Page', 'version' => 100, 'summary' => 'Excellent side dish to Fieldtype Page. Doesn\'t store any data. Provides comfortable page creation.', 'author' => 'kixe', 'requires' => 'FieldtypePageTable' ); } public function init() { // prevent data storage $this->addHookAfter('FieldtypePageTable::sleepValue', function($event) { $event->return = array(); }); // unneeded configuration fields can be removed $this->addHookAfter('FieldtypePageTable::getConfigInputfields', function($event) { $inputfields = $event->return; $page_behavior = $inputfields->children()->get(2); $removes = array('sortfields','trashOnDelete','unpubOnTrash','unpubOnUnpub',$page_behavior); foreach ($removes as $remove) $inputfields->remove($remove); $event->return = $inputfields; }); } } Screencast
    4 points
  5. Hi, I read the blog articles and many planned improvements and new features. At the moment I do some tests with devns branch and maybe switch over to it. ProcessWire's front-end framework (for the admin) I like the PW backend. It shouldn't be more complex or slower. Simplify it and maybe reduce dependencies (jQueryUI?) to make it faster. If modules like inputfields (frontend file uploads), login (swap out backend admin messages), .... will be modified it would be great to keep frontend usage in mind. I know that isn't the PW intention, but it would be great to reuse login module, form api... Other systems deliver "basic modules" like login, register while developers have to write custom code or use 3rd party modules. I like to write my own modules and learn more about PW, but more stable frontend useable modules (= existing core modules used in the backend) would make PW more attractive for new users and could increase the community.
    3 points
  6. Did you change allowed parents/children options on the family tab for your templates?
    2 points
  7. The problem is very likely something not visible in your post above. Testing with the setup below, I had no issues getting this to work under latest version of the devns branch: <?php # /site/modules/TestHook.module class TestHook extends WireData implements Module { public static function getModuleInfo() { return array('autoload' => true); } public function init() { $this->addHookAfter('WireHttp::send', $this, 'hookCheckAuth'); } public function hookCheckAuth(HookEvent $event) { die("dying"); } } <?php # /site/templates/basic-page.php $http = new \ProcessWire\WireHttp; $http->send('/');
    2 points
  8. As a first step, you could try using the SessionHandlerDatabase module to see if that makes a difference. It's included in core, but not installed by default.
    2 points
  9. I don't have an answer to this question, but I suspect it has to do with the very nature of PW that attracts people that are more focused on work and GTD and less worried about social media. At least I like to think that's the reason
    2 points
  10. Page Field Edit Links GitHub: https://github.com/thetuningspoon/AdminPageFieldEditLinks Direct Download: https://github.com/thetuningspoon/AdminPageFieldEditLinks/archive/master.zip This module is based on--and is the successor to--Macrura's AdminPageSelectEditLinks (https://processwire.com/talk/topic/8477-adminpageselecteditlinks-module-for-enabling-edit-links-on-multipage-selects/) Page Field Edit Links adds modal editing capability to ProcessWire's Page fields in the admin editor, allowing editors to easily view and edit the content of any page(s) that have been selected, as well as create new pages without leaving the current screen. Edit links are updated in real time when new pages are added to the field. Compatible with all available types of Inputfields including Select, SelectMultiple, Checkboxes, Radios, AsmSelect, PageListSelect, PageListSelectMultiple, and PageAutocomplete.
    1 point
  11. PageTableExtended Download here: http://modules.processwire.com/modules/fieldtype-page-table-extended/ Extends the Processwire PageTable field for rendering table row layouts. This is great for editors, because they actually see at a glance what the table rows consist of. What it does Turns the Processwire Fieldtype "Page Table" from this: into something like this (sorting capabilities of course still functional): See it in action: Requirements FieldtypePageTable installed (part of the core since Processwire 2.4.10.) Templates used for PageTable need a file associated (otherwise nothing gets rendered) This render method is meant for sites where the PageTable templates only render part of the layout, not complete websites. But you also can define what will be rendered (see below). Options Render Layout instead of table rows Check this for seeing the rows rendered. You can easily turn off the complete functionality by unchecking this. Path to Stylesheet Since the parts are unstyled by default, it is a good idea to define styles for them. All rendered templates are encapsulated in a div with the class "renderedLayout" so you can style them with: div.renderedLayout h2{ color: green; } The path is to be set relative to your templates' folder. Reset Admin CSS Since the parts are rendered inside the Admin, common styles of the Admin Interface apply also to your layout parts. This is not a bad thing, because especially text styles are well integrated in your admin's theme. But if you like to override the admin styles in your table rows completely (more or less), just check this box. Don't forget to define a custom CSS then! Advanced Since this module is meant for parts of your layout you already have defined for your frontend templates, it is a good idea to use a preprocessor like Stylus, Sass or Less for building the custom CSS file. Just outsource your layout part definitions in an extra file, compile that in a separete CSS file and use this as custom CSS for this module. Since your CSS is should be built in a modular way, this works pretty well ;-) Will write a tutorial with a use case once finished testing. Notes: Github: https://github.com/MadeMyDay/PageTableExtended If you want to get rid of the unnecessary step for entering a title before editing the page, just set the "autoformat" value as suggested in the PageTable settings. If you don't want to use a title field at all, see this post from Soma Will put it in the module repository once finished testing. Please test it and give feedback. I haven't used GitHub for a long time, please check if everything is in place and if this will work with the modules manager and the new core module installer once added to the repository. Have fun Module is in the repository now: http://modules.processwire.com/modules/fieldtype-page-table-extended/ Please use GitHub for instructions, I made some additions there.
    1 point
  12. It's hard to say definitely, but most times this is an issue that occurs on shared hosting. MySQL has a limit on how many concurrent connections it serves (151 by default, though usually set higher for shared db servers). If this number is reached, new connection attempts return with the error you quoted. If you're on shared hosting, check with your hoster if other users are eating up connections. If you're on a dedicated server, also look if there are other tasks/programs connecting to MySQL at the same time (for example backup/maintenance scripts or database logging facilities). If you haven't made large tweaks to your PW installation or webserver/PHP configuration, the first two are the most likely suspects.
    1 point
  13. @BernhardB - AJAX reload of the field sounds like a promising idea. I have not looked into how that works yet, but I will as soon as I get a chance! At this point I recommend only using the Add New feature if you're using the autocomplete field, since that doesn't require a page refresh to select the new item. I saw your unselect module and it looks great
    1 point
  14. This may be an interesting article related to the topic: http://danielmall.com/articles/content-display-patterns/
    1 point
  15. Normally the datepicker will be displayed in the current user language. You will find all translation files for the datetimefield in the folder: /wire/modules/Jquery/JQueryUI/i18n/ But not everything is translated (Example: button 'done'). I made a translation for german. You could replace the file (jquery.ui.datepicker-de.js) with this one: /* German initialisation for the jQuery UI date picker plugin. */ /* Written by Milian Wolff (mail@milianw.de). */ jQuery(function($){ $.datepicker.regional['de'] = { closeText: 'schließen', prevText: '<zurück', nextText: 'Vor>', currentText: 'heute', monthNames: ['Januar','Februar','März','April','Mai','Juni', 'Juli','August','September','Oktober','November','Dezember'], monthNamesShort: ['Jan','Feb','Mär','Apr','Mai','Jun', 'Jul','Aug','Sep','Okt','Nov','Dez'], dayNames: ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'], dayNamesShort: ['So','Mo','Di','Mi','Do','Fr','Sa'], dayNamesMin: ['So','Mo','Di','Mi','Do','Fr','Sa'], weekHeader: 'KW', dateFormat: 'dd.mm.yy', firstDay: 1, isRTL: false, showMonthAfterYear: false, yearSuffix: '' }; $.datepicker.setDefaults($.datepicker.regional['de']); /* Added by kixe. */ $.timepicker.regional['de'] = { timeOnlyTitle: 'wählen Sie eine Zeit', timeText: 'Uhrzeit', hourText: 'Stunde', minuteText: 'Мinute', secondText: 'Sekunde', millisecText: 'Millisekunde', timezoneText: 'Zeitzone', currentText: 'jetzt', closeText: 'schließen', timeFormat: 'HH:mm', isRTL: false }; $.timepicker.setDefaults($.timepicker.regional['de']); });
    1 point
  16. i'm sorry for that! you should have done the screencast before developing your module than i could have told you earlier
    1 point
  17. @BernhardB Thanks. I didn't know about that. Obviously it is doing the same job.
    1 point
  18. Martijn I have a problem when I have installed Mail Branding and wireMailSMTP together I get the below error : Error: Exception: Method WireMailSmtp::template does not exist or is not callable in this context (in /home/omegatel/public_html/wire/core/Wire.php line 358) My Silly mistake downloaded the module but didn't installed it
    1 point
  19. Just throwing in an idea: could you trigger the ajax loading of the field somehow after adding a new page? BTW: I managed to add the unselect button on my own https://processwire.com/talk/topic/11805-pagelistselectunselectbutton/
    1 point
  20. What's about not yet saved content in other fields when reloading? Will this get saved first? Also, is it good to save (optionally massive) changes without the knowing of the user? At least, I think it only could be an option, not the default.
    1 point
  21. Looks great but, could you run a pagereload on saving the modal via JS? So the option is already there. Users are most not very familiar with browser reloading (having a actual problem with some UI things that users don't get with pagetables...and modals...and saving Very good improvment so far! Best regards mr-fan
    1 point
  22. 1 point
  23. Wow, that's quite the task you've picked for yourself there. For translations, I'd probably go the way of an include and translate the contained strings in the backend. Positioning will have to be absolute. I've done something a bit like that two years ago (adding detailed, multi-language legends to automatically generated test charts with dynamic scales), though not in PW. Allowing users to edit that on the fly was a rather involved thing, and in the end, I had to implement my own wysiwyg editor with canvas rendering, text measuring in javascript and manual wrapping... went way above the time budget I had estimated. It's really a question of how dynamic you need it to be and if you need the text as real text at all. Is manual creating of the images (and just including the correct image for the language) an option? If not and it's just translations, I'd create an individual template and edit that outside PW, then just pull the translations (perhaps with a text formatter that pulls the real text from placeholders to keep the template concise). A repeater with a column for the placeholder and a language text field could let others edit the texts while you only have to see about the layout. If you need it more dynamic, you could also use the repeater (no need for placeholders then) and also save text coordinates and arrow placements, then use JS for the arrows in the frontend and generate the markup with positioning in the template. That will, of course, mean for you to determine and type in all the coordinates. It might be okay if you're the only one doing it. I think I saw a discussion somewhere in the forums a few weeks ago where a table-like (repeater?) input locked some fields for non-superusers. Worth a thought. If there's really a huge and dynamic variety of images to illustrate and the budget's there, a custom fieldtype + inputfield with point-and-click type functionaly may be an option. But then you're at the point where I was, building your custom wysiwyg editor in JS...
    1 point
  24. Conclusion, we are weird anti social people. Ok, jokes asides, it seems to be the trend with the type of developers Processwire attracts as diogo stated. I also think that also the very nature of Processwire makes it a bit "anti marketing buzz". We just won't be seeing: "10 MODULES YOU CAN'T LIVE WITHOUT" and I think that because this "markets" don't really exist in the PW related dev world. I wonder if we should take a look at what other frameworks more like Laravel are outputting to the social media. Ironically, I started using Twitter a lot more recently to basically get more involved with anyone out there who is using Processwire.
    1 point
  25. There is also an example layer class on SO that provides none blocking concurent session writes: http://stackoverflow.com/questions/10046570/php-save-session-when-using-session-write-close/27993746#27993746 But you need to implement this yourself before you start the long running tasks and switch back to PWs regular behave after you have finished them. You can use everything you want to handle sessions with http://php.net/manual/en/function.session-set-save-handler.php.
    1 point
  26. A great example of what I mean is Padloper https://www.padloper.pw/ It gives you simple components for making your own ecommerce with processwire, haves a great documentation and its professionally crafted. I think more software like that should be made
    1 point
  27. @benbyf ..or use both if character limit allows?
    1 point
  28. I sometimes tweet the official @ handle but was wondering if it would be better to tweet hashtag instead..? #processwire
    1 point
  29. For people who want a simple solution out of the box, I would say ProcessWire is not that kind of CMS and that's a good thing. I see ProcessWire as a developer-oriented tool for building custom, complex content websites that have unique requirements and that should be it's strength. CraftCMS and ExpressionEngine fit that niche as well. If ProcessWire were to become a CMS where themes could be swapped at will, I'd imagine that would first pose some technical challenges that would need to be resolved. For example, to what extent does a theme dictate field/template structure, and if someone were to switch to another theme, how would that work? Nico's WireThemes proof of concept module has a nice way of going about that. It's similar to how FormBuilder can map a form's fields to a page's fields when using FormBuilders option to save submissions as pages. When it comes to WordPress and premium themes (like ThemeForest), once you're on a theme, you are stuck with it. No easy portability. Not to mention, each theme is like a CMS within WordPress itself, especially with the trend of mega themes that have recently become popular. Then when add a few plugins to the mix and you'll probably have all kinds of conflicts. Although WordPress is still the king of CMSes for ready-to-go themes, I would say that WordPress is going to be losing its dominance in that arena given the new generation of remotely hosted content management systems, like SquareSpace, Wix and Webflow. Those companies are doing very well because they really cater to people who want something up quick, cheap, easy and with a small learning curve. No coding required. It seems that WordPress (.com at least) is stepping up their game to challenge that. Their new admin system and Jetpack are good examples. Lastly, being the McDonalds of CMSs will cheapen the image of ProcessWire. I do think however we should be attracting advanced WordPress developers. In short, anyone who uses any tools from Roots.io, Underscores, Advanced Custom Fields, WP-CLI, or similar. There are many talented people in those circles who for reasons beyond me, still use WordPress.
    1 point
  30. Hehe, I chuckle when people write "bare with me" which would be a whole different picture
    1 point
  31. (Sorry, couldn't resist. English is such a wonderful language, don't you think?)
    1 point
  32. It is plain easy with Processwire! Check out this topic by Ryan or this other topic where some basics are discussed trying to clarify this topic for another forum member. If you are still a bit confused, try researching a bit on what is AJAX, this is all more about frontend work than backend, so you will be getting into javascript to learn how to make the requests, receive the data, and output it into your already existing HTML.
    1 point
  33. Did you add the url name for each language on the homepage settings?
    1 point
  34. Thanks BernhadB Appreciated the pointer, I know everyone has their own preference, suppose I;m just interested in different peoples preference and approach and I know there are many ways to skin a cat I'm really enjoying PW so far and realising that it's a great CMF to get people learning and thinking about projects, the ease of defining a query is truly awesome I mean: $mything = wire("pages")->find("template=my_template, my_field=special, my_field_featured_start<=today, my_field_featured_end>=today, limit=4, sort=random"); is just so simply to grasp and execute, I love the ability to tap into any field you define. Give me another week or so and I'll hopefully be posting my approaches and opening them up to either gratitude or constructive criticism, I'm looking forward to participating in this forum P.S. Even over the last couple of hours I've realised my frustration last night looking at the simple blog tutorial I was able to deviate from it all together and hash some functions together, PW makes PHP fun!!!
    1 point
  35. I would go with the child pages strategy. the tree could be organized like this: home -home_content ---area1 (give meaningful names to these) ---area2 ---area3 ---... -about -whatever -etc "home_content" need a template, but not a template file. Not having the file will hide it and it's children from the website (see answer #17 below http://processwire.com/talk/topic/4487-homepage-with-multiple-content-areas/?p=47926). The "area" pages would have their own template files (no header, no footer, only their own markup): <h2><?php echo $page->title?></h2> <?php echo $page->body?> Then you can build the homepage like this: <body> <h1>Look at my nice areas of content!</h1> <section id="area1"> <?php echo $pages->get("/home_content/area1/")->render()?> </section> <section id="area2"> <?php echo $pages->get("/home_content/area3/")->render()?> </section> <section id="area3"> <?php echo $pages->get("/home_content/area3/")->render()?> </section> <section id="area4"> <?php echo $pages->get("/home_content/area4/")->render()?> </section> </body> edit: or, if you get easily tired of typing <body> <h1>Look at my nice areas of content!</h1> <?php foreach($pages->get("/home_content/")->children as $c) { echo "<section id='{$c->name}'>"; $c->render(); echo "</section>"; } ?> </body>
    1 point
×
×
  • Create New...