Jump to content

Joss

PW-Moderators
  • Posts

    2,862
  • Joined

  • Last visited

  • Days Won

    47

Everything posted by Joss

  1. Update: The menu system on the Bootwire Starter Profile is now fully functioning with unlimited sub-menus. DOWNLOAD: https://github.com/jsanglier/Bootwire-Starter-Profile However, to use this as a properly responsive system that works with touch devices, I do not suggest that you use sub menus, but just the main dropdowns by limiting the scope of your pages. If some kind person would like to check the download and let me know if it is okay, I will then add it to the Modules. Joss
  2. Okay - I will update my install. Thanks again Soma Edit: The Nav2 and dropdown-menu2 need to be changed to nav and dropdown-menu or it wont work.
  3. Absolutely fantastic! Not sure what else to say really Right, well that make the Bootstrap basic profile complete, since that was the last element to get properly right. I will also post this on the wiki to replace the current, out of date version that is on there. Next thing is I need to study it and understand how it works - and so I will learn a little bit more..... Thanks mate Joss
  4. Okay, it now works and the top level <li> get the active class when their link is active. However, they are not yet getting the class if a child is active. This is using my old menu: http://pwdemo2.stonywebsites.co.uk/about/about-us/ When the sub item is clicked the parent gets an active class, this is not happening with the new menu ..... yet! This is the complete code so far, thanks guys! EDIT: Of course, the home page doesn't get active either because it is outside of the loop.... <?php /* * Thanks to Netcarver and Soma for sorting this out for me */ $homepage = $pages->get("/"); function renderChildrenOf($parent) { $output = ''; $children = $parent->children; foreach ($children as $child) { if(count($child->parents) == 1){ $atoggle = 'class="dropdown-toggle" data-toggle="dropdown" '; // The toggle for the top level <a> tags when there are children $dropclass = ' dropdown'; // The class for the top level <li> tabs when they have children } else { $dropclass = ' dropdown-submenu'; // The class for lower level <li> that also have children } $class = ($child === wire("page")) ? " active" : ''; // Makes the top level <li> acive when on that page // If this child is itself a parent, then render it's children in their own menu too... if (count($child->children)) { $output .= '<li class=" ' . $dropclass . '' . $class . ' "><a href="' . $child->url .'" '. $atoggle .'>' . $child->title . '</a>'; $output .= '<ul class="dropdown-menu">' . renderChildrenOf($child) . '</ul>'; $output .= '</li>'; } else { $output .= '<li class=" '. $class .' "><a href="' . $child->url .'" >' . $child->title . '</a></li>'; } } return $output; } // Setup the start of the top-level menu... $menu = '<ul class="nav">'; // Append something for the homepage (as menus usually squish the root node in with its children anyway)... $menu .= '<li><a href="/">' . $homepage->title . '</a></li>'; // Set the ball rolling... $menu .= renderChildrenOf($homepage); // Close the top-level menu... $menu .= '</ul>'; // Show the result to the world... echo $menu;
  5. One last thing! I can't get this to work: $class = $child === $page->rootParent ? " active" : ''; I need to put the class active into the first level (only) <li> tags when the page is, umm, active. But this doesn't seem to want to work in the code by Netcarver above. It isn't returning anything.
  6. Okay, now that has got me much closer!
  7. Hi Netcarver Okay, I am a bit of the way there. What I need to do is say something like: If the child <li> is a child of the homepage (or belongs to the toplevel <ul>), then $dropclass = ' dropdown'; else, $dropclass = ' dropdown-submenu'; I will need to do similar to the <a> tag that needs to go within the li I Basically, the first level of <li> that have children need the class "dropdown" but lower levels of <li> that have chidren need the class "dropdown-submenu" Likewise, the <a> of top level <li> that have children need a class, where as lowever level ones need something else Sorry I have been so slow on this! Joss
  8. Ah, that is a good point. The files could just be in a subdirectory to the module and then just copied.... a bit obvious - why didnt I think about that???
  9. Thanks Soma! That at least gets me part of the way there. What about creating actual files (complete with content)?
  10. I was thinking about creating myself a module to short cut certain site development. For instance, on a basic brochure site , it would be common to have a small news section that would vary very little from one site to another. So, all the module need to do is a one-off process on installation: Create: A bunch of fields using standard available field types, A handful of templates using the fields A few template files and some inc files in a separate folder (which may or may not exist yet) A few pages to weld it together. As I said, this is just a development short cut - you would still have to work it into the site, but it would reduce the work load. I suppose the result would be a skeleton module that could be used to create lots of variations of the above. The trouble is, I am not sure how to do the install functions for the above - especially the creation of actual files and/or folders. Any clues? Joss PS: Oh, I suppose an added function could be that you could get it to check if a particular field type existed (for instance, crop-image) and if not, download and install it!)
  11. Interestingly, I was writing a script today with a client using Google docs, er, Drive. It was a bit of a fight editing exactly the same text at exactly the same time, but rather fun too! We ended up adding a skype connection so we could yell "stop doing that!" at each other.
  12. Wow, he did that without taking a breath!
  13. Joshuag You might want to look at what I have done (er, am doing) with a bootstrap profile http://processwire.com/talk/topic/2411-bootwire-basic-twitter-bootstrap-profile/ Basically I am creating two - one that has bootstrap installed and then demonstration pages showing how some of the bootstrap elements work in this environment (which is actually straight out of the box, but it is nice to show it anyway) Then the second is the same things with just about everything removed - almost no fields, only a couple of template files, no content, just ready to go and put together so that more up-to-date bootstrap versions can be just dropped in place. The only extras in there is the standard Bootstrap menu system wired into PW and basic demo carousel and accordion files to save people having to mess around with these. So, that is the profile that is really useful to people - the first is just a reference. Joss
  14. Joss

    humblebump.com

    There is something about working with PW that seems to be encouraging people towards nice clean design. A great example!
  15. $goodvar = stripCrapCopy($dodgyText, goodText, en-GB);
  16. I am using Sublime rather than Aptana now - it is a memory hog issue (Aptana is huge) But I do miss some bits and pieces. Although I have the folder tree plugin, I miss the full file management you have in aptana - I cant copy and paste from Explorer into Sublime like you can with Aptana, for instance. Also, Aptana has a very powerful and built in syncing system that is much more full featured than the SFTP plugin for Sublime. I find I miss all the various additional reporting screens you get with Aptana/Eclipse much less than I thought I would. And Sublime is one hell of a lot faster - no typing lag (you get that with Aptana when you have a lot of projects). So, I will probably stick to Sublime now unless I am running on a very powerful box.
  17. Yes, I can't see how you would employ the traditional idea of themes. Profiles are not an alternative because they are not applied retrospectively. The nearest I could see is if a developer created a range of profiles that used exactly the same styling system, and then created alternative themes - but that would not work outside of that environment and you would only have to play with the profile a tiny bit for this to stop working. None of this I see as a problem, because I don't see ProcessWire as being aimed at that part of the market place. Although the growth of profiles will be important, it really is in a subtly different way than people choosing WP because they found a nice theme: They show what is possible, They give starting points for less techy developers (like me!) They are short cut starters for more techy developers (who are naturally lazy) They provide framework variations Interestingly, I think there is more value in developing "module" plugins to give quick functionality - styling from scratch can be very quick; creating functionality can be laborious sometimes. For instance, a simple blog module would come with fields, page hierarchy (including category and tag selectors), templates and template files (as much split out into "inc" files as possible), all laid out in a very neutral way. I would be "almost" usable out of the box, but would really require styling and fitting into the existing site structure. These would be labour saving rather than instant solutions though - probably created by a developer to help themselves. But then, that is how PW started years ago!
  18. Hi Jeff I will check that - thanks!
  19. Hi Doolak Can this template be used for new pages? This means that you can stop this template being used again. Particularly useful if the template has a very specific use for just one page and will be little use anywhere else. May pages using this template have children? Where pages using this template exist and whether or not this template can be used for any other pages, you can set whether those existing pages can have children or not. If they can, then you can additionally confine them to using just one or more template. It is only complicated because it is so versatile!
  20. Well, the first thing is to actually try it so you understand the basics of how it works and how all the elements work together. This is a tutorial that will take you through all the basic elements of how processwire works: http://wiki.processwire.com/index.php/Basic_Website_Tutorial Once you do that, and have a better idea of the system, then you will be able to ask specific questions that will help you create your site. Good luck Joss
  21. Thanks Mr Carver I did play with recursion and processwire chucked me a huge error - but then, I think I was doing it wrong. I will have a play once I have sorted out the little bit of work I have just got from my leaflet run Joss
  22. Starter version updated - see note on OP
×
×
  • Create New...