Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/29/2013 in all areas

  1. ..and just under four months later the wizard himself has over 2k likes! Didn't say it aloud myself when he hit the first thousand, so here goes: thanks Ryan! There hasn't been a moment of "nothing to do" for ages for me .
    4 points
  2. When you are trying to mix disciplines, it is amazingly easy to find they overlap in odd places. I have just been doing a template where I have a foreach statement retrieving values from some blocks. My variable would be, quite understandably $thisblock. In the style that is common with such things, I dutifully wrote: foreach($thisblocks as $thisblock) Then, as I looked at it, and before I could stop myself, the writer side of me kicked in and I corrected it to: foreach($theseblocks as $thisblock) There is no hope for me....
    3 points
  3. I introduced today one of my clients to Processwire, i've just ported her site from Joomla. After 5 minutes clicking, showing and telling she just said: " This is all? So easy?" Looks like a new fan Any similar situations someone?
    3 points
  4. And there I was thinking I was making a joke! foreach($blokes as $bollocks)
    3 points
  5. This module enables you to limit edit access (by role) to any field in the page editor. This essentially provides field level access control on top of the existing access control system. It removes access to fields within a template, which is something that the built-in access control does not currently do in ProcessWire. This gives you a nice and simple granular control of fields. For instance, you might have two users (with different roles) that have access to edit a page, but only one of them could edit a particular field you had limited access to. Another example might be if you (the superuser) wanted to keep a notes field that only you would see in the page editor. But those are just simple examples, and the possibilities are quite broad. I've been wanting to find a way to provide field-level access for awhile, so this module has been on my mind for a bit. But what motivated me to finish it was a need that came up earlier today by Raymond Geerts in this thread where he needed the ability to limit access to fields on the page's settings tab... this module would do that quite nicely. http://modules.processwire.com/modules/page-edit-field-permission/ https://github.com/ryancramerdesign/PageEditFieldPermission How it works This module hooks in to modify the behavior of Page::editable, which is used throughout ProcessWire, but most notably by Page Edit. This module looks for permissions in the system that follow the name format of page-edit-[field] where [field] is the name of an existing field in the system. When it finds such a permission during a Page::editable call, it checks to see if the roles from the current user have this permission assigned. If they do not, then permission to the relevant field is refused, thereby preventing edit access to the field. This module also hooks into the Page Edit process and simply removes fields that the user doesn't have access to edit, before the form is rendered or processed. How to use it Once the module is installed, you get a set of checkboxes on the module configuration screen. Check the boxes next to each field that you would like it to create permissions for. (Alternatively, you can create the permissions yourself, so this is just a shortcut). You should only create permissions for fields that you intend to limit access to. Once your new page-edit-[field] permissions are created, any non-superuser roles that previously had access to edit those fields will no longer have access to edit them. To give them access, you must edit a role and check the box for the relevant permission.
    2 points
  6. You don't know what it is like here. Always mixing English and Finnish: foreach($blocks as $palikka)
    2 points
  7. My favorite: http://martinfowler.com/bliki/TwoHardThings.html
    2 points
  8. Oh, its just a flyer - something silly to get started. I will follow up with a more serious one in a few weeks. It is very ... British!
    2 points
  9. Okay, getting it working properly now, with all kinds of variables. This is what the fuss is about (not finished yet) Basically, everything on the page (apart from the long text bit) is a block from a central library. The blocks can have different themes, videos, text, icons and so on. THings like titles can be swithed on and off. For desktops, the blocks on each row are equalised in size (but that turns off for tablet and phones because it messes up)
    2 points
  10. Mmmmmmmmh My first impression after discovering pw.: Aha another CMS. Maybe I give it a try in a few days. ..... Few days later ..... WOW
    2 points
  11. IMPORTANT This is now well and truly out of date! I strongly suggest ignoring it. The Bootwire System This is a series of proof-of-concept profiles based on ProcessWire 2.3 (forthcoming) and the Twitter Bootstrap Framework They are currently using Bootstrap 2.3 and JQuery 1.9.1 Bootwire Starter Profile Version 0.5 This version if for those who just want to leap in and get their hands dirty, It includes almost no content at all, very few fields and templates and very little markup. The normal Bootstrap navigation is in place for reference. More details are in the readme. Download Here: http://stonywebsites.co.uk/Bootwire-Starter-Profile.zip Github: https://github.com/jsanglier/Bootwire-Starter-Profile ============================================================ All versions come with a Site Settings page which is a child of a Content Management page in the page directory. This is used for common elements such as site title. The Starter Version has almost nothing in it! Some additional tweaks have been added to TinyMCE and these profiles are pre-loaded with the Modules Manager, the Profile Exporter and the Page Delete module. Please use the Module Manager to ensure all modules are up to date. NEW: Now with some demo functionality in a functions.inc file. Bootwire Demo Profile Built on the starter profile, this version demonstrates some Twitter Bootstrap functionality in the context of a ProcessWire installation. The Demo can be viewed here: http://bootwiredemo.stonywebsites.co.uk/ Download here: http://stonywebsites.co.uk/Bootwire-Demo-Profile.zip Github: https://github.com/jsanglier/bootwire/ Bootwire Admin Theme I have created an admin theme using Bootstrap 2.2.2. It is functioning but should be treated as a work in progress. However, you may like it. It has its own thread here. http://processwire.com/talk/topic/2640-bootwire-admin-proof-of-concept-admin-theme/ ============================================================== Future Profiles Bootwire Blog Profile This is intended to be a basic blog system using the Bootstrap framework. I am planning to start from scratch with the blog, basically because I need the exercise. It will not be as clever as Ryan's system, but it will have the following features (er ... possibly): Category Tree Tag System In-Article gallery Media pages Alternate themes for posts Lots of global settings Manual related posts Automated related posts (okay, probably beyond me) er ,,,, some other great feature that I have not thought of yet.
    1 point
  12. Hey everyone, I'm trying to build a single-page portfolio on ProcessWire, I think I've got the header and footer right, but I'm having doubts on how to setup the portfolio area. I was hoping you guys could give me a hand since I'm very used to ExpressionEngine designer-friendly tags. My english is not very good so I created an image to show what I'm trying to do: http://i46.tinypic.com/23r1tl3.png So I'm trying to figure out is: -how to create the slider for every project I add -how to create tags or categories for every project The date I suppose I should use the datepicker field, right? And title and description are basic text fields...
    1 point
  13. Maybe very british means, c´mon let´s make a leaflet in the pub?
    1 point
  14. Delete the entry in the modules table and you should be fine.
    1 point
  15. Joss, I love the wording on your flyer. But is "advertsing" a British spelling (or humor... err humour?), or is that a misspelled word?
    1 point
  16. Not currently. Though I suppose you could create a module to hook the relevant components to do this. But the custom header name has come up as a repeated request, so this will be added pretty soon. The ability to have the items collapsed has also come up before, though not necessarily to have some collapsed and some not, but I'll look into it.
    1 point
  17. Thanks to your post i now know that Pw comes with a FileLog class. Just checked it out. Very handy for my next project, so I wasn't wasting my time Cheers
    1 point
  18. Järjestelmä - System Epäjärjestelmä - Unsystem Epäjärjestelmällisyys - Unsystematicality Epäjärjestelmällisyydellinen - Something that is seen as unsystematicality Epäjärjestelmällisyydellistyttää - To make something/-one be seen as unsystematicality Epäjärjestelmällisyydellistyttämätön - One that hasn't made something be seen as unsystematicality / Something that hasn't been made be seen as unsystematicality Epäjärjestelmällisyydellistyttämättömyys - The act of not having made something be seen as unsystematicality Epäjärjestelmällisyydellistyttämättömyydellä - With the act of not having made something be seen as unsystematicality Epäjärjestelmällisyydellistyttämättömyydellänsä - With his/her act of not having made something be seen as unsystematicality. Epäjärjestelmällisyydellistyttämättömyydellänsäkään - Not even with his act of not having made something be seen as unsystematicality. Epäjärjestelmällisyydellistyttämättömyydellänsäkäänkö - Is it not even with his act of not having made something be seen as unsystematicality. Epäjärjestelmällisyydellistyttämättömyydellänsäkäänköhän - I wonder if it's not with his act of not having made something be seen as unsystematicality. source: http://www.finlandforum.org/viewtopic.php?f=9&t=9172
    1 point
  19. 1 point
  20. @Joss, so far I know that css code is injected inline in the output of the embed tag if you checked the responsive option in the TextformatterVideoEmbed settings.
    1 point
  21. Hi Aren, Joss should have pointed out nearly everything you need to know about the image slider integration in the backend. The rest should be pretty straightforward, just add fields for all kinds of information you want to add for your project: Project Title (Text) Project Description (Textarea, maybe with TinyMCE) Tags (Page with Autocomplete, have a look at this thread for more information on how to implement it) Project date (Date)
    1 point
  22. Don't invite Pete. He'll put milk on it!!
    1 point
  23. Hi all, I've been lurking for months, soaking up the wisdom of the PW superheroes. A huge thank you to Ryan et al for your brilliant work. I'm about to launch my second PW site. Just one problem: Email Obfuscator is not reversing the characters upon output in 2.2.9. I don't think it's conflicting with any text formatters, as it works fine in a similar PW site running an earlier version. Any ideas? Thanks! Cliff
    1 point
  24. I would just settle for some work!
    1 point
  25. Just a note if you are wanting YouTube to be responsive (which it is not out of the can) Then I stole this from http://avexdesigns.com/responsive-youtube-embed/ Add this css somewhere: .video-container { position: relative; padding-bottom: 56.25%; padding-top: 30px; height: 0; overflow: hidden; } .video-container iframe, .video-container object, .video-container embed { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } The do this to your poor body block: <div class="video-container"><?php echo $page->body; ?></div> Obviously this probably only works neatly with just ONE video! Hmmm ... perhaps an alternative module-field type that is just a text box might be a good idea for this.
    1 point
  26. I also had the Problem with umlauts and strftime. The solution that worked for me was this line of code: setlocale(LC_ALL, 'de_DE.UTF-8'); Hmm PHP why isn't everything utf-8 by default...
    1 point
  27. Have a look under "Files": Images extend Files, so you can use all the methodes / properties from $files.
    1 point
  28. I remember one of our runners getting one for his birthday and turning up with it at the studios. He was so pleased with him self. At the time, my brother was working for the great Ed Ross (designer of the Quantum statistical engine) just down the road and they had bought a brand new Prime mainframe. (I think we used it to play a very early version of Zork - well, had to use it for SOMETHING important!) So I looked at this rather dreadful wooden box with a few wires coming out of it, then I looked at the mainframe with its room full of white terminals, humming air conditioning and huge, floor standing drives.... Little did I realise that the tatty piece of nonsense was destined to be far more influential and important that that hugely expensive, room full of tape drives!
    1 point
  29. Confirmed: It has to do with something on IIS setup, tried it on Linux & Apache and it works fine...
    1 point
  30. Hi Josh, you can simulate different smartphones with google chrome press ctrl + shift + i goto settings (bottom right) click 'overrides' check user agent PS: site looks good!
    1 point
  31. New Stripped back version called Bootwire Starter now available on Github https://github.com/jsanglier/Bootwire-Starter-Profile (Hey, I almost sound like a pro - well, almost....)
    1 point
  32. Updated Ryans/drilonbs code to include marker cluster and custom icons. Marker clusters need this script to work. Here are the updated scripts: https://gist.github.com/4648340 Use at your own risk... If anyone with actual javascript skills could take a look at it, i'd appreciate it. /Mats
    1 point
  33. Hi casey, You can use $image->url foreach($page->images as $image) { $big = $image->size('', 800); $thumb = $image->getThumb('thumbnail'); echo "<a href='{$big->url}'><img src='{$thumb}' alt='{$image->description}'/>"; } The Cheatsheet is very handy to check methods and properties: http://processwire.com/api/cheatsheet/ Cheers
    1 point
  34. Frontend? I usually do this in my templates: <body class="<?php echo $page->template . ' page_' . $page->id; ?>"> Then in your css, you can define styles by Template or if necessary, by Page: /*Set styles for basic_page template*/ body.basic_page ul { margin: 0; } /*Or for a Page*/ body.page_2003 ul {margin: 20px; }
    1 point
  35. Making the labels configurable based on field values within them, as well as making them initially collapsed, have been mentioned a couple times. Given that, I think we'll have to add this the next time updates are made to the repeater Fieldtype. Repeaters aren't meant to scale infinitely, so if you need that kind of scalability repeaters aren't the best way to go. Though, you'll be glad to know we also plan to introduce pagination to repeaters eventually... so they will be more scalable from the admin interface side.
    1 point
  36. nn_basic_page_file contains Pagefiles object, which is inherited from WireArray, which is actually an object that PW uses pretty much everywhere. It is neat concept and makes working much faster than with regular PHP arrays. See more from here: http://processwire.com/api/arrays/ So from that link you find all the ways to find files from your field. Some examples: //first, this makes it all nicer: $p = wire('pages')->get(1001); $first_file = $p->nn_basic_page_file->first(); // like wanze showed above $second_file = $p->nn_basic_page_file->eq(1); $random_file = $p->nn_basic_page_file->getRandom(); $specific = $p->nn_basic_page_file->get("filename=myphoto.jpg");
    1 point
  37. $wire->pages->get(1001)->nn_basic_page_file->pagefiles->delete(); Leave out pagefiles, the name of your field is "nn_basic_page_file" Try this: //Delete the first file $firstFile = $wire->pages->get(1001)->nn_basic_page_file->first(); $wire->pages->get(1001)->nn_basic_page_file->delete($firstFile);
    1 point
  38. Have a look into the cheatsheet and search for delete, you get something like this: $files->delete($file) damn Antti was faster
    1 point
  39. http://processwire.com/api/cheatsheet/ $filefield->delete($file) requires actual file object as a paremeter. $filefield->deleteAll() deletes all the files.
    1 point
  40. Welcome to the forums Marcus Your $number_of_images variable will always hold the same value (in this case 5), so the result of the module 3 test will always be false. What you have to do is forget about the images count (you don't really need it for this), and use a simple counter for the loop. With this change, your code would look like this: <?php //$number_of_images = count($pages->get(1012)->images); <- no need for this $i = 1; // <- the counter starts with 1 foreach($pages->get(1012)->images as $image) { $thumbnail = $image->size(118,112); echo "<a href='{$image->url}'><img class='photo' src='{$thumbnail->url}' alt='{$image->description}' /></a>"; if ($i % 3 == 0) { echo "<p>Insert</p>";} // <- the module test is made against the counter i++; // <- update the counter on each iteraction } ?> PS: use the code tag on the editor when writing code. It will look much nicer
    1 point
  41. Been fighting the WYSIWYG editor. I usually do something like this: $index = 0; foreach($data as $value) { echo "Index: $index\n"; if ($index % 3 == 0) { // do stuff here } // Add 1 to the index variable $index++; } You get the picture
    1 point
  42. Greetings, Implementing a slideshow in ProcessWire is very intuitive. As long as you know the "standard" ways of including JQuery and CSS in your pages, and calling JQuery on a particular page, you are all set. There is just a bit of ProcessWire-specific syntax. I use BxSlider, Galleria, and FlexSlider in my sites. I find them very flexible and easy to use when implementing dynamic images. Below I outline the steps I use to get Galleria working. Step 1: Include the Associated JQuery and CSS Files The first step involves downloading the necessary files from the Galleria Web site and including them in your ProcessWire installation. In my example, I am using the basic Galleria CSS and JQuery, and I am using a Galleria theme, so I have three files altogether. 1. Place the CSS files here: /site/templates/styles 2. Place the Javascript files here: /site/templates/scripts 3. In your template, include the following in the <head> area (I include this in my head.inc file): <link rel="stylesheet" type="text/css" href="<?php echo $config->urls->templates?>styles/galleria.classic.css" /> <script type="text/javascript" src="<?php echo $config->urls->templates?>scripts/galleria-1.2.8.min.js"></script> <script type="text/javascript" src="<?php echo $config->urls->templates?>scripts/galleria.classic.min.js"></script> Step 2: Loop Through the Images in Your Template These instructions assume you have created an image upload field called "images." It also sets a size on the fly for the "large" gallery images and the "thumbnails." I run a test to assure that there are images. And I have linked the images to the content. You might do some of this differently. Just adapt your code. Add the following code (or something similar) where you want the slider to appear in your template: <?php /* Test to see if there are gallery images uploaded (number of images is > 0). If so, present a gallery. If not, leave this area blank. */ $image_num = count($page->images); if($image_num > 0) { ?> <div id="galleria_holder"> <div id="galleria"> <?php foreach ($page->images as $gall_image) { $large = $gall_image->size(640, 480); $thumb = $gall_image->size(200, 150); ?> <a href="<?php echo $large->url; ?>"><img src="<?php echo $thumb->url; ?>"</a> <?php } ?> </div> </div> Step 3: Fire the Galleria Script Directly below the code shown above, call the Galleria script and its options. Check the Galleria Web site for full instructions, but it is straight JQuery work at this point. The code below calls a Galleria theme, sets a "fadeslide" transition, and turns off the "counter" option (then closes the conditional statement opened in the snippet from Step 2): <script> Galleria.loadTheme('<?php echo $config->urls->templates?>scripts/galleria.classic.min.js'); Galleria.run('#galleria', { transition: 'fadeslide', showCounter: false }); </script> <?php } ?> There are some particular details for Galleria. But the three steps shown above are the same for just about any JQuery script I can think of. Thanks, Matthew
    1 point
  43. ProcessWire is a native category system, whether by structure or relation. I think the distinction is that we don't call them "categories" or "tags". But "does not have" makes it sound like they aren't part of the plan. When in fact, it's one of the underlying purposes of the system. ProcessWire's grandfather (Dictator CMS) had a category system called "channels" and it took me awhile to realize it, but they were a complete waste of time... The literal channels/categories were immediately rendered useless once the Page reference type entered the scene. I continued using channels on the sites that had started with them, but this antiquated type of category system never felt right again. Today's ProcessWire not only has categories, it has them on steroids. If each business only belongs in one category, and that will always be the case, then categories by structure is a good way to go. Meaning, your structure would be: businesses web-design a1-web ryan-cramer-design accounting acme-financial architecture top-notch-houses dlux-office-design restaurants las-tortillas bread-and-cheese-house If each business can be in multiple categories, then you'd want a structure like this: businesses a1-web ryan-cramer-design acme-financial top-notch-houses dlux-office-design last-tortillas bread-and-cheese-house business-types web-design accounting architecture restaurants Then each "business" page would have a "Page" reference field called "business_type" where the editor can check one or more boxes. Each business would display their types like this: <h2>Types</h2> <ul><? foreach($page->business_types as $t) echo "<li><a href='$t->url'>$t->title</a></li>"; ?></ul> Each business type would display the related business like this: <h2><?=$page->title?> Businesses</h2> <ul><? foreach($pages->find("business_type=$page") as $b) echo "<li><a href='$b->url'>$b->title</a></li>"; ?></ul>
    1 point
  44. HI Aaron Funilly enough, we have been talking about categories. As you noted, processwire does not have a native category or tag system, and the reason is that it is easy to build one using pages and the page field. This is incredibly rough: Create a template without a file - call it category for neatness! Dont add any fields to it. Create a page using this template - call it Categories (for fun) and make it published and hidden Now, create a couple of children to this new page with the same template - call them category 1 and 2. They should be published and visible. Now, create a new Page field - call it Category. Once you have created and saved it, edit it and under details Select a single, and then in the input tab, select PageListSelect and change the Parent of selectable page to your Categories page That field can now be added to articles and will save a category name with the page. You can then use that to filter results in your template files. You can use the same system to create nested categories, tags or whatever. You also have the option to allow people to create new categories from the field. That is very rough, sorry, but is a basic way to get you started. As for permissions, I haven't done a lot with those yet, but you can create user groups and restrict them to various functions. I am sure some better answers will appear shortly! Joss
    1 point
  45. Why so many template files? Is there any duplication between what you are doing from one template file and another? If so, remember never to repeat yourself and keep reusable stuff in separate includes, functions or modules. Also consider whether the different template needs might instead translate to stylesheets. But I know you have a good handle on all this stuff, so going to assume you really do need a lot of template files. In that case, I would suggest doing something like you indicated and considering your templates to be something more like template groups instead. Create a structure of pages that represent your "sub templates". Make them selectable, so that when you edit a template, you'll have a select box where you can choose a sub-template (with a field named sub_template). You can translate that page selection to a filename off a subdirectory in your /site/templates/ directory. For instance, lets say you are creating a page with template "news" and you want to have sub-templates of cnn, nbc and abc. You'd have a page structure like this to represent them: /sub-templates/ /news/ /cnn/ /nbc/ /abc/ And a template file structure like this to represent them: /site/templates/news.php /news/ cnn.php nbc.php abc.php Your news.php file might look like this: include("./news/{$page->sub_template->name}.php"); What I'm trying to get at here is that you can create a structure of pages to represent a structure of templates.
    1 point
  46. Redirects module is no good here, since it does redirects without pages. Redirect template would be better here (there are good examples in forum, but in hurry now).
    1 point
  47. You can also do this in newer versions of PW: $newpage->template = 'upload'; $newpage->parent = '/uploader-test/'; I suggest sanitizing the title, and excluding the name (since PW will autogen it from the title). So the above code would be replaced with this: $newpage->title = $sanitizer->text($input->post->title); Here is the current PW implementation for uploaded files. Perhaps there is a way we can populate this to $input->files, but currently I think it's best to be more specific when it comes to file uploads since there are added dangers and overhead. The WireUpload class does make things simpler and more secure. It also provides options for handling known quantities, filename sanitization, overwriting vs. making unique filenames, processing ZIP files, handling ajax uploads, etc. The full class is in /wire/core/WireUpload.php
    1 point
  48. 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
×
×
  • Create New...