Leaderboard
Popular Content
Showing content with the highest reputation on 03/12/2012 in all areas
-
Markup Simple Navigation Module While there was a lot of people asking how to make navigation, and there were many examples around already (apeisa, ryan...) I took the chance to sit down 2-3 hours to make a simple navigation module. It has even some options you can control some aspects of the output. Installation: 1. Put this module's folder "MarkupSimpleNavigation" into your /site/modules folder. 2. Go to your module Install page and click "Check for new modules". It will appear under the section Markup. Click "install" button. Done. Technically you don't even need to install it, after the first load call ( $modules->get("MarkupSimpleNavigation") ) it will install automaticly on first request if it isn't already. But it feels better. However, it will not be "autoloaded" by Processwire unless you load it in one of your php templates. Documentation: https://github.com/somatonic/MarkupSimpleNavigation/blob/master/README.md Modules Repository processwire.com mods.pw/u Download on github https://github.com/somatonic/MarkupSimpleNavigation Advanced example with hooks creating a Bootstrap 2.3.2 Multilevel Navbar https://gist.github.com/somatonic/6258081 I use hooks to manipulate certain attributes and classes to li's and anchors. If you understand the concept you can do a lot with this Module.1 point
-
For the end of the year, I've made a new admin template called Futura. UPDATE 1: Moved position for logged in user to breadcrumbs area on the right / Ryan Fixed logo being cut off ("s") / Ryan Fixed Page List (blank row appeared when moving pages) / Ryan UPDATE 2: Replaced current code execution timer with PW integrated / Ryan Removed "Sidebar headline" and replaced it with search in similar color fashion / Ryan, Apeisa Added "Newest added" in the sidebar below "Latest updates" UPDATE 3: Replaced seach with finalized colors I've overlooked some things in the UI and made according corrections UPDATE 4: I apologize, I've attached the wrong css file in the final build that was attached (1.0.4), please download it again. UPDATE 5: Replaced old screenshots with new ones I've removed previous version from file downloads repository, consider the one attached in this post as final. If I spot some mistakes along the way, I'll correct them and update this post. Here are the screenshots: For full user experience, download cirkuit.zip (it's TinyMCE theme) and put it into this directory: /wire/modules/Inputfield/InputfieldTinyMCE/tinymce-3.3.9.2/themes/advanced/skins/ then open InputfieldTinyMCE.js located in /wire/modules/Inputfield/InputfieldTinyMCE/ directory and replace skin: "o2k7" with skin: "cirkuit". Tell me what you think and if you find any bugs in the template, please let me know... Greets to all on the forum and I wish you a Happy New Year 2012.! cirkuit.zip futura-admin-template-1.0.4.zip1 point
-
Hey all. I just put up another site using PW. Thanks everyone for helping me get started using PW! Check it out here: http://www.eastsidenurseryschool.org/ What do you think?1 point
-
What is wrong with strip_tags? $strippedText = strip_tags($unstrippedText); Regarding length, you could use one of the word / sentence cutting functions. I have no time to search for one right now, but I remember seeing one, that would take string and length you wanted - and it gave you snippet, which ended with full sentence (if the delta between max_length(the one you wanted) and actual length was lower than 5%) or with whole words.1 point
-
Thank you for your great suggestion, Adam. I actually knew that a.header with display:block: would behave like any other div. The only thing was that I didn't think of doing it that way until you suggested it. I absolutely agree that it's better to avoid javascript when it isn't needed, like here. But I am still glad I didn't think of this solution in the first place and just asked the question. I learned about PHP-powered javascripts, including .js in php files, json config objects and still ended up with the easiest and cleanest solution. That's why I love this forum. Thanks guys! /Jasper1 point
-
No problem Ryan. I will get more case studies up as I go along. Hopefully, this will entice other people here to do the same and add real use cases for people considering PW. I'm also hoping that this will persuade people that PW actually delivers on its promise - and isn't too good to be true as it first seems. I think a subforum should be fine.1 point
-
This is the way to create template and fields with API: // new fieldgroup $fg = new Fieldgroup(); $fg->name = 'new-template'; $fg->add($this->fields->get('title')); // needed title field $fg->save(); // new template using the fieldgroup $t = new Template(); $t->name = 'new-template'; $t->fieldgroup = $fg; // add the fieldgroup $t->noChildren = 1; $t->save(); // add one more field, attributes depending on fieldtype $f = new Field(); // create new field object $f->type = $this->modules->get("FieldtypeFloat"); // get a field type $f->name = 'price'; $f->precision = 2; $f->label = 'Price of the product'; $f->save(); // save the field $fg->add($f); // add field to fieldgroup $fg->save(); // save fieldgroup All pretty much standard OO one can figure out looking at core and PW modules. But not someone unexperienced would figure out by themself. I think at some point we need to cover these in a documentation.1 point
-
Then it actually totally doesn't have to be header... just make it a.header and you're all set. It seems to me that you do not know this (pardon me if you do), but with 'display:block;', link ('a') will act as if it was just another div, so I would go for it - it will work the very same way it does now without any javascript. Note: If it will seem I push it too hard, it's only because I always try to go for as little JS as possible, and this is one of those rare moments when using pure HTML instead of JS is dead simple.1 point
-
Hello all, First time user of pw here and I like what I'm seeing; a lot. Ryan and all the contributors have done a great job on this project so thank you to one and all. Coming from a background writing plugins for Textpattern CMS I thought I'd start off looking at the modules system. Being able to git clone a module right into a test installation is very nice but I quickly found myself having to scroll through lots (and lots, and lots) of entries to locate the first module I cloned before I could hit the install button. Soooo, I took a look a the code and decided to simply have the message about newly available modules link to its entry in the list. Makes installation much less scroll-prone. You can check it out for yourselves at https://github.com/n...ver/ProcessWire and I've submitted this to Ryan as a pull request. Hope this is useful to someone here.1 point
-
You could output a json config object using php , then it will be available in your js. before your scripts in the header: <?php $jsconfig = array( 'root' => $config->urls->root, 'domain' => $config->httpHost ); echo "<script>var config = " . json_encode($jsconfig) . ";</script>"; ?> this will output an json object <script>var config = {"root":"\/","domain":"pw2-dev.ch"};</script> you can access in js like this <script> $(document).ready(function() { $('#header').click(function(){ window.location = "http://"+config.domain;; }); $('#search_form').click(function(event){ event.stopPropagation(); }); }); url = config.root; </script> This is the most easy and convenient way for me.1 point
-
nikola, the problem is probably here: $selector .= "price>=$priceMin, $price<=$priceMax, "; should probably be: $selector .= "price>=$priceMin, price<=$priceMax, "; (notice the dollar sign in the second condition)1 point
-
Hello everyone, Btw Having played a little with PW and read a little I am just too impressed to return to my EE training and instead have decided to just try and build the site I was due to build next with PW — thank you Ryan and others for PW. .htaccess and HTML5 Boilerplate In my build I will be attempting to knit-together the .htaccess file that comes with the HTML5 Boilerplate (H5BP) and the one that ships with PW. For many (perhaps for me when I come to do it) this will likely be very simple. Indeed I don't envisage problems but I assume I'll have a few questions. The purpose of this thread is either for others to note what they have found when doing this or if no one comments, when I succeed in merging the two by trial, error or research to list here what I found. I may be some time, but when I've done it (or read here how to do it) I'll post again and hope this may be of some help to others who may like me be a little intimidated by large .htaccess files. Cheers, -Alan1 point
-
Wow, thank you guys for putting so much effort into this.. I'm just catching up on the discussion now! Since I work in Hong Kong and have clients in China, I'm going to give a shot into translating into simplified chinese (zh-CN)... but don't expect anything too soon, I don't know the language~1 point
-
I made an update to the module. If you get the latest version you'll get new features. Added support for custom selector: Instead of adding more options to exclude pages, since PW is so open as to how to set up you pages/template stucture, I've implemented the option to specify a PW selector. So some of the power of it comes into play. (Remember it's always best-practice to sanitize values that may come from user input you can trust. This module doesn't do any) You can for example hide page(s) with a certain or parent(s): echo $tree->render( array("selector" => "parent!=1008|1002") ); And child pages from those parent will not be rendered. Or if you want to exclude page(s) with certain template(s) you would do : echo $tree->render( array("selector" => "template!=news-item|event-item") ); Or you could limit the items per level: echo $tree->render( array("selector" => "limit=5") ); Added support for "first,last" class: A new option that is off by default, that will output extra class to links. You can turn it on with the options "css_firstlast_on" set to true array('css_firstlast_on' => true) Minor changes: Done some renaming and restructuring. Also removed some newlines in the markup output.1 point