Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/10/2016 in all areas

  1. You need to keep in mind, that you're in charge of any logic regarding the total of pages if you overwrite it, so you need to handle cases, where the total is less than 100 as well. // The customer wants to set the items per page. Lets say it's 10 for the moment $limit = $page->number; // Remember: There are only 12 Event Pages at the moment $items = $pages->find("some=selector, limit=$limit"); $items->setTotal(min($items->getTotal(), 100)); // Output Markup $paginationMarkup = $items->renderPager(array( 'nextItemLabel' => '<i class="fa fa-angle-right"></i>', 'previousItemLabel' => '<i class="fa fa-angle-left"></i>', ));
    3 points
  2. I've added a small tweak to close the notifications using the ESC key. This works on the very first keyup event only so it's for power users who want to close the notifications right after page load I used the admin only for a few minutes with this setting but I found it a very handy.
    3 points
  3. The url exists even if the language isn't active, but it will return a 404 in this case. You have 2 options to solve your problem: modify your code of your navigation, check the language specific status of the page you want to add to the nav. via template. disable multilanguage support under advanced tab in your single language templates. Code for 1. option: $nav = '<ul>'; foreach ($pages->find('parent=1,include=all,status<1024') as $p) { $url = ($user->language->isDefault() == false && $p->{"status{$user->language->id}"} == 0)? $p->localUrl($languages->getDefault()):$p->url; $nav .= "<li><a href='$url'>$p->title</a></li>"; } $nav .= '</ul>';
    3 points
  4. I think the easiest way to do this is with Javascript/jQuery. Not too hard to write a script for this from scratch (that's what I've done in the past) but Google reveals a nice looking plugin that does it all for you: http://renaysha.me/anchorific-js/
    3 points
  5. I'm slowly trying to do it with some logic, the little knowledge I have, and looking at the skycrapers demo profile files (removing what doesn't seem to concern my use case to see things more clearly). The positive aspect is that I'm learning/progressing. I don't know if I'll succeed, I guess I'll have to tell the client (the kind we all know that is always in a hurry when it benefits him/her, who thinks that adding this or that functionnality is easy, who asks for relatively complicated things/functionality at the last moment, and so on) to be more patient. I'll post some code here as soon as I have enough of it to show. Have a nice day!
    2 points
  6. I gave an example of how to do this in your other thread. You use a hook on MarkupSimpleNavigation: $nav = $modules->get('MarkupSimpleNavigation'); $nav->addHookAfter('getItemString', function($event) { $page = $event->arguments('page'); if($page->parent->id == 1) { // you can perform any test you want on $page $event->return = "<a href='#{$page->name}'>{$page->title}</a>"; // you can return any markup you want here } });
    2 points
  7. Thanks @tpr - I forgot to mention that to get that CMD key shortcut to work on MacOS, you actually need this complete combination which includes charCode as well as keyCode: if ((e.metaKey || e.ctrlKey) && (e.keyCode == 83 || e.charCode == 83)) { That is the working replacement for this line: https://github.com/rolandtoth/AdminOnSteroids/blob/0ffbbe3a6fbfc41e155b8df5d2ae119b0d86c5df/Hotkeys/Hotkeys.js#L160 I haven't tested other shortcuts in the Hotkeys.js file nor those in the main AdminOnSteroids.js file, but hopefully this will give you an idea of what is needed for those also. Thanks again.
    2 points
  8. Just pushed some updates to this ancient module. The new version (v1.2.0) uses wireMail and should work with PW 3.
    2 points
  9. Just checked in a first beta version of a new module I'm working on. Feel free to test out and see what's up with it. Pollino (beta) A simple poll module for ProcessWire This module makes it simple to setup polls for your website. It is based on a simple page setup to create the polls. So each poll is a page, and its children are the answers. Pollino will create the templates and a PollinoPolls page in the root to start with. You can add fields to the templates as you wish and later use hooks to modify the output of the poll. This can be useful, for example, to use images as options or just some custom markup etc. It provides some API to render the poll form and the result. These methods are hookable and it's easy to customize the output if needed. It can be rendered on any page and even multiple on the same page. Pollino takes care of saving the votes and preventing multiple votes. It comes with some configuration settings to choose what method to use to prevent from multiple votings: using cookie and an expire time or by IP and optionally also the UserAgent with and expire time or by logged in User Pollino isn't 100% plug'n'play but it provides a solid foundation and comes with some premade theme and output for you to start. It takes care of the boring stuff and lets you concentrate on the front-end stuff and styling. That's what matters after all. It does support multilanguage, as all strings are translatable in the module. Also since it's using simple pages and templates you're free to add or change fields to make its output multilanguage without much hassle. ----- Read more and download https://github.com/somatonic/Pollino Online Demo I setup a little demo here to see using https://lightning.pw http://titanium-x77.lightningpw.com/ Have fun.
    1 point
  10. Then you need to add extra checks if($input->urlSegment1 == "femmes") { $filter = "civilite=mademoiselle|madame"; } if($input->urlSegment1 == "hommes") { $filter = "civilite=monsieur"; } // or if($input->urlSegment1 == "mademoiselle" || $input->urlSegment1 == "madame") { $filter = "civilite=mademoiselle|madame"; } if($input->urlSegment1 == "monsieur") { $filter = "civilite=monsieur"; }
    1 point
  11. You can use url segments (need to enable them for each template you need to have them). Then the Femmes link will be /fr/annuaire-des-books/mannequins-modeles/femmes and in the template file for directory_listing_mm you do this $filter = ""; if($input->urlSegment1 == "femmes") { $filter = ", civilite=value_representing_femmes"; } if($input->urlSegment1 == "hommes") { $filter = ", civilite=value_representing_hommes"; } $results = $pages->find("template=directory_listing_mm {$filter}"); /fr/annuaire-des-books/mannequins-modeles/femmes /fr/annuaire-des-books/mannequins-modeles/hommes the red part will be $input->urlSegment1, so if $input->urlSegment1 is femmes you change the selector to search for pages where your civilite is femmes. You have quite a few filters so this might not be the best solution. I say you change the civilite to page fields the the code becomes: $filter = ""; if($input->urlSegment1) { $filter = ", civilite={$input->urlSegment1}"; } $results = $pages->find("template=directory_listing_mm {$filter}"); If changing fields to page field is an option i can explain further.
    1 point
  12. BCE won't work for comments, but you can certainly write your own API script to import comments from another source. What format do you have them in? The only gotcha you will come across is this bug (https://github.com/ryancramerdesign/ProcessWire/issues/1034) which prevents you from setting the status via the API, so currently you will need some SQL to fix that. Let us know if you need any help.
    1 point
  13. there are some discussions and instructions on how to do this in the forum somewhere; i think this was the recommended way: $cloneFromTable = $page->repeater->table; $cloneToTable = $page->table; foreach($cloneFromTable as $row) { $row->id = null; $cloneToTable->add($row); } in other words i think you have to iterate the rows from the old table to the new table; AFAIK there is no way to copy the whole thing at once, unless something changed since the last time i needed to do this. You might want to check over in the Profields Table forum about this specifically.
    1 point
  14. @Robin S How easy would it be to turn the options into a repeater? I've found this module so useful I'm in need to use it across multiple PageTable fields.
    1 point
  15. Hi, I've never done it myself so I cannot present some pre-made solutions, but there seem to be discussions about it in the forum: https://www.google.hu/search?as_sitesearch=processwire.com%2Ftalk&as_q=migrate#q=+Import+comments+site:processwire.com%2Ftalk especially: Also, there are various discussions about using an existing module to import vs implement your on solution. I also recommend checking out @adrian's Batch Child Editor which can also import data (note, that I do not know if you can use it for importing comments or not, but he will be able to tell us...):
    1 point
  16. Hi, @Robin S, after turning on the debug mode, it was all looking fine. @Macrura, when I was looking for the directories' permissions, I came across a post that recommended to delete the cache folders, so I did and everything was working fine. Thank's guys, for sending me through the right path! I also skipped this step on my local server so it´s a bit strange that this would have any influence. But it did. Solution Delete the session and cache files in the /site/assets directory.
    1 point
  17. Or use my migrations module, to kinda get the best of both worlds. The ease of the ProcessWire API with the ability to have migrations run/downgraded as needed.
    1 point
  18. Do you have debug mode on? Any PHP notices? I think I had an issue a while ago where a PHP deprecated notice was interfering with with the tree AJAX response.
    1 point
  19. Tracy shows these notices on the page tree: 17× PHP Notice: Undefined index: ListerTweaks_options in .../modules/AdminOnSteroids/AdminOnSteroids.module:452 17× PHP Warning: in_array() expects parameter 2 to be array, null given in .../modules/AdminOnSteroids/AdminOnSteroids.module:452
    1 point
  20. Have you checked the folder and file permissions, after uploading?
    1 point
  21. This is the same as what @LostKobrakai showed in post 2: append() is identical to add(), and adding a page ID to a PageArray achieves the same as adding a Page object. The objective is to get the parents of the items in the first PageArray.
    1 point
  22. Thanks, just updated a few Js files on GitHub/modules directory (no version change).
    1 point
  23. haha. WTF. ok! for now i simply copy-from-image-media and overwrite the description for variations on save, which works... but it would be REALLY great, to have native multilanguage-support in the image-description (like it is in the core), i think. maybe, its something for the roadmap. beside that, it's a pretty solid work!
    1 point
  24. v100 is up with the recent fixes/suggestions/requests: moved AdminLangSwitcher, noAnim, HoverDropdown, LangTabHotkeySwitcher, AdminColumns, AutosizeTextareas, TabIndex submodules into Misc submodule moved PageListUnselect submodule into PageListTweaks submodule added e.metaKey besides e.ctrlKey (suggested by adrian) separate CSS/JS for AOS configuration page (suggested by matjazp) do not load module CSS/JS when module is disabled flatModules: make "Add new module" section visible when clicking on "Add new" from sidebar/top menu (reported by adrian) force loading of longclick.js for moduleModal (reported by gmclelland) fix for invisible AsmList items on drag (reported by adrian) added hash navigation for module config page I moved non-configurable submodules into other submodules (mostly into Misc). You'll need to re-set them if you used them before. Hash navigation is not exactly working as expected so it may be removed later.
    1 point
  25. I have always been a huge fan of the vector shape side of SVG, but I have never really experimented with all its other abilities. Here's an interesting article on some of the other things it can do: http://go.sitepoint.com/t/ViewEmail/y/28B66532868053D2/93084645AE7B31BD981D23A7722F2DCD Just pinging @horst because it may be of particular interest to him
    1 point
  26. You can use the following module: http://modules.processwire.com/modules/process-wire-upgrade/
    1 point
  27. +1 for the feature requests above. I'm not yet a happy Media Manager owner, but it is highly probable that one day I will be
    1 point
  28. It wasn't there in 3.0.15, but it is in (at least) 3.0.39. Thanks @ryan, minor fixes like these really improve the overall user experience.
    1 point
  29. Thanks @Christophe - I have unpublished it from the Sites directory. There is a script that @teppo put together using code from isit.pw that can be run to check sites in the directory, but I am not sure if it is being used or not.
    1 point
  30. Sorry to say that this website shouldn't be in Sites anymore. I was looking for an example to give to a newcomer on the ProcessWire Forums and, feeling something was different and/or by habit, have just looked at the source code... I'll perhaps look for an automated way to find other websites like this one in Sites. I had done it to check if websites' urls were still valid as I had found that a few weren't anymore. It reminds me of the CMS Critic case.
    1 point
  31. Sorry for the delay -- meant to answer a while ago, but then something came up, and I forgot the whole thing. Hopefully you haven't been waiting this whole time I'm going to answer your suggestion at the Changelog support thread separately, but as a quick comment to this: I think your module looks really neat, and while listing changes to fields is definitely something I might consider for Changelog, I do also feel that these modules serve a different purpose. At least that's my first impression. When I first built the Changelog module, it was just a simple list of changes to public pages of the site. While it does display which fields were changed and now also includes system pages, I've intentionally left actual field values out of the equation. That's where VersionControl comes in: it stores field values and keeps track of changes to those. Again, the purpose is different: a relatively high-level log of changes vs. an actual versioning tool. Tracking changes to fields might fit VersionControl better than Changelog, but I'm currently not convinced that it would really be worth it. It seems to me that while there may be some common ground, these are mostly separate features. And, to be honest, VersionControl is already doing so much behind the scenes that I'm having hard time keeping up with everything that's happening. Smaller, more targeted modules do have certain benefits I'm definitely going to keep an eye out for what you do with this module, but for the time being I don't think there's much benefit in trying to combine them. --- By the way, I've been meaning to ask you about the naming of your module: what does the SVN part actually refer to? My first guess would be Subversion (SVN), but then again, I don't see any link between Subversion and your module. Hopefully I'm not being too intrusive here, but if my guess is right, I'd suggest reconsidering the naming. While Subversion is a commonly used product, in the long run this might become a bit confusing to some users
    1 point
  32. Quick update guys. Frontend module is ready. I have to update the docs first before releasing it though as with anything frontend, there are security implications if the module is not properly set up. Hence, the need to first prep the docs. Will talk more about how it works later but setting up the selects is quite easy. These are defined in a process module in the backend (think Menu Builder) with caching and validation right out of the box. Hope to release next week.
    1 point
  33. +1 3. It would be great if we could enter the new template name directly before duplicating. So the template and field duplication process are equal.
    1 point
  34. API to change field settings: $field = $fields->get(164); $value = "newoption\n1=oldoption1\n2=oldoption2"; $module = $modules->get('FieldtypeOptions'); $result = $module->manager->setOptionsString($field, $value, true); var_dump($result); /** * description of function setOptionsString() found in Class SelectableOptionManager.php * Set an options string * * Should adhere to the format * * One option per line in the format: 123=title or 123=value|title * where 123 is the option ID, 'value' is an optional value, * and 'title' is a required title. * * For new options, specify just the option title * (or value|title) on its own line. Options should * be in the desired sort order. * * @param Field $field * @param string $value * @param bool $allowDelete Allow removed lines in the string to result in deleted options? * If false, no options will be affected but you can call the getRemovedOptionIDs() method * to retrieve them for confirmation. * @return array containing ('added' => cnt, 'updated' => cnt, 'deleted' => cnt, 'marked' => cnt) * note: 'marked' means marked for deletion * */
    1 point
  35. main.inc should keep the largest possible code for all your different layouts and include sub-xy.inc files. Lets say for example you have the default layout with $bodycopy and $sidebar and additionally a onecolumn layout without sidebar: You define a new variable e.g. $myLayout: // here is how it would look like in the /site/templates/init.inc <?php $headline = $page->get("headline|title"); $bodycopy = $page->body; $sidebar = $page->sidebar; $myLayout = "default"; // we only write the name without the fileextension, this way we also can set a CSS-class in the body tag! // or you put it into the head of every template file, here: /site/templates/basic-page.php <?php $headline = $page->get("headline|title"); $bodycopy = $page->body . $page->comments->render(); $sidebar = $page->sidebar; $subnav = $page->children; $myLayout = "default"; include("./main.inc"); Now move the smallest possible segment from your main.inc into default.inc and replace it in main.inc with an include("./$myLayout"): /site/templates/main.inc <html> <head> <title><?php echo $headline; ?></title> </head> <body class="<?php echo $myLayout;?>"> <?php include("./{$myLayout}.inc"); ?> </body> </html> /site/templates/default.inc <div id='bodycopy'> <h1><?php echo $headline; ?></h1> <?php echo $bodycopy; ?> </div> <div id='sidebar'> <?php echo $sidebar if(count($subnav)) { echo "<ul class='nav'>"; foreach($subnav as $child) { echo "<li><a href='$child->url'>$child->title</a></li>"; } echo "</ul>"; } ?> </div> Lets say you don't want the sidebar on your homepage, then you define / overwrite in your /site/templates/home.php the $myLayout var with $myLayout = "onecolumn"; // we only write the name without the fileextension, this way we also can set a CSS-class in the body tag! Create a file called "onecolumn.inc" and put in your desired markup, e.g.: /site/templates/onecolumn.inc <div id='bodycopy'> <h1><?php echo $headline; ?></h1> <?php echo $bodycopy; ?> </div> To stile your onecolumn layout with CSS you need to append to your css something like: body.onecolumn div#bodycopy { width: 100%; }
    1 point
  36. Well, I wanted to move some Repeater fields to PageTable. I couldn´t use your script because I wanted it to traverse a PageArray. So I totally rewrote your script, and added some comments. You can use as a template file for any page. Steps: Create a new Categories/Category Structure in PW: BothTemplates & Parent Page (Categories) and the new PageTable Field: categories. Assign the "new" PageTable Field to de templates where the Repeater is. The one we will migrate. Here: https://gist.github.com/biojazzard/654e9f00faacf419d952/ With love.
    1 point
  37. You can use the status "Hidden" for this. It's on the settings tab of the page. /Jasper
    1 point
×
×
  • Create New...