Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/17/2015 in all areas

  1. This site has been up for almost two years, but better late than never: http://www.vrtxmag.com/ This is the companion website for a music magazine in Portland, Oregon. On the front end: Flexslider On the back end: ProCache ProcessCropImage SchedulePages Most importantly, a customized version of @Soma's Images Manager (https://github.com/somatonic/ImagesManager), expanded to allow categorizing images by Artist, Venue, Date, Photographer, etc. This was crucial for organizing an image library and preventing redundant uploads. Thanks, Soma! Original design by Natalie McGuire. I still can't believe how easy it is to do so many things in ProcessWire. Thanks to all involved!
    7 points
  2. Just been playing around with limiting branch visibility and have something that seems to be working quite well - please test carefully for your needs though - I already had one false start with this! This lets a user only see a branch with the top parent "name" equal to the name of their role. For example if you give the users of each affiliate a role like: affiliate-1 this will match the name of the Affiliate 1 parent page (of course: affiliate-1) and that will be the only branch of the tree that will be visible. Providing a GET id variable limits the listed page tree to just the branch with that parent. Using this hook forces it to that all the time. As I said, I am not yet sure how safe/stable this is, but so far I like the results, although I am not sure about overriding $_GET['id'] like this. There is likely a better way! if(!wire('user')->isSuperuser() && !isset($_GET['id'])) { $this->addHookBefore('ProcessPageList::execute', null, 'setTreeRoot'); function setTreeRoot() { foreach(wire('user')->roles as $role){ $p = wire('pages')->get("has_parent!=admin, name={$role->name}"); if($p->id) { $pid = $p->id; break; } } $_GET['id'] = $pid; if(isset($_GET['open']) && $_GET['open'] == $pid) wire('input')->get->open = null; } } I am currently using this along with a modified version of the PageEditPerUser module which now works to also match the user's role to the parent page. So far so good, but I am expecting there is something I have overlooked - will keep things updated here.
    4 points
  3. Creating my book websites with Processwire http://cchogan.com/food-and-stuff/using-processwire-for-my-book-websites/
    4 points
  4. I've created a Slack Channel under the roof of the webDevs Slack Team. At the moment there are mostly germans. But everyone is welcome. Get an invite at http://webdevs.xyz/
    2 points
  5. Use getQueryLog() Maybe something like: $queries = $database->getQueryLog(); foreach($queries as $query){ if (strpos($query, 'classification')) {//just to limit our search since there could be other queries echo '<pre>' . $query . '</pre>'; } }
    2 points
  6. In my setup I may need hundreds of editors so creating hundreds of roles seems an overkill. I would give them the same role and select the tree they can edit - one user, one page (and its subpages). So if a new affiliate is added, I would add one new editor and select one page that he can see in the admin and edit. I have no pagetables so perhaps that's why I see my idea better for this purpose.
    2 points
  7. Looks solid! The search button seems a bit messed up (FF-Chrome-IE11)
    2 points
  8. WillyC is right. I noticed this too, and updated a relevant issue at GitHub.
    2 points
  9. Look again: http://www.jssor.com/ http://www.jssor.com/demos/ (from simple banner to slick sliders and all responsive) Mauricius gracefully made a module for it: http://modules.processwire.com/modules/process-slider/
    2 points
  10. u cane do $session->removeNotices(); aftr u dipslay.notices
    2 points
  11. So this is basically a recreation of a menu tutorial from W3Bits, tweaked to include the Advanced checkbox hack. Demo. Even the Advanced hack itself was tweaked: apparently this bit is causing issues with Safari, so I removed it: @-webkit-keyframes bugfix { from {padding:0;} to {padding:0;} }I found this particular configuration to work quite nicely. A previous menu I tried had a problem with the menu items staying expanded between media query breakpoints, when resizing the browser. Below is the CSS for the menu. You will notice that it is mobile-first: /* Menu from http://w3bits.com/css-responsive-nav-menu/ */ /* Note: the tutorial code is slightly different from the demo code */ .cf:after { /* micro clearfix */ content: ""; display: table; clear: both; } body { -webkit-animation: bugfix infinite 1s; } #mainMenu { margin-bottom: 2em; } #mainMenu ul { margin: 0; padding: 0; } #mainMenu .main-menu { display: none; } #tm:checked + .main-menu { display: block; } #mainMenu input[type="checkbox"], #mainMenu ul span.drop-icon { display: none; } #mainMenu li, #toggle-menu, #mainMenu .sub-menu { border-style: solid; border-color: rgba(0, 0, 0, .05); } #mainMenu li, #toggle-menu { border-width: 0 0 1px; } #mainMenu .sub-menu { background-color: #444; border-width: 1px 1px 0; margin: 0 1em; } #mainMenu .sub-menu li:last-child { border-width: 0; } #mainMenu li, #toggle-menu, #mainMenu a { position: relative; display: block; color: white; text-shadow: 1px 1px 0 rgba(0, 0, 0, .125); } #mainMenu, #toggle-menu { background-color: #09c; } #toggle-menu, #mainMenu a { padding: 1em 1.5em; } #mainMenu a { transition: all .125s ease-in-out; -webkit-transition: all .125s ease-in-out; } #mainMenu a:hover { background-color: white; color: #09c; } #mainMenu .sub-menu { display: none; } #mainMenu input[type="checkbox"]:checked + .sub-menu { display: block; } #mainMenu .sub-menu a:hover { color: #444; } #toggle-menu .drop-icon, #mainMenu li label.drop-icon { position: absolute; right: 0; top: 0; } #mainMenu label.drop-icon, #toggle-menu span.drop-icon { padding: 1em; font-size: 1em; text-align: center; background-color: rgba(0, 0, 0, .125); text-shadow: 0 0 0 transparent; color: rgba(255, 255, 255, .75); } label { cursor: pointer; user-select: none; } @media only screen and (max-width: 64em) and (min-width: 52.01em) { #mainMenu li { width: 33.333%; } #mainMenu .sub-menu li { width: auto; } } @media only screen and (min-width: 52em) { #mainMenu .main-menu { display: block; } #toggle-menu, #mainMenu label.drop-icon { display: none; } #mainMenu ul span.drop-icon { display: inline-block; } #mainMenu li { float: left; border-width: 0 1px 0 0; } #mainMenu .sub-menu li { float: none; } #mainMenu .sub-menu { border-width: 0; margin: 0; position: absolute; top: 100%; left: 0; width: 12em; z-index: 3000; } #mainMenu .sub-menu, #mainMenu input[type="checkbox"]:checked + .sub-menu { display: none; } #mainMenu .sub-menu li { border-width: 0 0 1px; } #mainMenu .sub-menu .sub-menu { top: 0; left: 100%; } #mainMenu li:hover > input[type="checkbox"] + .sub-menu { display: block; } }Below is the markup outputted using mindplay.dk's method. I found it impossible to output with MarkupSimpleNavigation or MenuBuilder. The homepage is added as the first top-level item. Notice the onclicks that make it work on iOS < 6.0. The clearfix class cf for the top ul is important. Otherwise the element will have no height (got bitten by this..). <nav id="mainMenu"> <label for='tm' id='toggle-menu' onclick>Navigation <span class='drop-icon'>▼</span></label> <input id='tm' type='checkbox'> <ul class='main-menu cf'> <?php /** * Recursive traverse and visit every child in a sub-tree of Pages. * * @param Page $parent root Page from which to traverse * @param callable $enter function to call upon visiting a child Page * @param callable|null $exit function to call after visiting a child Page (and all of it's children) * * From mindplay.dk */ echo '<li><a href="' . $pages->get(1)->url . '">Home</a></li>'; function visit(Page $parent, $enter, $exit=null) { foreach ($parent->children() as $child) { call_user_func($enter, $child); if ($child->numChildren > 0) { visit($child, $enter, $exit); } if ($exit) { call_user_func($exit, $child); } } } visit( $pages->get(1) , function(Page $page) { echo '<li><a href="' . $page->url . '">' . $page->title; if ($page->numChildren > 0) { echo '<span class="drop-icon">▼</span> <label title="Toggle Drop-down" class="drop-icon" for="' . $page->name . '" onclick>▼</label> </a> <input type="checkbox" id="' . $page->name . '"><ul class="sub-menu">'; } else { echo '</a>'; } } , function(Page $page) { if ($page->numChildren > 0) { echo '</ul>'; } echo '</li>'; } ); ?> </ul> </nav>Edit: fixed the end part, thanks er314.
    1 point
  12. AvbImage - Image Manipulator Module for ProcessWire This module using Intervention Image PHP image handling and manipulation library. Update Status Module and InterventionImage Library update - 10-12-2015 More performance imporements - 18-11-2015 Module Update and Performance Improvements - 17-11-2015 First Commit - 28-10-2015 RequirementsProcessWire >= 2.5.11 PHP >=5.4 Fileinfo Extension Supported Image LibrariesGD Library (>=2.0) Imagick PHP extension (>=6.5.7) For usage and methods please look githup repo : README.md > For issues and fix and corrections please use Githup Repo
    1 point
  13. I suppose if anybody's interested, I could release it on github. As it is, it's set up for my very specific needs, but I could abstract it a bit more. I'd also love some help making it scale a bit better; we have almost 10,000 images, and 5 fields for filtering them, so it's slowing down a bit.
    1 point
  14. Not for me, at least for the moment, but do you intend to release your "customized version of @Soma's Images Manager" in some way or another? I haven't had the opportunity to use Soma's Images Manager for a project yet. Have a nice week!
    1 point
  15. Thanks! This actually led me to several issues that have been bugging me all day: the importance of using <button type="submit"> instead of <input type="submit"/> for html5 doctypes redirecting vrtxmag.com to www.vrtxmag.com so that the ProCache cache clears properly - that's why the problem was appearing inconsistently That was part of the caching issue. I believe this is fixed, but the caching thing has made it rather maddening to track down.
    1 point
  16. Have you set $config->debug to true in your site/config.php ?
    1 point
  17. Nice website. But I'm seeing the same Search button issue. In Firefox, Chromium, Opera, and Vivaldi. Depending on the browser, the text behind the arrow is different. This seems to happen only on the homepage (?), at least now. Edit: it has disappeared. I guess you have just done something...
    1 point
  18. #header-search .search-go Firefox v.41 the word Submit should not be visible there, it's distorting the look of the right arrow. Same in all gecko based browser engines. IE8 here it looks normal . . .
    1 point
  19. Right - sorry I understand - I didn't realize that there would only be one user/editor per branch. In my case there will be several per branch which is why the role approach makes sense to me, but in your situation, that makes perfect sense
    1 point
  20. Thanks for this. It's fixed, I think. I could only get it to happen in Opera , but the fix was changing this: #header-search input[type="text"] to this: #header-search input#searchBox
    1 point
  21. Better to use an open protocol like IRC. We hang out at #processwire. If you are new to IRC and want to get going fast: https://kiwiirc.com/client/irc.freenode.net/processwire For convincing yourself to avoid closed proprietary platforms you can read this article by the Mattermost guys: http://www.mattermost.org/why-we-made-mattermost-an-open-source-slack-alternative/
    1 point
  22. Actually I was the first to like and retweet his tweet five days ago. So all candies belong to me
    1 point
  23. Hi Mediamar, I'm sure you've already begun digging into the documentation, but you can use the following redirect to match all URIs using a php extension: Source: {path}.php Destination: {path}/ Glad you like the module.
    1 point
  24. Thanks, I will definitely try this when the time comes - it will be only in the second phase (if ever). I would tie user name instead of role to a branch. If I get it right your code requires setting each user a new role, which is I guess unnecessary, and an overkill on a larger user (editor) base. Ideally I would add a new field to users, eg. "home_branch", where the superuser could select the user's own tree.
    1 point
  25. @Spica Nope not yet, I will consider this for the next version. Makes sense!
    1 point
  26. Yes. But does the WirePDF input field accept a config path variable?
    1 point
  27. Ok. I tried Jumplinks and it works like charm. Thanks again for the quickest support ever seen and http://modules.processwire.com/authors/mike-rockett/. Have a nice day.
    1 point
  28. What an awesome writeup - great find kongondo!
    1 point
  29. I guess you enabled "directory traversal" in AIOMs module settings?
    1 point
  30. Here you go: http://stackoverflow.com/questions/13106299/redirect-using-htaccess-based-on-referrer Actually, that link I posted is part of the puzzle, what you might actually want (untested) is this since you know the referring domain: RewriteEngine On RewriteCond %{HTTP_REFERER} ^http://the-naughty-domain.com [NC] RewriteRule ^ http://the-website-of-your-choosing.com/ [L,R] Basically targetting only the naughty domain and sending them somewhere else. This can also be changed to do any of the other actions discussed in this topic.
    1 point
  31. Hey, I really love the functionality of Hanna Code. But it's 45mb (!!!) because of the ACE editor. So my idea is to change it to work like my Template-Editor module: Use ACE in case it is installed and otherwise implement only a tab functionality. That should work as well and save some space (and upload time!). Here's the part of codes that could just be copied into hanna code: https://github.com/NicoKnoll/ProcessTemplateEditor/blob/master/ProcessTemplateEditor.js#L1-L19 Thanks, Nico
    1 point
  32. Hi guys! So, we launched two more websites and more will follow soon. http://mlausen.com/ Multi language and responsive site for a German architect/photographer based in Switzerland. This site is for showcasing her (exclusively b/w) photography and writings. Maike is very happy with PW, and said that she had fun while updating the content. -- http://demenzinitiative-karlsruhe.de/ Very simple and simple to use (by concept) website for a dementia support initiative in Germany. This website has three different layouts depending on the screen size, so make sure you resize the window, and zoom out if you don't have a large screen. The illustrations are by us -- Both corporate identities were also created by us.
    1 point
  33. For debugging, sometimes it is better to set it up first outside processwire. Use an index.html and subdirectories for the images, css and js. Copy and paste the html example code in the index.html. The bxslider css and js calls between the <head> tags. The .bxslider call and <ul class="bxslider"> between the <body> tags. Try different bxslider parameters and wrappers. Once you have everything working correctly in this part then bring it all over into processwire.
    1 point
  34. You obviously don't know owlcarousel then
    1 point
  35. I don't know the drawbacks of this, but I just managed to do make the dynamic stylesheet proposed on css tricks work has a pw template. So, this is how to do it (someone stop me if this is a bad bad thing to do): 1. Create a template file css.php and put all your css code inside. On the top of the file put this code <?php header("Content-type: text/css"); ?>. 2. Create a "css" PW template with that file. 3. Create a "css" page and give it the "css" template. 4. Link to the stylesheet like this <link rel="stylesheet" href="<?php echo $pages->get('/css/')->url; ?>">. 5. use the PW API on your stylesheet Extra: 6. put some fields on the "css" template and use them on your css Examples: the color picker field for colors; an image field with your style pictures (background, logo, etc). edit: onjegolders was faster! edit2: not the same answer. Mine is more interesting
    1 point
  36. This is exactly correct. Lets say you've got this page /user-profile/ in your site. You also have a template called user-profile, and it has URL segments enabled. In the code, all you need to authenticate is to compare $user->name to $input->urlSegment1. Meaning if user 'onjegolders' accessed the URL: /user-profile/onjegolders then you would allow them to make changes to their profile. if(!$user->isGuest() && $user->name === $input->urlSegment1) { // user is authenticated and may change their password if($input->post->submit_pass) { if($input->post->pass !== $input->post->pass_confirm) { echo "<h2>Passwords do not match!</h2>"; } else if(strlen($input->post->pass) < 6) { // if you want to enforce a minimum password length (recommended) echo "<h2>Your password is too short. Must be 6 characters or more.</h2>"; } else { $user->of(false); $user->pass = $input->post->pass; $user->save(); $user->of(true); echo "<h2>Your password has been changed</h2>"; } } echo "<form action='{$page->url}{$user->name}' method='post'>"; echo "<p><label for='pass'>Change your password</label>"; echo "<input type='password' name='pass' /> "; echo "Confirm: <input type='password' name='pass_confirm' /></p> "; echo "<input type='submit' name='submit_pass' />"; echo "</form>"; } The above was just written in the browser so may need tweaks.
    1 point
  37. Think of ProcessWire's tree like a fractal. There is no difference between multiple trees, and branches within a tree. Both can extend forever in the same way. ProcessWire knows nothing about menus. So what is or isn't a menu is based entirely on what you make it, there are no limits. You can have as many menus, whether structured, or flat (via page references, toggles, etc) as you want. Here are common ways of drawing upon ProcessWire pages for menus, but these are just examples in unlimited possibilities: It's common to relate your first level of pages to your top navigation: $topnav = $pages->get('/')->children; It's also common to relate the children of your first level as secondary navigation (which you might also carry further into the structure for tertiary navigation and more): $subnav = $page->rootParent->children; If you wanted dynamic footer pages, you might create a structure where they will be (whether actual viewable pages or redirects): $footerNav = $pages->get('/tools/footer-nav/')->children; Or you might assign footer links via a multi-page reference field on your homepage template, where you edit your homepage, pluck out the pages you want to appear in your footer (using a PageListSelectMultiple input) and drag to order them. (this would be my preferred option) $footerNav = $pages->get('/')->footer_nav; Or you might just put a checkbox field on every page that says "show in footer", and check the box for the pages you want in the footer. $footerNav = $pages->find("footer_nav=1"); Or you might use a repeater to create a more literal menu with title (anchor text) and the URL it should go to. This is just for starters. Pull away from the rigid thinking of other CMSs and you'll find anything is possible.
    1 point
×
×
  • Create New...