Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/10/2013 in all areas

  1. This is the third of my demos using ProcessWire, attempting to both show the flexibility of the system to local clients and to demonstrate a range of basic site approaches http://pwdemo3.stonywebsites.co.uk/ This one takes the idea of using blocks to an extreme. It allows you to create a large library of blocks with some standard customisations: You can Choose to display a title or not Choose to link the title to another page Additionally, link the image to another page Choose to display an image or not Display the image above or below the text Add a video to the text box Choose an icon from a list (and turn it off and on) Select a colour theme for the block from a pre-designed set Each page has tools to select and arrange blocks from the library - only the footer blocks are controlled globally. I have used a fairly artistic approach for this particular version, but to be honest it could be used for anything Note to self: When dealing with lots of lorem ipsum, don't hit the spell-check button.
    3 points
  2. ryan - tick the boxes next to the relevant post numbers (top-right of the posts) then in the box that appears at the bottom right select the Split option and you can create a new topic with those posts I've never understood why now the jQuery folks have such a solid product that they insist on changing things with no backward compatibility. Sure, it's only a few changes each time, but it causes some work checking everything works as expected across however many sites.
    2 points
  3. I found (after 2-3 Projects using PW) that it's a good technique to use templates in a way I think hasn't been thought of yet really by some. (Although the CMS we use at work for year, works this way.) I'm sure I'm maybe wrong and someone else is already doing something similar. But I wanted to share this for everybody, just to show alternative way of using the brillant system that PW is. Delegate Template approach I tend to do a setup like this: - I create a main.php with the main html markup, no includes. So the whole html structure is there. - I then create page templates in PW without a file associated. I just name them let's say: basic-page, blog-entry, news-entry... but there's no basic-page.php actually. - Then after creating the template I make it use the "main" as alternative under "Advanced" settings tab. So it's using the main.php as the template file. - This allows to use all templates having the same php master template "main.php" - Then I create a folder and call it something like "/site/templates/view/", in which I create the inc files for the different template types. So there would be a basic-page.inc, blog-entry.inc ... - Then in the main.php template file I use following code to delegate what .inc should be included depending on the name of the template the page requested has. Using the TemplateFile functions you can use the render method, and assign variables to give to the inc explicitly, or you could also use just regular php include() technic. <?php /* * template views depending on template name * using TemplateFile method of PW */ // delegate render view template file // all page templates use "main.php" as alternative template file if( $page->template ) { $t = new TemplateFile($config->paths->templates . "view/{$page->template}.inc"); //$t->set("arr1", $somevar); echo $t->render(); } <?php /* * template views depending on template name * using regular php include */ if( $page->template ) { include($config->paths->templates . "view/{$page->template}.inc"); } I chosen this approach mainly because I hate splitting up the "main" template with head.inc and foot.inc etc. although I was also using this quite a lot, I like the delegate approach better. Having only one main.php which contains the complete html structure makes it easier for me to see/control whats going on. Hope this will be useful to someone. Cheers
    1 point
  4. Hey, guys. After much reading, learning, and experimenting with ProcessWire, I finally have something to show: humblebump.com It's not totally finished - there are some features I want to add - but I feel good shipping it as is and adding as I go. ProcessWire is great because I can add things as I learn. It's really flexible. Thanks for checking it out. Let me know what you think or if anything looks/works strangely.
    1 point
  5. I used it once to integrate some of the mail functions so when staff logged into a specific site they could also see the contents of a specific email inbox. This allowed them all to see the emails sent to the news@ address and copy and paste them into pages. EDIT: for anyone else thinking down these lines, it would be easier to stick a FormBuilder form on your website now and handle news submissions from the public that way, but this was a looong time ago. There are tonnes of possible uses, but yes I doubt you would use any of the functions where there is overlap with ProcessWire. Thing is though you only need to download the bits you need so it's not like you're throwing the whole library at a problem (just got a mental image of someone throwing encyclopaedia's at me)
    1 point
  6. Anyone tried Brackets, Adobe open-source project editor? http://download.brackets.io/
    1 point
  7. There is also a plugin for sublime text http://wbond.net/sublime_packages/sftp
    1 point
  8. Saw this - very cute http://tinymce.swis.nl/demo
    1 point
  9. ha - glad it cheered you up. That is daughter number two on one of her cheerier days. I am hoping they might be a little inspiring for one or two local companies too and that they give me some work!
    1 point
  10. Thanks Adam, this couldn't have come at a better time for something I'm working on. Sometimes I feel like I've got a team of developers working in the same room as me, and other times like this I feel like you're reading my mind. GET OUT OF MY HEAD! *puts on tinfoil hat*
    1 point
  11. apesia and ryan, Thank you for your thoughts. I took a look at those just now, but it is going to take me a while to wrap my head around what those do... They look cool, but I'm not sure how to implement that. Ryan, I think is what I might do, then when the app really does need additional help, I can implement some sort of system that helps manage it. The only thing that concerns me with the overlap is that I will need to overlap quite a bit to make sure that I don't miss anything. Also, I want to get the information updated as fast as possible. hopefully it at least will have everything updated 1 time per hour... Another thing that I thought about using once there are people using the application is the LazyCron module, that might help speed things along as long as I can put something in the code that regulates requests to Amazon (because they will only allow a certain amount per sec and per hour) Anyhow, I am going to run with these suggestions and see what I can put together. Thank you guys!
    1 point
  12. Hi all.. this is my first post in this forum, so I'm a bit nervous I've been dabbling with XML before, and the only decent alternative I found to Altova's XMLSpy is Oxygen (http://www.oxygenxml.com/), available on OSX too. Also, I remember there's a feature in the LibXML2 libraries included in PHP called pull parsing, that could be useful to handle big files. I haven't the need to work with it, but seems useful (http://www.ibm.com/developerworks/xml/library/x-pullparsingphp/index.html) Hope it helps.
    1 point
  13. Redactor is nice, but I would go even simpler http://xing.github.com/wysihtml5/ (doesn't need jquery) And there is a Bootsrap version of the same editor: http://jhollingworth.github.com/bootstrap-wysihtml5/ It seems pretty customiseable and straight forward. There is also http://jqueryte.com/ But I have never used it. Obviously Aloha - but it is really aimed at front end than back end. There is also http://jhtmlarea.codeplex.com/ Not updated since last august and really needs better buttons! I think the xing one is the sort of thing that would be most useful, probably because it can be built to our own specs (as the bootstrap version demonstrates) - the basic version on the github site does not even have graphic buttons! Possibly just fork it and create a PW version.
    1 point
  14. Just to stir the pot.... This also works with the Thumbnail (crop-image) module/field type. So you might set two thumbnail sizes (under Input in the field settings): thumbnail,160,100 largethumb,800,600 And then, within your loop you would do something like: <a class="fancybox" rel="group" href="<?php echo $news_item->news_image->getThumb('largethumb'); ?>"> <img src="<?php echo $news_item->news_image->getThumb('thumbnail'); ?>" /> </a> Where news_image is the name of your thumbnail image field and fancybox is the class that fires fancybox if are using that (or for what ever lightbox type system you are using) This is slightly overkill for your use, but it is a useful way of doing it and allows you to have multiple sizes to play around with if you want to go completely mad. There are cases for using Repeaters for this sort of gallery, however. For instance if you want to have overlays on the images with full HTML rather than just the description box, or you want to add lots of other information to the image display. Joss
    1 point
  15. You're welcome, glad to hear it works! This is ProcessWire, you can solve almost every problem in less time with less coding... Sometimes I ask myself: Wow this is so simple with Pw, how would I've done this before? ;-)
    1 point
  16. Hi netzartist – welcome to the world of Pw! Don't use repeater fields for multiple images. You achieve the same with the "Image" Fieldtype by setting maximum files = 0. This way you can upload and store multiple images with descriptions. You can do these steps: - Remove the repeater from your template - Change the "maxiumum files allowed" of your images field to 0 - Add the image field to your template - Upload multiple images Then your code needs minor changes: foreach($page->children as $news_item) { ... //images is the name of the Image Field if (count($news_item->images)>0) { foreach ($news_item->images as $image) { <?= $image->width(250)->url; ?> <img src="<?= $image->width(250)->url; ?>" width="250" alt="" title="<?= $image->description ?>" /> } } } Here's why your code didn't work: foreach ($news_item->image_repeater as $image) { //$image is not yet your image field, it is an "Item" of your repeater which can contain multiple fields } //This would work, but if you only need multiple images, don't use a repeater foreach ($news_item->image_repeater as $item) { $image = $item->image; //... }
    1 point
  17. Thanks for the testing JeffS. Glad to hear all is going smoothly so far. I would open a new thread... but don't really know how to do that and move these messages there. If I figure it out, I'll do it. I like staying on top of the latest jQuery, but the reality is they are prone to changing their API and breaking things in every major version. I think it's better to let those versions marinate for awhile in a dev branch before making them part of stable. So I'll update to 1.9 in the dev branch once we get 2.3 out there.
    1 point
  18. THis is now out of date and WILL NOT WORK with recent versions of ProcessWire This is a Bootstrap based admin theme This is a very early release and may not be up to production standards - use at your own risk, or just play around with it. UPDATE New version has lots of improvements (see screenshots) and has been updated to Bootstrap 2.3 And roll back to 2.2.2 - at least the JS. It runs into problems with the version of JQuery, I think. Important - this is developed for the DEV branch of ProcessWire and is not fully compatible with the current stable release. The Bootwire Admin theme uses the most current version of Twitter Bootstrap and should be easy to update as new versions come out. Any changes to Bootstrap are done with overrides and the bootstrap.min.css and bootstrap-responsive.min.css are left untouched. Features The theme has been kept sympathetic to the original PW admin colours and layout. The top menu features drop downs rather than linking to an intermediate page (thanks to Soma and his lovely Teflon theme for the menu). I have tried to make the theme as responsive as possible, but I was foiled on some pages by some Tables and TinyMCE - if you want a responsive edit page, make sure your TinyMCE tool buttons are over a couple of rows rather than one long one. Page list actions have been replaced with Icons so that they take up less space (useful for small viewports) Compatibility This was designed using the PW Development branch and using the Chrome browser. It has been tested on other browsers, but not extensively, so any problems, please yell! Overrides Overrides to Bootstrap are in the bootstrap-overrides.css file. Main,js has several overrides to turn elements Bootstrap compatible. There is also a commented out section which changes the page list icons to a dropdown button - however, this is not working in this version. Installation Unzip the archive and place the template-admin directory in your "/site" directory. Note: since this is not a full release, it is not available through Soma's Module Manager. Thanks Soma, for allowing me to steal bits from Teflon and helping with the menu markup Diogo for Teaching me a bit of JQuery and helping with the page list action button (still to be implemented) Ryan for making it possible to create an admin theme in a couple of days (including working on other stuff) Files Now on GitHub: https://github.com/jsanglier/Bootwire-Admin/ Download Hope you enjoy it - leave nice comments below! Joss Screenshots bootwire-admin-v0.4.1.zip
    1 point
  19. Thank you both. I'm having a great time with PW as opposed to other CMSs I've tried in the past. I actually have fun putting things together and getting things to work!
    1 point
  20. I just can't see how ST2 can be bettered right now. I used to like Coda and Textmate and they're fine but ST2 just saves me so much time. The multiple selection commands, go to anything commands, select next etc Coding is just so fast with it, also the program itself is blistering, I've no idea how the developer manages it but it's everything is just so fast. At the very least worth trying out for those who haven't used it.
    1 point
  21. I think you've got a good method there, but just be mindful of security. Any time you let paths and files be specified from the admin, you've really got to trust whoever will be populating those paths/files. When it comes to template files, it's best if you keep all the shared stuff out of them and include that separately. For instance, the basic profile includes head.inc and foot.inc, which represent the markup common to all pages. But you can take that much further, delegating to separate includes for other elements when it makes sense (sidebar, navigation, etc.) I also like an approach where you setup some common features in your template that you can turn on or off with checkboxes on the page. For instance, you might have a checkbox that turns on/off the sidebar or comments, etc. And the detection and display of those things would likely be in your shared include files like head.inc or foot.inc. So when it gets down to the actual template file, it doesn't have to focus on anything other than what's completely unique to that template. Even on very large sites, its rare that you should need a lot of templates if you are using them as types and controllers rather than using them to represent minor markup changes. But there are a whole lot of approaches that you can take, and what is best for one may not be for another.
    1 point
  22. Thanks for posting Soma, this is an interesting approach and not one I've seen before, but it looks great. The underlying concept and result is similar to the approach I usually use. Since you posted a good description, I'll try to do the same for mine. The only reason you see head/foot files in the default PW profile is because it seems to be simpler for new users to grasp. But I almost never use that approach in my own sites. Like your system, I have a main.php file which is my main markup file. But unlike your system, main.php is included from all the other template files (rather than main.php including them). The other template files focus on populating the key content areas of the site, specific to the needs of the template. Examples of key content areas might include "main" (for center column/bodycopy) and "side" (for sidebar/related info), though often includes several other identified areas. But I'll keep it simple in this case. Here's how it works: basic-page.php <?php $outMain = "<h2>{$page->subtitle}</h2>" . $page->body; if($page->numChildren) $outMain .= $page->children->render(); // list the children $outSide = $page->sidebar; include("./main.php"); main.php <html> <head> <title><?php echo $page->title; ?></title> </head> <body> <h1><?php echo $page->title; ?></h1> <div id='main'><?php echo $outMain; ?></div> <div id='side'><?php echo $outSide; ?></div> </body> </html> The benefit of this approach is that basic-page.php can setup whatever it wants in the key content areas ($main or $side) whether simple like in this example, or something much more complex. I actually prefer for the variables representing the key content areas to be optional. In the scenario above, $outMain and $outSide would have to be defined by every template or they would end up as uninitialized variables in main.php. As a result, I actually use $page as an anonymous placeholder for these variables (making sure they don't conflict with any existing field names) and then let main.php assign defaults if the calling template didn't specify one of them. For example: basic-page.php <?php $page->outMain = "<h2>{$page->subtitle}</h2>" . $page->body; if($page->numChildren) $page->outMain .= $page->children->render(); // list the children // note: no $outSide specified include("./main.php"); main.php <?php // setup defaults when none specified if(empty($page->outMain)) $page->outMain = $page->body; if(empty($page->outSide)) $page->outSide = $page->sidebar; ?> <html> <head> <title><?php echo $page->title; ?></title> </head> <body> <h1><?php echo $page->title; ?></h1> <div id='main'><?php echo $page->outMain; ?></div> <div id='side'><?php echo $page->outSide; ?></div> </body> </html> Final thing to point out here is that main.php is the only template actually outputting anything. Because basic-page.php (or any other template) is determining what's going to go in that output before it is actually sent, your template has the opportunity to modify stuff that you might not be able to with other methods. For instance, the <title> tag, what scripts and stylesheets are loaded, etc. Here's the example above carried further to demonstrate it: basic-page.php <?php // make a custom <title> tag $page->browserTitle = $page->rootParent->title . ": " . $page->title; $page->outMain = "<h2>{$page->subtitle}</h2>" . $page->body; if(count($page->images)) { // display a clickable lightbox gallery if this page has images on it $config->scripts->add($config->urls->templates . "scripts/lightbox.js"); $config->styles->add($config->urls->templates . "styles/gallery.css"); $page->outMain .= "<ul id='gallery'>"; foreach($page->images as $i) { $t = $i->size(100,100); $page->outMain .= "<li><a href='{$i->url}'><img src='{$t->url}' alt='{$t->description}' /></a></li>"; } $page->outMain .= "</ul>"; // add a note to $page->title to say how many photos are in the gallery $page->title .= " (with " . count($page->images) . " photos!)"; } if($page->numChildren) $page->outMain .= $page->children->render(); // list the children include("./main.php"); main.php <?php // if current template has it's own custom CSS file, then include it $file = "styles/{$page->template}.css"; if(is_file($config->paths->templates . $file)) $config->styles->add($config->urls->templates . $file); // if current template has it's own custom JS file, then include it $file = "scripts/{$page->template}.js"; if(is_file($config->paths->templates . $file)) $config->scripts->add($config->urls->templates . $file); ?> <html> <head> <title><?php echo $page->get('browserTitle|title'); // use browserTitle if there, otherwise title ?></title> <?php foreach($config->styles as $url) echo "<link rel='stylesheet' type='text/css' href='$url' />"; foreach($config->scripts as $url) echo "<script type='text/javascript' src='$url'></script>"; ?> </head> <body> <h1><?php echo $page->title; ?></h1> <div id='main'><?php echo $page->get('outMain|body'); // use outMain if there, or body otherwise ?></div> <div id='side'><?php echo $page->get('outSide|sidebar'); // use outSide if there, or sidebar otherwise ?></div> </body> </html> More than half the time, I'll actually just re-use page variables like $page->body and $page->sidebar rather than $page->outMain and $page->outSide. That way there's no need to consider defaults, since $page->body and $page->sidebar untouched technically are defaults. <?php $page->body = "<h2>{$page->subtitle}</h2>" . $page->body . $page->children->render(); But technically you've got a little more flexibility using your own self-assign anonymous variables like outMain and outSide, so figured I'd use that in the examples above. outMain and outSide are just example names I came up with for this example and you could of course name them whatever you want.
    1 point
×
×
  • Create New...