Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/16/2015 in all areas

  1. Hi guys, after a long pause on this project, I relaunched few days ago the new version of lymeta.com a website offering free high resolution photos, royalty free under creative commons zero license. Anyone can submit a photo and participate. I made a very simple design, flat and responsive, hope you like it. Cheers.
    8 points
  2. This thoughts have come up every now and then here in the forums. But after some time of getting used to this most people do like the fact that files are just where they are needed: stored in the page which it belongs to. It's actually more powerful and structured than having just a single bowl of files. There are also no plans to change the way images are stored. To make this more concrete: An RTE field cannot store any images. Most cms's hide that fact, by including their media managers directly into it, but this decouples the images completely from the page structure. If you're worried about your clients being confused by this, you should be able to hide the images field for them, as the latest dev version added the ability to upload images directly from the RTE images modal. The flexibility comes if you think about multiple imagefields. E.g. one for the big heroimage (single), one for the RTE images (mutiple) and maybe one for generating a optional gallery (mutiple). Each field for it's own concern and seperated by the page they are used on. If you compare that to a media manager where all those files are bunched together, I would rather take the processwire approach. Another example: Think of a list of pages representing different clients of the website's owner. All of them have a logo and semantically the logo belongs to the client, that's why it's on a page with all those other informations like names, address and stuff. If you would link the image from a media center you would need to maintain the images seperate to the clients: Go to page, change the name; go to media manager, change the logo (if it's that easily replaceable). In ProcessWire you can change both in one place and other pages using the image will update as they most likely will be field dependent (if used via the api, they are for sure) and not dependent on a specific imagefile (don't know if the RTE's do update automatically).
    5 points
  3. http://m.bbc.co.uk/news/technology-31907768 That is all.
    4 points
  4. I just had to do a site-wide replacement on a word this morning, so this may be of use to others in a similar situation (in my case a product name had to have a capital letter in the middle instead of lowercase). Stick at the top of your homepage template and be careful with this - always take a database backup before playing with anything that's potentially destructive. function searchReplace($page) { foreach ($page->children('include=all') as $child) { // Skip admin page if ($child->id != 2) { foreach ($child->template->fields as $field) { $child->{$field} = str_replace('search_word', 'replacement_word', $child->{$field}); } foreach ($child->children as $grandchild) { searchReplace($grandchild); } $child->setOutputFormatting(false); $child->save(); } } } searchReplace($pages->get('/'); exit; It essentially iterates every page under the homepage, goes through every field and replaces the search term with the replacement. It is case sensitive too. Comment out the code when you are done and see the changes live on your site. This might be a nice one for a quick module that only targets things like text, textarea and image/file descriptions as that's pretty much the only fieldtypes that are relevant I think. Settings could be added to skip certain pages (and therefore their children) entirely, but I don't have time for building a module at the moment.
    3 points
  5. Hi mr-fan You need to add enctype="multipart/form-data" to your form tag Is "user_img" the name of your file input? If so, then I guess $input->post->user_img would return null, since this key is inside PHP's global $_FILES variable (not in $_POST) Edit: LostKobrakai wins Do you ever sleep? Cheers
    3 points
  6. Your problem is actually in the html, not in the php code. Forms are send in plaintext by default, so to upload files you need to add this to the form tag. <form … method="post" enctype="multipart/form-data">…</form>
    3 points
  7. Hey Pete - nice one! I know your code is meant as a quick snippet to get the job done, so no offense intended, but the concerns I have with this is: On a site with a LOT of pages, that could be very slow. I don't like the fact that it re-saves every page, regardless of whether there is a change or not, which will affect the modified date and modified user. I have actually already made a start on a feature rich search and replace module which I will get around to finishing up sometime soon. It provides the ability for searching and then showing the search term in context for each match. You can then choose which matches get replaced, or replace all. Stay tuned!
    3 points
  8. This fills in the field name automatically and the return shouldn't be necessary as the function is at it's end and does not return anything. public function formatValue(Page $page, Field $field, &$str) { $str = str_replace("<p>", "<p class='{$field->name}'>", $str); }
    3 points
  9. I missed the false if condition. And yeah, will do that now
    2 points
  10. In a first glance it looks interesting, but after the second I would say it isn't worth. You just would mimik something what is already available, only on another layer. For me it would be better to invest the needed energy into something like using linux / unix system calls via ssh. There is already everything one need for those stuff. And if one do not have access to shell on cheap shared hostings, I believe one also will not get something useful to work via a PHP-PW extra layer. EDIT: and for all things related to PW, I use bootstrap scripts from the commandline.
    2 points
  11. pushed Version 1.0.6 on github dev-branch. Works now with the API Adrian recommended: for single values //selected value (int) $page->myfield->value // selected label $page->myfield->label // associative array with column => value of depending datatable row $page->myfield->row muliple values can be called with WireArray API examples: $page->myfield->last()->row['land'] $page->myfield->first()->row['id'] $page->myfield->eq(3)->value To prevent conflicts with datatable column names like 'data' I decided to access the values via $page->myfield->row['data'] instead of $page->myfield->data. 'data' is an reserved property of the WireData object. Please check out and comment. Thanks
    2 points
  12. You can delete any module manually - just use something like PHPMyAdmin and browse/search the "modules" database table and remove the row for the module. Then remove the module folder from the server and you should be good. In the case of this module, there are also some additional db tables to remove, prefixed with "version_control", but be careful to remove the ones for the version of version control that you want to remove. Also, note that Version Control supersedes Version Control for Textfields. The latter is only still around for older versions of PW.
    2 points
  13. It's actually quite straightforward. In your field settings, under Input, add a reference to a JS Styles Set: mystyles:/site/modules/InputfieldCKEditor/mystyles.js If you're using the blank profile, that file won't exist. If so, you'll need to copy the one from wire/modules/Inputfield/InputfieldCKEditor. All that's left is to add the style you want for your paragraphs. Your file should look like this: CKEDITOR.stylesSet.add( 'mystyles', [ { name: 'Inline Code', element: 'code' }, { name: 'Inline Quotation', element: 'q' }, { name: 'Left Aligned Photo', element: 'img', attributes: { 'class': 'align_left' } }, { name: 'Right Aligned Photo', element: 'img', attributes: { 'class': 'align_right' } }, { name: 'Centered Photo', element: 'img', attributes: { 'class': 'align_center' } }, { name: 'Small', element: 'small' }, { name: 'Deleted Text', element: 'del' }, { name: 'Inserted Text', element: 'ins' }, { name: 'Cited Work', element: 'cite' } // plus your style { name: 'Summary', element: 'p', attributes: {'class': 'summary'} } ] ); Then, you can select your whole paragraph and choose the Summary style for it. Edit: Might also be a nice idea to add a CSS file to apply the style in the editor too. Edit: Hold up, I see you're wanting this to happen automatically for the name of the field... Didn't pick that up, sorry. That said, this is cool for a targeting specific paragraphs.
    2 points
  14. Exactly that happens if a client goes to your central media manager and deletes an image. It's a natural flaw of RTE's that they store filenames which break if one deletes the file. A RTE is not an image manager. It's a texteditor. That's why you always need some extra place where images are stored. In either way: You need to communicate to your editors where images are stored, so they can manage them (and not only upload till extinction). If these images are in the page, they are editing, or in some central hub shouldn't matter to them to much. That's where I personally think it's easier to tell them the images are stored right next to the RTE they want to use it in, instead of some other place, which is quite unrelated to the actual page. It's really the same problem, only the images are displayed in different places. You can read Ryan view about that and how ProcessWire handles deleted and updated images here: /blog/posts/quality-assurance-for-images-in-rich-text-fields/
    1 point
  15. The same with Domainfactory (http://df.eu)
    1 point
  16. i scanned it (our company subscribed the mag)... if anyone wants to read it, let me know. The timing is right too, since i'm preparing a tech-hour to present in-house
    1 point
  17. Your post always read like this: You should not make line breaks.
    1 point
  18. What I could imagine is using processwire as dashboard for those information, but the tools to analyse these things just wouldn't benefit from processwire itself.
    1 point
  19. Thanks, this can come in handy sometimes. Perhaps modifying hte searchReplace function to accept the search-replace words would be beneficial, like this: searchReplace($pages->get('/'), 'search_word', 'replacement_word'); Btw, your orignial searchReplace is missing one extra closing brackets I guess: searchReplace($pages->get('/'));
    1 point
  20. I've already posted this in the Hanna Code support forum, but I'll add it here, too. I'd really like to see description, because together with the "only be able to see the list of hanna codes" permission it would make for a good and easy to set up way for clients to look-up the available hanna codes. Without the description it may be still hard to recognize the codes for less experienced users.
    1 point
  21. Hallo Horst, I did a small Screencast to show you my steps to reproduce this error: http://cl.ly/3p0b411B441L I hope it's useful. I also just updated to the latest dev-version, but the error still remains. Thanks!
    1 point
  22. You could use a custom Textformatter module for this. I quickly hacked together this one, nothing perfect as it replaces all occurrences of opening p tags, but you could spice it up using regex etc. I gave it a quick test – it does it's job. This should get you started: <?php class TextformatterAutoClass extends Textformatter{ public static function getModuleInfo() { return array( 'title' => 'AutoClass Textformatter', 'version' => 100, 'summary' => "Adds a class to the automatic p wraptag of CKEditor" , 'author' => 'Johannes Dachsel' ); } public function formatValue(Page $page, Field $field, &$str) { $str = str_replace("<p>", "<p class='summary'>", $str); return; } }
    1 point
  23. I used Slick on several projects and it worked really well. There's also http://www.idangero.us/swiper/ which is similar to slick but with more options regarding the transitions and layout.
    1 point
  24. I think you got it teppo but just to be clear, i did mean security questions ass an addition to sending a reset token via e-mail or even SMS. I also agree that resetting via e-mail alone is safe enough for most stuff that gets built. - edited the ass
    1 point
  25. Using form when not needed feels so 1999 . The whole thing is quite weird when you know InputfieldForm extends wrapper. I did make a note on GitHub, maybe Ryan or Soma does know how. And about security, I follow kongondo's lead. No problem, definitely not in this case. Thanks guys for the followup.
    1 point
  26. Naah, I don't see how it could be...
    1 point
  27. In your foreach gallery loop you are creating many lightboxes with the same ID: <a href="#gallery" class="lightbox" id="image_gallery"> ID's should be unique, only one per page is allowed with the same name. Try something like // before the loop: <?php $counter = 1; ?> // in the loop: <?php $currentID = "image_gallery_" . $counter; ?> <a href="#<?php echo $currentID; ?>"> <a href="#gallery" class="lightbox" id="<?php echo $currentID; ?>"> <?php $counter++; ?> Then you will have IDs like "image_gallery_1", "image_gallery_2", etc.
    1 point
  28. There must be recent changes I guess, but this one works: oops this one is for delete tab <?php class AdminHelperHooks extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'My Admin Helper Hooks', 'version' => 1, 'singular' => true, 'autoload' => true ); } public function init() { // add hook to the page edit module and the method that creates the wanted fieldset $this->addHookAfter('ProcessPageEdit::buildFormDelete', $this, "removeDelete"); } function removeDelete(HookEvent $event){ // $event->return being the inputfield wrapper $wrapper = $event->return; // set the inputfield wrapper to hidden $wrapper->collapsed = Inputfield::collapsedHidden; // Get the active Object (ProcessPageEdit) $process = $event->object; // Remove the Settings tab with the ID $process->removeTab('ProcessPageEditDelete'); // we're done } } For settings tab <?php class AdminHelperHooks extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'My Admin Helper Hooks', 'version' => 1, 'singular' => true, 'autoload' => true ); } public function init() { // add hook to the page edit module and the method that creates the wanted fieldset $this->addHookAfter('ProcessPageEdit::buildFormSettings', $this, "removeSettings"); } function removeSettings(HookEvent $event){ // $event->return being the inputfield wrapper $wrapper = $event->return; // set the inputfield wrapper to hidden $wrapper->collapsed = Inputfield::collapsedHidden; // Get the active Object (ProcessPageEdit) $process = $event->object; // Remove the Settings tab with the ID $process->removeTab('ProcessPageEditSettings'); // we're done } }
    1 point
  29. Hi lindquist, That's a good solution you've come up with. If you want to provide an API variable for your object, here's an example, pretty easy like everything in ProcessWire: // This must be inside an autoload module public function ready() { $this->wire('calendar', new Calendar()); } // Or, if you're Calendar module is autoloaded, make the same instance available as API variable public function ready() { $this->wire('calendar', $this); }
    1 point
  30. A bit OT, but if you can plan the languages hirarchy right from the start of a new site, you can do it this way: enable languages support set Title / Label of the default language to your desired none english native language, (e.g. 'Deutsch' (German)) drop in the none english language pack (for admin backend) into the default language, (e.g. german langpack) add a new language to it and drop in a language pack for any none english language or simply don't drop in a language pack to get the english version (but not as the default one!) As a nice sideeffect every new user in your system gets the native language per default without have it to select from the list. So, yes, this is no solution if you once have set it up and need to switch the default language afterwards, but just want to note it.
    1 point
  31. one of the first pieces of wisdom i got from Soma was about making a template from where you can execute api stuff; this is needed on every site, because you'll always need some "api playground" where you can test things and run things to change, add, fix content.. my setup is to have a template called tools, and then a subfolder in the templates where i store all of the scripts that i will run on that tools template, then i just include the one i'm currently using into it and go from there. Sometimes when developing a new part of a live site, i can just clone a template, run it under tools and set the virtual page to anything in the site (example, $page = $pages->get(1012); ) but mostly i'm doing complex imports from other systems like joomla, or from spreadsheets with a lot of custom stuff and dependant/related pages, formatting etc..
    1 point
  32. Just committed some new features: New checkbox "Send welcome message" added to the bottom of each user page - uncheck to NOT send the email to a new user. You can use this checkobox to re-send a user's welcome email if needed. You can edit the welcome message template for each user as you create and save the user. Also some better error reporting, and detection of PasswordForceChange. Please let me know if you have any problems with this new version.
    1 point
  33. Just hold the new c't one of the big german computer magazines....it's a 4 page article....very nice written. some extractions translated: ...backlinks online and in the end of the article $pw->awesome->url = http://ct.de/ybn5 best regards and a great weekend mr-fan
    1 point
  34. Just pushed a new dev branch to my fork of Shop module with the current version of the discount module included. Working nice so far. https://github.com/somatonic/Shop-for-ProcessWire/tree/dev https://github.com/somatonic/Shop-for-ProcessWire/commit/80663d3512ff251b0f616f812645b24573e19834 If anyone interested to try to see. This is my how my cart looks:
    1 point
  35. $page=new Page(); $page->template='basic-page'; $page->parent='/mommy/'; $page->name=microtime(); // .or $page->name='gilderbergersbang' . $page->parent->numChildren;
    1 point
  36. So I asked in the irc channel, and Soma was so kind as to list a ton of solutions, the best being (imo): $page->status->has("name=is_hot")
    1 point
×
×
  • Create New...