Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/26/2013 in all areas

  1. If you turn off formatting a single image field is also an WireArray again. $page->of(false) $page->image->removeAll(); $page->save();
    3 points
  2. I promised I would share my summer-project when I got a bit further along and now most of basic design is up on the test server (still just test content though, only some of it will be there in production). Two pages remain to be styled and some minor touch-ups are left for sure, but the gist of the simple design should be visible. Clean Scandinavian has been the motto. Will update to publishable version over the coming week/weeks. I will also clean up the code and do some validation fixing etc during that time. Any suggestions, pointers and tips from you pros would be much appreciated (tough love is the ticket). Keep in mind that I am not a pro and that apart from a sole static site I helped a buddy with 10 years ago, this is my first attempt at any of this (html, design, php, cms etc), so spare me the sharpest ax. A testament to the Processwire excellence - and to all of you helpful souls on this page - is that I have been able to get at least this far with no prior experience, so I would like to extend a heartfelt thanks to Ryan, Soma, Teppo and all the rest of you that have helped form this product in general, and taken the time to help me out on specific questions. You truly rock! re le vo DOT se/en
    2 points
  3. They still could be named FieldtypeThumbnails, InputfieldThumbnails and ProcessThumbnails ... if Thumbnails is the way to go.
    2 points
  4. I guess this will work: $pages->find("template=individual, sort=parent.title, sort=title"); $pages->find("template=individual, sort=parent, sort=title");
    2 points
  5. Since Pagefile is a single file field you would use delete(). You're not dealing with a WireArray then but with the page file itself. Or a $page->file = ""; $page->save(); would also do it maybe. Just wanted to add that if you (or need to) first $page->of(false) (setOutputFormatting), even a single file field will be an WireArray, so deleteAll() should then also work.
    2 points
  6. Hi wjkaluza. It's certainly possible to build the XML files in PW, but I'm wondering why you want them. You can build your pages normaly in PW and get all the raw data that you want from them, including raw files. Unless there is some hidden reason, I really don't see why you would build these XML files for one site that you will build yourself (not as an API to serve other sites). As an example: each group of files (mp3/ogg) (mp4/webm/ogv) could be a page (or repeater field) with two or three file fields under a common parent: - audio files -- audio 1 (mp3 and ogg files) -- audio 2 (mp3 and ogg files) -- audio 3 (mp3 and ogg files) - video files -- video 1 (mp4, webm and ogv files) -- video 1 (mp4, webm and ogv files) -- video 1 (mp4, webm and ogv files) You can then, reach them directly with the API or by using page fields on other pages. $myAudio = $pages->get(123) // reach the audio directly with the ID of the page $myAudio = $page->audio // or via a pageField on any other page To put a song on your page, you could do this, for example: <audio> <source src="<?php echo $myAudio->mp3->url; ?>" type='audio/mpeg; codecs="mp3"'> <source src="<?php echo $myAudio->ogg->url; ?>" type='audio/ogg; codecs="vorbis"'> Get a new browser, will you? </audio> This is just an example, there are many other ways to do this in PW. Edit: Another way would be to create a new fieldType that would allow the editor to upload one file in one of the formats, and convert it automatically to the other using something like FFmpeg https://github.com/alchemy-fr/PHP-FFmpeg
    2 points
  7. This is intentional behavior. Personally I'd prefer to have this as a config setting somewhere, though, just to cover those (admittedly very rare) cases where huge pager makes sense.
    2 points
  8. Table of contents Introducing the App and author Needs First version in PHP/MySQL without any Framework Why Processwire? App Version 1.0 Introducing the App and author Hi, my name is Luis and i´m a German based Web and Frontend Developer. I started 2010 with my own Internetbusiness and noticed at the very beginning of my business that it takes to much time to handle my accounting, invoices and clients. The main problem was that I needed for almost every task his own software solution, so the usual workflow in creating an invoice was something like open the CRM Software because the invoice software was good in creating invoices but bad in managing and searching clients, copy and paste the client into invoicing, create the invoice and handle it over to the accounting software. Not good at all... So I decided to create my own solution to fit my needs in the office management. Needs Invoicemanagement and creation Clientmanagement, very basic CRM Accounting Multi-User Simple financial stats about the Keyfacts of my business possibility to export the data for my tax consultant PHP / MySQL to work with it on intranet After pointing out my personal needs and writing down my usual workflow I started to develop the first version. First version in PHP/MySQL without any Framework In winter 2011/2012 I completed the very first version of my OMS (office management suite). The whole project was written in good old fashioned PHP from scratch. I´ve used this version till November 2012. Why Processwire? In mid 2012 I discovered Processwire and had no idea in how many ways this tool would change my life as webworker. After playing around with PW and developing the first little sites I had a little talk with my tax consultant, she said that my financial reports are pretty good and help to save money. (less time, smaller invoice from her) Why not publish the tool? Well, at this point my app was solely written for my needs, without possibilities for an Multi-User environment or for use in an companies Intranet. I finally decided to port the app to PW because of it´s flexibility, scalability and built-in user-roles. I had to dig deeper into PW at this point to see if I really could. Late 2012 I started porting the app in PW and was surprised how insanely fast developing could be. The whole database structure was ported into PW Pages, no SQL query is done by the app itself. It was possible to recreate the core functionality in about 2 weeks, implementing the Login and Multi-User functionality took another week. WebApp Version 1.0 https://youtu.be/PIgUMLZEcIU The app is now available for purchase @ www.misterui.de * also Processwire with an own eCommerce Script
    1 point
  9. I found a nasty bug when moving pages in the page tree in the admin. I have a setup where I have created a new category page and moved all the product pages on the same level into the newly created category. But then the find() I used to get all products from a parent above the category page fails. The product pages have children, which seems to be the key to reproduce this. I also have multilanguage installed but I don't think that does anything. I tried and was abel to reproduce this in my local test install with complete unreleated templates or fields. This is the on second level ... /shop/ /category1/ /newparentpage/ /product1/ (product template) /product-var1/ /product2/ (product template) /product-var1/ When I move "product1" and "product2" inside the "newparentpage" /shop/ /category1/ /newparentpage/ /product1/ /product2/ I can't use following to get all products under "category1" $pages->find("has_parent=category1, template=product"); // returns nothing $pages->get("/shop/category1/")->find("template=product"); // returns nothing $pages->find("has_parent=category1_ID, template=product, include=all"); // returns nothing This got me, as I never experiences something like this. The page tree works and also finding the product with $pages->find("template=product"); // will find all still Also this doesn't happen if the moved product pages have no children. So there's something wrong with the page_parents table I guess, but haven't investigated futher as I'm in a hurry to finish the website. And always then such things happens.
    1 point
  10. Overall very sleek. The Latest News Section looks a bit scattered though, is this intentional? Shot: http://d.pr/i/WTy1 Also, the "read more" buttons are positioned inconsistently. Some have space around them, some don't.
    1 point
  11. Det kan man säga, på nåt sätt...jag bodde i Stockholm ett tag sen... translation [English forum, ahem)....I lived in Stockholm a while back....
    1 point
  12. Am I the only one who finds the naming in this module rather confusing? In ModulesManager/on PW Site: - it is called Thumbnails Module detail page: - after installing it, the title in Admin > Module says Images with cropping - the class is called ProcessCropImage - the description says Crop thumbnails in Modules list its components are listed as: - FieldType: Images with cropping - Inputfield: Images with cropping - Process: Image cropping tool So we have about 5 different names: Image cropping tool CropImage (FieldtypeCropImage/InputfieldCropImage/ProcessCropImage) Thumbnails Images with cropping Crop thumbnails Is there a reason behind this? I feel this should be more organized.
    1 point
  13. I understand and know this, but why do you need to get the translation when it is just already there. It will output in the language the user views the page ($user->language) This works just fine in the language the user view the page. echo $fields->get("body")->label; Edit: ah, hm it does not? Ok it doesn't get translated as with page fields. Since it's meant to be used for backend context there's no language value for fields settings. So you either use a $lang variable like this: $lang = $user->language->isDefault() ? "" : $user->language->id; // Default needs no id echo $fields->get("body")->get("label$lang"); Or a little hook to add method to the $fields template API var. // from template or a autoload module $fields->addHook("getLabel", null, "getLabelLang"); function getLabelLang($event){ $field = $event->arguments(0); $lang = wire("user")->language->isDefault() ? "" : wire("user")->language->id; $event->return = wire("fields")->get($field)->get("label$lang"); } // now we use it and it will recognize user lang echo $fields->getLabel("body");
    1 point
  14. Ok it Works thanks. I have Corrected the the Previous code for others who want to edit page with file field.
    1 point
  15. $page->images->removeAll(); $page->save(); I used this on a single image field, and it didn't work at all. My guess is that it happens because in that case the field returns a single image and not an array, and removeAll() fails. After lots of head scratching (second time in this thread), and searching on the forums, I found this thread and managed to make it work based on my own advice fours posts above. How ironic is that, hein? $page->of(false); $page->image = $page->image->makeNew(); // <- added this $page->save(); $u = new WireUpload('pic'); $u->setMaxFiles(1); $u->setOverwrite(false); $u->setDestinationPath($page->image->path()); $u->setValidExtensions(array('jpg', 'jpeg', 'gif', 'png')); foreach($u->execute() as $filename) $page->image = $filename; $page->save();
    1 point
  16. $current_s = $pages->get("template=student, student_feedback=$page"); <-- here student_feedback it is a page object $new_s->set("student_feedback", $student); <-- and here it is a string Maybe this matters....
    1 point
  17. Wow, that's a very striking design! I like it. Are you looking for feedback on English content translations at this stage?
    1 point
  18. Hej NoDice, Gratulerar! Nice one! The difference between the old and the new is really amazing!
    1 point
  19. Hello folks! I've been playing with ProcessWire a lot recently, and have just launched site number 3 - Bishop Auckland Table Tennis Club. Some of my family members are associated with or are members of the club, so this was a bit of a favour for them. I haven't used many "additional" modules - just CropImage and MapMarker.
    1 point
  20. Interesting as I was just having the same thoughts myself. As an idea for a field, would it be possible to have a two-way page reference field (as opposed to doing all the work in the API)?
    1 point
  21. Dear Martijn and Diogo, Yes, I entirely agree. Peter
    1 point
  22. OK if you really need the same iterators from the accordion, you might also iterate on your area page as well to get the same index as in the accordion: $i = 0; $iteratorInList = -1; // set the default -1 if not in list // "/areas/" being the url to the parent of your areas foreach ($pages->get("/areas/")->children as $area) { // find out if current page in loop is the same as current $page if($area == $page) { $iteratorInList = $i; break; } $i++; } echo $iteratorInList; Seems a bit cumbersome, but I don't know of a method like $somePage->index($list) ... similar to jQuery.
    1 point
  23. OK, what programme did you use to make that spoof video?! After effects or something? My goodness! Avoine/Antti, thank you very much!!! As for you Mr Cramer, I don't know what to tell you. Seriously, mate, I can't pick an adjective apt enough. Let's just say that you Sir are one of the best things that has happened to the open source community. Hats off! cheers /k
    1 point
  24. Although is true that PW keeps getting better. I think Martijn's sentence is more accurate
    1 point
  25. I think it's best though just to keep it simple and use the template file home.php as your homepage template, and keep that on your root page.
    1 point
  26. The PagefilesManager::url() method is now hookable on dev. For high volume functions like this, I go a little further than just prepending 3 underscores and instead implement both a hooked and non-hooked version, just to reduce any potential overhead. Meaning, PW's hook system doesn't get called upon unless/until the function is hooked. Not sure it really matters, but it's just a minor optimization.
    1 point
  27. Welcome! That's a really good & interesting question. One thing I'd suggest is to read this article and Ryan's comments below it: http://gadgetopia.com/post/7242 He talks about "bucket" CMS software, which is really part of what you're talking about, if I'm reading you right. So read what he says about how he prefers to arrange data and see what you think. It could be that you end up writing a really neat system on top of ProcessWire, and I've actually spoken about other CMS developers on that subject, but I think it's a good idea to understand ProcessWire's aims & successes first. I'll hold off on admin tab advice because it's been a while since I've done that and my knowledge may be outdated.
    1 point
  28. @WillyC I did not know about html_entity_decode(), and in fact is solves my problem for now: <p> <?php $t = "We love to <span class='highlight'>highlight</span> so that it <span class='highlight'> stands out</span>."; $t = __($t); echo html_entity_decode($t, ENT_QUOTES, 'UTF-8'); ?></p> main.css .highlight { font-weight: 600; color: red; } The string will be output with the words 'highlight' and 'stands out' shown in bold red. Thanks a lot for this tip! At everyone: Soma mentioned that when using __("text"), everytime I change the text, the translations needed to be updated, too. I haven't started doing any translations, but I know that I often tweak text here and there, even if I intially thought it was 'final'. I certainly don't want the translaters have to redo their translation every time I do such a tweak. Is there a way to deal with edits to the main language text without effecting its translations? Cheers, Stefan
    1 point
  29. echo html_entity_decode(__('you.text w <blink>htmls</blink>'));
    1 point
  30. Ryan, I'm really impressed, amazed at your level of productivity, responsiveness (and generosity)!
    1 point
  31. Here you go: http://modules.processwire.com/modules/fieldtype-text-unique/
    1 point
  32. Hey rob. What diogo said. You can create a admin page using the "admin" template. It would be placed under the locked "admin" page tree. The admin template has a field "Process". After creating the page you'll see it under tab "content". Now you have to create a process module to serve functionality for the newly created admin page. Once installed it can be selected from the field "Process". I did a quick example that shows such a module, and even how to use the ProcessPageList module of processwire to create a tree. The id set will be the parent page (your Architects) for example. ProcessPageListCustom.module create the module under /site/modules/ and install it. <?php class ProcessPageListCustom extends Process{ public static function getModuleInfo() { return array( 'title' => 'Custom Page List', 'summary' => 'List pages in a hierarchal tree structure', 'version' => 100, 'permission' => 'page-edit' ); } public function execute(){ $pl = $this->modules->get("ProcessPageList"); $pl->set('id',1001); // or any other parent page return $pl->execute(); } } You can, of course, use any code to generate a list of pages.
    1 point
×
×
  • Create New...