Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/15/2016 in all areas

  1. In addition to our regular core updates, we also have a new ProFields module to introduce to you this week. It’s something a little different that we’ve found pretty useful and think some of you will too. It's also available for download now in the ProFields board. This blog post covers it in detail: https://processwire.com/blog/posts/text-blocks/
    6 points
  2. Great to see so many contributors. Transition to more community driven development seems to be going strong!
    5 points
  3. Hej! Could you post your current code so we can see what's wrong? A couple of links that might be useful: https://www.smashingmagazine.com/2016/07/the-aesthetic-of-non-opinionated-content-management-a-beginners-guide-to-processwire/#getting-the-current-page-with-the-page-variable http://processwire.com/api/templates/ http://processwire.com/api/templates/ Generally it should / could be something like this: This could be the template file for a product - but with the actual names of your fields and so on ... <html> <head></head> <body> <?php foreach($page->children() as $product): ?> <div> <img src="<?= $product->img->url; ?>"> <h3><?= $product->title; ?></h3> <p><?= $product->inhalt1; ?></p> </div> <?php endforeach; ?> </body> </html> I used shorthand <?= ?> tags and the <?php foreach(): ?> <?php endforeach; ?> alternative control structure thing here which I really like (http://php.net/manual/en/control-structures.alternative-syntax.php) But it is up to you how to implement it. Hope that helps lg Steffen
    4 points
  4. @kuba2 You are welcome : ) Actually I learned a lot PHP and Object Oriented Programming just through Processwire - you should really look into the processwire documentation http://processwire.com/docs/ - especially about template files and selectors in the beginning - later you will really enjoy http://processwire.com/api/ref/ the API reference where the most important things are documented. @SamC well, but your reply is way more sophisticated!
    3 points
  5. You can add pages via the "new" action on the pages in the page tree. The "add new" page/button are only shortcuts for pages to be created in predefined locations.
    3 points
  6. Just updated the module to v080 that contains the "Show pagelist actions on full row hover" tweak (under AdminTweaks). I've also renamed the "Are you sure" confirmation message for the Delete button to "Delete page permanently?" as it tells more about what's gonna happen if you continue.
    2 points
  7. It's always the legacy code!
    2 points
  8. Can also be the difference of mac and windows or version difference. Microsoft is really not great at keeping things in sync :D.
    2 points
  9. @horst - I might be oversimplifying here, or maybe not I think I have a solution - if you replace: public function _getInputFieldInstance(HookEvent $event) { $field = null; // where we'll keep the field we're looking for $image = $event->object; $page = $image->page; $action = $event->arguments[0]; // find all fields of type FieldtypeImage that are part of the page we're using // or regular image fields with InputfieldImage inputfield assigned $imageFields = array(); foreach($page->fields as $f) { if ($f->type instanceof FieldtypeImage || ($f->inputfieldClass && $f->inputfieldClass == 'InputfieldImage')) { $imageFields[] = $f; } } // loop through to find the one we're looking for foreach($imageFields as $imageField) { // good to get unformatted in case it's a single image field, // because it'll still be an array rather than 1 image $pagefiles = $page->getUnformatted($imageField->name); // TODO: name to lowercase ??? // if the image's pagefiles property matches the one with the // field we're looking at, we have a match. save in $field if ($image->pagefiles === $pagefiles) { $field = $imageField->getInputfield($page); break; } } if ($field) { //$event->return = $out; return $field; } return null; } with this: public function _getInputFieldInstance(HookEvent $event) { if ($event->object->pagefiles->field) { //$event->return = $out; return $event->object->pagefiles->field; } return null; } then it always returns the correct field for the pagefile and it works with Custom Upload Names. Is there a situation you know of where my version won't work?
    2 points
  10. As a side note so Windows users are not put off reading this, it's a breeze to do in XAMPP too. I use MAMP on the laptop and XAMPP on the desktop (windows or linux) and I don't find one easier than the other. The only real difference I've ever seen is that in XAMPP you have to manually set the document root in http.conf and you can't change the ports as easily. I think the moral of the story is just don't use Bitnami
    2 points
  11. Hi @kuba2 and welcome. I can't tell from the screenshots what templates you are using. However, this is how I do it for my 'news-index.inc' template. This pulls in all children of that page and displays them like you are asking (except mine are news entries, not tires!). // news-index.inc <?php $entries = $page->children(); $created_by = $page->createdUser->displayName; ?> <?php foreach ($page->children() as $entry): ?> <?php $publish_date = date('d/m/y', $entry->created); ?> <div class='news-wrapper'> <div class='news-column-left'> <h1 class='news-title'><a href="<?php echo $entry->url ?>"><?php echo $entry->title; ?></a></h1> <?php echo $entry->summary; ?> </div> <div class='news-column-right'> <p class='entry-info'><span class='fa fa-calendar' aria-hidden='true'></span><?php echo $publish_date; ?></p> <p class='entry-info'><span class='fa fa-pencil-square-o' aria-hidden='true'></span><?php echo $created_by; ?></p> </div> </div> <?php endforeach; ?> So I guess you could do something similar like: // keramik.php <?php foreach ($page->children() as $entry): ?> <div class='single-product-wrapper'> <h1 class='tire-name'><a href="<?php echo $entry->url ?>"><?php echo $entry->title; ?></a></h1> <img src="<?php echo $entry->img ?>" /> <p><?php echo $entry->inhalt1; ?></p> </div> <?php endforeach; ?> $page above is the current page you're on. $page->children returns an array with all the child page iDs (say '1|5|12|22|22'). So each child page is looped through (foreach) and printed to the webpage one at a time. $entry is the ID of the array item each loop through. If that makes sense. I am just starting working with images so I don't know what will happen with the img in the code above, I think it may just print at whatever size you uploaded it at. However, this should get you started. Regards the printing three in a row, this is css. I use http://neat.bourbon.io/ for layouts, so in my case (for my first example), the scss is: // styles.scss /* News index page */ .news-wrapper { @include row(); padding-bottom: 1em; border-top: 5px solid $light-grey; } .news-column-left { @include pad(0 2em); @include media($tablet) { @include span-columns(9 of 12); } } .news-column-right { background: #FFE6A7; @include media($tablet) { @include span-columns(3 of 12); @include pad(0.5em); } } // OUTPUTS // styles.css /* News index page */ .news-wrapper { display: block; padding-bottom: 1em; border-top: 5px solid #e7e7e7; } .news-wrapper::after { clear: both; content: ""; display: table; } .news-column-left { padding: 0 2em; } @media screen and (min-width: 600px) { .news-column-left { float: left; display: block; margin-right: 0%; width: 75%; } .news-column-left:last-child { margin-right: 0; } } .news-column-right { background: #FFE6A7; } @media screen and (min-width: 600px) { .news-column-right { float: left; display: block; margin-right: 0%; width: 25%; padding: 0.5em; } .news-column-right:last-child { margin-right: 0; } } Hope this helps. EDIT: @blynx beat me to it :-p
    2 points
  12. Sorry - forgot to mention that - I stole that code from the Reno theme. Ryan didn't like that approach, but I still think it is much nicer. Maybe you could add a new Inputfield/InputfieldClass column to the table, so it not only shows CkEditor, but also things like "CroppableImage3" or the input field type used by a Page field, e.g. AsmSelect The Fields List & Values section in the PW Info panel of Tracy has this column - might save you some time to look there first?
    2 points
  13. I've checked it and it seems to be the case only in the Default admin theme, perhaps that's why I haven't spotted this. I like the idea - question is that is there a way to hook that part somehow. Another related tweak I have in mind is adding "CKEditor" to the Setup->Fields page. Only "Textarea" is displayed there, it woud be better having "Textarea (CKEditor)" when it's applicable.
    2 points
  14. Thanks @Robin S - that change was incorporated into the core already, so glad it works everywhere. Thanks again for figuring out the change that was needed and for your thorough testing!
    2 points
  15. Hi @adrian - with the change, the editor paths are working properly for me in all of these places.
    2 points
  16. @tpr That seems to work very nicely. Thank you!
    2 points
  17. v079 is uploaded with the abovementioned Delete feature so you can try it. Tip: uncomment line 661 to disable physical deletion (for testing purposes).
    2 points
  18. Hey everyone, Max from Snipcart here! We just published a full tutorial showing how to use ProcessWire + Snipcart (our dev-first HTML/JS shopping cart platform) to enable e-commerce. It was pretty much my first time playing around with the Apache/MySQL/PHP stack, so I'd love to get some feedback on the demo code. Oh, and also, if you feel like the Snipcart integration could have been done in a different/better way with ProcessWire, let me know! > Blog post tutorial > (Very) simple live demo > GitHub repo Cheers folks.
    1 point
  19. I'm trying to automatically generate the title and name fields when a new item is added to the PageTable. I've used some code renobird shared with me and Pete's code from this post but it won't quite work for what I need to do. So for example I have a page /foo/bar/title-of-the-download, this contains a PageTable field that lists downloads. The pages created by this field are stored in /downloads/. I want to use the format: 150818-name-01 (date-name-increment) where name is taken from the page which contains the PageTable. So using the example above, I could add several new items to the PageTable with the names automatically created as: 150818-title-of-the-download-1 150818-title-of-the-download-2 150818-title-of-the-download-3 I'm able to get the name and title of the page I'm storing the PageTable pages under (in this case downloads), but not the page which contains the PageTable field. Can anyone advise on how I might do this? Code so far below: <?php class PageRename extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'PageRename', 'summary' => 'Page Rename Module', 'href' => '', 'version' => 001, 'autoload' => true, 'singular' => true, ); } public function ready() { $this->pages->addHookBefore('ProcessPageAdd::execute', $this, 'hookFormatName'); } public function hookFormatName(HookEvent $event) { //if adding child page to /downloads/ (1456) if ($this->input->get->parent_id == 1456) { //how to get origin page? $originPage = ; //gets number of child pages under /downloads/ $increment = $this->pages->get($this->input->get->parent_id)->count()+1; //actual increment needed $increment = $originPage->children()->count()+1; //create new page $page = new Page(); $page->parent = $this->input->get->parent_id; $page->template = 'download'; $page->name = date('ymd').'-'.$originPage->name.'-'.$increment; $page->title = date('ymd').'-'.$originPage->title.'-'.$increment; $page->addStatus(Page::statusUnpublished); $page->save(); $this->session->redirect("../edit/?id=$page"); } } }
    1 point
  20. hi kuba2 and welcome hard to say what's wrong... just wanted to give you a tip: install tracy debugger and use the console! it's awesome and will help you to understand everything much better than putting some code into your template files and reloading the browser over and over again. you could do something like this in your case: $p = $pages->get( # your page id # ); d($p->product-img); d($p->product-img->url); if you set your product image to "automatic" it will be an array when you uploaded more than 1 image and a single item when you uploaded only 1 image. in tracy you could easily inspect such things (that's what adrian already said above)
    1 point
  21. Thanks! For me this should be OK but will report if something goes wrong.
    1 point
  22. I am using Dev 3.0.33. It works after adding namespace to wire(). Thanks a lot!
    1 point
  23. @horst - you can also simply use: $event->object->field There is no need for $event->object->pagefiles->field You might even want to get rid of that _getInputFieldInstance function completely - doesn't really seem necessary anymore?
    1 point
  24. Exactly! No judgement intended for you not using having used it Yes, that is where it was failing and returning null.
    1 point
  25. @horst Step by step what i made : 1- removed module folder completely and copied downloaded module (from github) files to module folder 2- i replaced @adrian codes 3- Admin > Modules > Refresh 5- uploaded images to page 4- when i over mouse to my crop variation button there is no preview image for cropped version 6- after save page i can see cropped image on preview, when i hover crop variation button
    1 point
  26. @adrian @horst I test this replacement on my side and tried to upload images by using CroppableImage3 input and there is no error, but i don't know is there a side effect ?
    1 point
  27. Ryan added this back in Oct 2013 after the old thumbnails module was released - see his note here:
    1 point
  28. @adrian: this is taken over from the old legacy thumbnail module. But, if I remember right, it is also present in core file and image modules. I need to test this.
    1 point
  29. I unchecked checkbox and saved module settings, tested to open crop modal there is no error. Its look like need to go FieldtypeCroppableImage3 settings and click to save button before use module.
    1 point
  30. An email's source code has nothing to do with the message being html or not html. Html might be used in the message, but that's about it. In outlook (at least for mac) I can do right click on an email and choose "open source" ("Quelle anzeigen" in german) to open the raw email in a texteditor.
    1 point
  31. I wasn't asking about how you send it, but what you actually receive and in which email program you're trying read it. If you could provide the source code of one of those emails we can determine if the sent email is even delivered in the correct state.
    1 point
  32. The fact that the content type header and the transfer encoding is visible in the actual email body would suggest, that the email isn't parsed correctly in the first place. Without parsing the encoding type it's expected that decoding doesn't happen correctly. Any chance you could provide the emails source code and what email app you're using there?
    1 point
  33. @Rudy I did take a look at your take at it and the subfolder option didn't seem to work. I've now enhanced it to be configurable to different optional subfolders to look for a ProcessWire installation. I've also taken the trailingSlash part out, because ProcessWire does not enforce trailing slashes, but it can do it on it's own if you want it to. https://gist.github.com/LostKobrakai/5328d6f64e9dc06a8776d0231c6628c6
    1 point
  34. Thanks. I knew very little about PHP before a few months ago. I just studied the processwire API and it's very well written. I'm more a designer so my CSS skills outweigh any PHP ones this is what I like about processwire, I have 100% control over HTML/CSS and the built in methods make it quite simple to grab stuff out the database.
    1 point
  35. http://neat.bourbon.io/examples/ Automatic rows is your friend here! Works very well once you're all set up.
    1 point
  36. @Rudy thanks for taking the time to check it out! Much appreciated. Always fun to get to learn about new tools and discover their ecosystem/reality. You can actually handle recurring payments & subscription with Snipcart (docs here), but the feature is still in beta. Basically, we only support Stripe, and don't support shipping/discounts yet. We'll try to work on improving the feature by the end of the year most likely! @Christophe these look helpful! Taking a deeper look soon. Cheers!
    1 point
  37. Small request I always preferred the hover effect for showing page list action buttons to be triggered on the entire row, rather than just the title of the page - this makes it much easier as there is much less mouse horizontal movement - left to trigger the actions and then back right to click the required button. I actually find it quite a significant timesaver. .content .PageList .PageListItem:hover .PageListActions{display:inline;-webkit-transition-delay:.25s;transition-delay:.25s} .content .PageList .PageListItemOpen .PageListActions{display:none !important;} .content .PageList .PageListItemOpen:hover .PageListActions{display:inline !important;-webkit-transition-delay:.25s;transition-delay:.25s}
    1 point
  38. Another possibility for CSV importing by editors is the Batch Child Editor module: http://modules.processwire.com/modules/batch-child-editor/
    1 point
  39. @maxlab You can also use template engines with ProcessWire if you prefer. For example: http://modules.processwire.com/search/?q=twig http://modules.processwire.com/modules/template-latte-replace/
    1 point
  40. Wow, that is very weird, but it turns out I can reproduce your problem when I have Tracy disabled on the backend (or completely uninstalled). I don't really know what is going on though - almost seems like Tracy is suppressing the error, which is the opposite of what usually happens Looking at that code in CroppableImage: $attr['data-image'] = $pagefile->getCrop($suffix)->url; This fixes it for me - can you try at your end? if($pagefile->getCrop($suffix)) $attr['data-image'] = $pagefile->getCrop($suffix)->url; The Pagefile exists, but during upload, the crop itself doesn't exist yet, so I think that makes sense, but I am sure it's just that I don't fully understand how Croppable Image works @horst - any thoughts?
    1 point
  41. @maxlab Thanks for posting the tutorial! I am not familiar with Snipcart's offering. Can it be used for memberships with recurring charges? Thanks Rudy
    1 point
  42. Hi everyone, I have just updated this module to support insertion of Hanna codes, and renamed it to DynamicDescriptionNotes. It passes the $page (for the current page being edited) and $field (for the $field where the Description or Notes text is referencing the Hanna code, so you can use $page and $hanna->field in your Hanna code to refer to these. This opens up lots of possibilities for dynamic content. Please let me know if you have any problems or suggestions. A big thank to @Robin S for the awesome idea! PS, It's now available from the modules directory: http://modules.processwire.com/modules/dynamic-description-notes/
    1 point
  43. If you use a string for your module version parameter, you can have more than the three fields. For example... ...and the code... Not sure if this plays well with version checking - but it is possible.
    1 point
  44. Wanted to mention that there's a new dev version https://github.com/somatonic/Multisite/tree/dev2 that we are testing and using right now. It was tested and works with multilanguage and PW3 various features.
    1 point
  45. The technique i described above would not be blocked unless the adblockers decided specifically to block your server. Otherwise this would operate just like any other content on the page that is generated or manipulated by JS.
    1 point
  46. http://modules.processwire.com/search/?q=rss
    1 point
  47. Hi There are about 10 projects I know that use Padloper (although license sales are 100+). I haven't asked promises to showcase those, but I will soon focus on that (asking showcases and putting them up to padloper.pw).
    1 point
  48. Hi Kai, I don't see any requirements here that is not manageable by ProcessWire, the only limit will be knowledge of PHP. 1. You could implement OAuth easily with 3rd party libraries or integrate each provider's API into ProcessWire. 2. You can manage users by using API and/or by playing with roles, permissions into ProcessWire backend. 3. Yes - very easy, for example, you can just use "pages" and page filedtype for relations. 4. Yes - by playing with urlSegments. 5. Yes - you can implement this feature easily + there are one or two modules which might help you to achieve that. 6. Yes - you have to implement it. 7. Yes - by using the API . 1. Yes 2. Yes 1. Yes (hooks come to my mind). 2. No problem at all. 3. From what I've read on the forum, I want to say : superfast. (ProCache)
    1 point
  49. All of the markup and classes can be specified from the $options to MarkupPagerNav's render() method. Originally I had the Blog profile using Zurb Foundation and so had it outputting in Foundation-specific markup/classes for pagination. Doing the same thing with Bootstrap is certainly possible and should be relatively simple. Take a look in /site/templates/blog.inc and find the renderPosts() function. At the bottom of that function is this line: if($posts->getLimit() < $posts->getTotal()) $out .= $posts->renderPager(); You'd want to change it to specify an $options array to the renderPager() function, like this: $options = array( 'listMarkup' => "<ul class='MarkupPagerNav'>{out}</ul>", 'itemMarkup' => "<li class='{class}'>{out}</li>", 'linkMarkup' => "<a href='{url}'><span>{out}</span></a>", 'currentItemClass' => 'MarkupPagerNavOn' ); if($posts->getLimit() < $posts->getTotal()) $out .= $posts->renderPager($options); Change the markup and class names as you see fit. There are many other things you can specify in this options array (I've just included a few examples above). For a full list of options you can specify, see the $options array present near the top of this file: /wire/modules/Markup/MarkupPagerNav/MarkupPagerNav.module
    1 point
×
×
  • Create New...