Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/27/2014 in all areas

  1. I've created a new Textformatter in the last couple of days: TextformatterSrcset will add a srcset attribute to all your images inside a Textarea. Depending on your configuration, it will create all sizes for the images, make a double-sized one for HiDPI/Retina devices and you can even create a low-quality placeholder. Read more at Github and make sure that you read the examples. It was build to work perfect with the two scripts from Alexander Farkas, respimage and Lazysizes. Do yourself a favor and try them out. They don't require jQuery, they have wonderful fallback and are fast and easy to use. More information and downloads on our Github repo. This module is currently quite stable and tested against multiple configuration variations. It works Some code improvements are needed, so use with care. Feel free to ask any questions you might have.
    9 points
  2. TextformatterMakeLinks This Textformatter module is just a wrapper around the method fHTML::makeLinks from flourishlib (http://flourishlib.com/api/fHTML#makeLinks) The following description is basically just slightly modified copy from the official flourishlib documetation (http://flourishlib.com/docs/fHTML): The Textformatter will parse through a string and create HTML links out of anything that resembles a URL or email address, as long as it is not already part of an tag. Here is an example of it in action: If you put this text into a textarea inputfield which uses this textformatter Example 1: www.example.com. Example 2: https://example.com.'>https://example.com. Example 3: john@example.com. Example 4: ftp://john:password@example.com.'>ftp://john:password@example.com. Example 5: www.example.co.uk. Example 6: john@example.co.uk. Example 7: <a href="http://example.com">http://example.com</a>. The output would be: Example 1: <a href="http://www.example.com">www.example.com</a>. Example 2: <a href="https://example.com">https://example.com</a>. Example 3: <a href="mailto:john@example.com">john@example.com</a>. Example 4: <a href="ftp://john:password@example.com">ftp://john:password@example.com</a>. Example 5: <a href="http://www.example.co.uk">www.example.co.uk</a>. Example 6: <a href="mailto:john@example.co.uk">john@example.co.uk</a>. Example 7: <a href="http://example.com">http://example.com</a>. Downloadhttps://github.com/phlppschrr/TextformatterMakeLinks http://modules.processwire.com/modules/textformatter-make-links/
    8 points
  3. Bingo My assumption from my previous post was right. The PWimage plugin needs a hidden text input field with the value set to the page id of the page that you want to grab images from. I added a hidden input field to my form with $imgPageID = $pages->get("template=media, created_users_id=$uID")->id; $field = $modules->get("InputfieldText"); $field->label = " "; $field->attr("id+name","Inputfield_id"); $field->attr("value",$imgPageID); $field->attr("type","hidden"); $adform->append($field); Now I can choose images from the user's images page And there is no custom module with hook to ProcessPageEditImageSelect required. EDIT: This only works for PW 2.5. For 2.6.x some adjustments are needed. You'll find more info here
    4 points
  4. Inputfield And Fieldtype ImageFocusArea requires ProcessWire 2.5.6 or later This Inputfield makes it possible to select the important part of the image and use this area for different cropping options. This module is not a replacement for the existing Thumbnails module, though depending on your need it probably could replace it in many cases. I think a more flexible cropping approach than the existing Thumbnails module is useful especially when using the new html <picture> and you don't want the editor to define multiple thumbnails. Usage Create a new Inputfield ImageFocusArea and add it to the desired template. Edit a page with this template and add an image to the new field. You will see a link "Add Image Focusarea". Click the link and you will see a popup with a cropping tool similar to the Thumbnails module. Select the important part of the image, click "apply" and save the page. By default the Field hooks into Pageimage::size and automatically populates the cropping option with percentages of the center of the selected focusarea. You can always override this behaviour by calling $image->size with a different cropping option (e.g. $image->size(100,100,array('cropping'=>'center'))). The module introduces 3 new cropping options: align: This is the default if you do not override it with another cropping option. When resizing a image the module only adjusts the alignment of the crop. You will get the most zoomed-out result of these options. inside: Only parts inside of the selected area are used in the resulting image. You will get the most zoomed-in result of these options. outside: The resized image will contain the whole selected area. The surrounding imagearea will be used to reach the targetsize. This is also true for upscaling=false. Upscaling will only happen if the source image was smaller then the targetsize. API usage examples // here we force the old/usual 'center' mode: echo "<img src='{$page->image->size(200,200,array('cropping'=>'center'))}' />"; // by default if you did not define a cropping option, the cropping option gets automatically populated // Both calls will result in the same image: echo "<img src='{$page->image->size(200,200)}' />"; echo "<img src='{$page->image->size(200,200, array('cropping'=>'align'))}' />"; // the resulting image will be the center area of the selected focusarea echo "<img src='{$page->image->size(200,200, array('cropping'=>'inside'))}' />"; // to get an image with exactly the same ratio as the focusarea use width()/height() instead of a size() echo "<img src='{$page->image->width(200, array('cropping'=>'inside'))}' />"; echo "<img src='{$page->image->height(200, array('cropping'=>'inside'))}' />"; // the whole selected area will be part of the image, the surrounding imagearea will only be used to reach the targetsize echo "<img src='{$page->image->size(200,200, array('cropping'=>'outside'))}' />"; Flexible CSS Background Images Additionally you can access a new property cssBackgroundPosition, which could be useful for frontend responsive images. The visual result is similar to the cropping='align' mode, but depending on the size and postion of the focusArea and your images source and target size your mileage may vary. This property is intended to be used together with background-size: cover;. It is important that the background-image has the same ratio as the original image! <style> .cssimg{ background-size: cover; width:200px; height: 200px; } </style> <div class="cssimg" style="background-position: <?= $image->cssBackgroundPosition ?>; background-image: url(<?= $image->url ?>); "></div> Downloadhttps://github.com/phlppschrr/ImageFocusArea remember, this modules requires ProcessWire 2.5.6 or later There are still known bugs with upscaling=false, but I am not sure if it is a bug of this module or a ProcessWire bug. (fixed in ProcessWire 2.5.6) Thanks to Ryan and especially Horst for all the new great API additions for Pageimage und ImageSizer which made this module possible. This is my first module. If you notice any problems or unexpected behaviour post here or fill an issue on github. I am open to all suggestions. Do you think the cropping option names (align, inside, outside) are descriptive enough? Any better ideas? -- Edit: Renamed the Module to ImageFocusArea and updated the github link Edit 2: Reformatted this post and added some additional information.
    3 points
  5. It's included in the initial invoice, and I include information about all the service-provisions in an SLA. A year later, they're given another invoice for the hosting (and thus maintenance). With regards to site changes, I don't bill if the change takes me less than 10 minutes. Reason being: I don't have a lot of clients. The second I have plenty, and support becomes a time-issue, I'll be revising it. I may set up a retainer programme, or I may separate the hosting fee into two parts (actual fee for hosting, plus maintenance and site changes at a flat fee per month, payable per month or per year). I find this quite interesting, and it has been debated amoungst my colleagues a few times. Here in SA, the onus is on the the person who signed up for the hosting to legally state (that is, on paper, signed) that he/she will not interfere with confidential information, such as email, customer databases, etc. Further, I keep a video-log of everything I do on their server when I sign into it. If the client requires me to prove that I haven't interfered, should something go wrong, I show them the videos, and state that I have kept to my word. There is the issue of trust, however. The client doesn't know if I ever logged in between any two sessions, for example. Once again, it's a 'word' thing. Personally, I keep my word - I don't know so much about others (most do, but you get some dingy people on this humble [or not-so-humble] planet). Also, like Joss does, I don't force the client into getting a hosting package with me. If they choose to host it with someone else, I investigate and inform them whether or not I can provide server support. If I can't, I recommend someone who can. However, I always offer site support. After all, I built the thing, and so I should be the one to do it. That said, I do give the client the opportunity to choose someone else (perhaps someone in their IT department, if any) that will do site-support. If that becomes the case, I sever all ties from that front, leaving them responsible. When it comes to things like this, there's no half-in and half-out. That said, I do make sure, at the onset, that the appointed person knows what he's doing, and then I sever ties on that front. This is something I'll be venturing into when I have more clients: a cloud package. Some South African ISPs do have cloud servers around the world (like Afrihost, which uses MTN and its network), and they're pretty good, so I've heard. That said, I'm sticking with shared hosting for now, as I have a solid legal framework/process for them, and it's all mentioned in my SLA, and any other binding contracts. My process: I get asked if I can build a site, or offer a non-client with an old/outdated website if they'd like a new one Once we've established that they want one, I request all the information/requirements I need in order to build a quotation Information and requirements received (written), and so I build up a quotation Once they've accepted it (after revisions, if necessary), I draft up an SLA (based on my blueprints), get it signed, collect 50-60%, and begin the design and development process (including conceptual work). Once I've done major pages, such as Home and About Us (for example), with the full design (and templates) at least 90% ready, I upload a development version to a server (be it mine or theirs, whichever they prefer). The preview is also user-name/password-protected. We then discuss what's already there, and what content/design tweaks need to made. I then make any changes, add all final content, and update the preview (now in beta). Client makes final reviews. Once they're happy with everything, they're informed that they need to pay for the remainder of the quotation, at which time an invoice is issued (stating that they've already paid x amount). Once paid, I upload to the staging server (or move to staging folder on the server, whichever is the case). Job done! Of course, the process is subject to change, on a client-per-client basis - but most of the workflow stays in tact. Edit: Oh, and a note about the 50/50 (@MindFull): I've never had a problem with clients changing their mind. If they do, I'll revise.
    2 points
  6. Adaptive websites use breakpoints to target for specific viewport widths, while responsive uses percentages for elements to adapt to the width of the container where it lives in. Adaptive and responsive can work nicely together, but the terms aren’t interchangeable.
    2 points
  7. This module adds a "SEO" tab to every page where you can define a special title, description, keywords, etc. Try it http://aluminum-j4f.lightningpw.com/processwire/ Name: demo Pass: demo123 How to use You can choose between include automatically or use the following methods: $config->seo // includes all the default values and configuration settings // e.g.: $config->seo->title $config->seo->keywords $page->seo // includes all the default values mixed with the page related seo data // e.g.: $page->seo->title $page->seo->keywords // for rendering: $page->seo->render . . Screenshot Download You can download it in the modules repository: http://modules.processwire.com/modules/markup-seo/
    1 point
  8. Just wanted to post it here for others that might look for an example. I'm currently working on importing a Site to PW2.1. Following code I figured is needed to create pages using the Bootstraped API: <?php include(./index.php) // bootstrap PW $p = new Page(); // create new page object $p->template = 'page'; // set template $p->parent = wire('pages')->get('/about/'); // set the parent $p->name = 'mynewpage_url'; // give it a name used in the url for the page $p->title = 'My New Page'; // set page title (not neccessary but recommended) // added by Ryan: save page in preparation for adding files (#1) $p->save(); // populate fields $p->image = 'path/to/image.jpg'; // populate a single image field (#2) $p->images->add('path/to/image1.jpg'); // add multiple to images field $p->save(); // testing echo 'id: '.$p->id.'<br/>'; echo 'path: '.$p->path; Note: in PW 3 with multi-instance support adding new Objects https://processwire.com/blog/posts/processwire-2.6.21-upgrades-comments-more-on-pw-3.x/#more-updates-on-processwire-3.0 [Edit by Ryan #1] Added first $p->save(); [Edit by Ryan #2] Changed $p->image('...') to $p->image = '...';
    1 point
  9. Hi everyone, I'm glag to introduce pierre-diagnostic.fr. This is the corporate website for a french real estate services agency. It was built with Processwire 2.5.3 and the following modules : AIOM ProcessBatcher Zurb Foundation 5 (wich is a delight to work with) Go Processwire!
    1 point
  10. For a noob like me it was easy enough when I tried to setup a DO VPS using their guides. The issue for me would have been maintenance and security - which I would have sucked at - so I've stayed with my managed VPS. Take a look at https://serverpilot.io/ too.
    1 point
  11. Yep, that turned out to be my problem. Previous developer who created my user account before handing over did so with limited permissions. :/
    1 point
  12. Or you can use wireRenderFile a new addition to ProcessWires functions: https://processwire.com/blog/posts/processwire-2.5.2/#new-wirerenderfile-and-wireincludefile-functions echo wireRenderFile('markup/contact-markup.php', array( 'name'=>'john doe', 'address'=>'sample street', 'zip'=>'sample city' )); I did not test this example, but according to the docs it should work like this. Requires ProcessWire 2.5.2
    1 point
  13. Thanks for this Marek, this is one of the few areas where I feel "frameworks" have a slight edge over PW. A nice validation library looks good.
    1 point
  14. @adrian I was able to solve my problem without the need for a module. See also my post in the other thread. Cheers Gerhard
    1 point
  15. Sorry to be late on this, but I have made this work on the front-end and from memory, it sounds like you are on the right track with the Inputfield_id issue. Sorry, not enough time to look at things properly right now, but I think you are close
    1 point
  16. Ok, all makes sense now Your needs are different from the person I put that together for - they wanted the root parent changes, not to actually drill down to the specific page. You can get directly to the specific page with this: public function changeParent(HookEvent $event) { $pid = (int) $this->input->get->id; $event->replace = true; $event->return = str_replace($pid, $rootPageID, $event->return); } BUT unfortunately this doesn't load the images available on the page because the check to see if there are images available or not happens here: https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/modules/Process/ProcessPageEditImageSelect/ProcessPageEditImageSelect.module#L129 which is before the execute method we are hooking into. So I think you'd actually have to hook directly into ProcessPageEditImageSelect::getImages which is not currently hookable. But maybe you should add the ___ to it and play around and see if you can get it work. Sorry I don't have time right now, but I think it should be doable. If you get it to work, Ryan should be amenable to making it hookable in the core.
    1 point
  17. What version? I use 1.1.1. from http://modules.processwire.com/modules/process-admin-custom-pages/ ACP scripts and styles are optional to load .js and .css on the template but the choice for template on the admin page should appear if you choose the Process - see screenshot? You even didn't need a template under the template section since the template select lists all .php files in site/templates.... regards mr-fan
    1 point
  18. I am working with a designer who's experience lies mostly in print. So, I have written a document explaining the fundamentals of modern adaptive web development. This is not a technical manual, but rather looking at what needs to be considered by the creative designer when coming up with something that a developer can deal with well. Since we have a good assortment of multi-disciplined souls here, would a few of you care to read it and suggest anything I perhaps should add, without making it heavier or much longer? Some of you may find this useful for your own purposes too and you are very welcome to use it. UPDATE I have done a new draft, removing the adaptive idea which kind of got lost as I wrote - the trials of writing an essay off the top of my head with no planning whatsoever! Silly me. It is now called Responsive Websites UPDATE 2 Cleaned up version - the chat about flat icons is now shoved at the end as an after thought Responsive Websites 2.pdf
    1 point
  19. I just pushed some updates to github. I optimized the handling of the 'outside' mode. Before the update I switched the 'outside' mode to 'align' if the focusArea was smaller then the target size, now I try to expand the focusArea on each side. @BernhardB: Please give the latest version a try, maybe if fixes your issues, too. I could not reproduce the behaviour you described until now. And update your PW to the latest dev, Ryan just merged Horsts fixes to the ImageSizer.
    1 point
  20. $userID = wire("user")->id; as you have it in your modified version will work fine I would test your changes to the module in the admin first - if that works, then you can focus on the front-end issue.
    1 point
  21. Last update: Shoved the flat design info at the end as an afterthought and generally cleaned it up a bit
    1 point
  22. To be honest, this sounds more like a budget issue than anything else: So, what is the cost of rebuilding the original site in EE (allowing for the fact it is already in EE and allowing for any licencing issues) What is the cost of building a replacement site for the original in ProcessWire? What is the cost of building the new site in EE including any licencing? What is the cost of building the new site in EE? From the little I know about EE, it seems that it is possibly less work to build in PW - though I may have that very wrong! Once you work out the cost, you can then do a proper comparison. If the price works out similar, then just announce you will do it all in PW. If it is more expensive to transition to PW, but still feel he should have both built in PW, then you need to make the operational case (don't worry him with technology). So, "it will be better to spend the extra money because....."
    1 point
  23. Good morning! Just clearing a few things first. Currently the module does not expect a thousand separator at all - neither does it understand anything about your locale. The module expects only a decimal separator, which is expected to be a dot or a comma. Currently there is no validation support either, so invalid values will be just sanitized - which is a bit brutal. However I am more than glad to implement these features now that I see there's interest for them @kixe: If I understood mr-fan correctly, he would like it to be interpreted as a thousands separator - which it currently is not doing, entering "40.559" would result in "40.56" in the database (if configured to use two-digit decimal precision). This is a good idea. I will provide this feature so that you can give the default option in the module-settings + the possibility to override it in the field-settings. @mr-fan: Thanks a lot for your comments! Just to make sure, you would like the dot in this case to be understood as a thousands separator? So if "40.559" was entered, the module would store "40559.00" in the database (when used with two-digit decimal precision)? And if "40.559,559" was entered, you would like the module to store "40559.56"? Either way I will provide an optional strict validation support, which will be based on the precision and sanitization options defined in the field-settings.
    1 point
  24. Another update today! I noticed more and more people in the forums are using with the "Disable Settings Tab?" option (available via: $config->advanced = true). With this disabled, and if the "Display 'name' field in content tab?" setting is not enabled, the "Name" field is not available for javascript manipulation when the title is changed. This update checks for these two settings and if required it will change rename behavior to work on page save instead of instantly via javascript. This alternate method respects the "Initial Differences Protected" setting, but of course the "Prevent Manual Changes" and "Live Changes Protected" options are not relevant since it isn't possible to manually change the page name since the field is not available in the page edit dialog. This update is therefore only relevant if you are using that "Disable Settings Tab?" option, but if you are and you're using this module, please let me know if you have any problems.
    1 point
  25. @interrobang: I have installed and tested it and I only can say: wow, really lightweight and straight forward!
    1 point
  26. Thanks for the bug report Bernhard. The updated and renamed module is now on github.
    1 point
  27. Thank you all! The code from horsts first post was nearly the solution. I needed the filename + the extension. With a uploaded file, e.g. example.jpg I've extracted the variation name from the src-attribute (example.321x0.jpg). Making it example.jpg again and then use horst code it worked. $tmp1= explode('.',$variationName); $meta['imageName'] = $tmp1[0]; $meta['ext'] = $tmp1[count($tmp1)-1]; //Thanks to Horst Nogajski for the following snippet foreach($p->fields as $field) { if (! (bool) ($field->type instanceof FieldtypeImage)) continue; // if no images field, go on // find the field that holds the image if (!$p->get($field->name)->has('name=' . $meta['imageName'] . '.' . $meta['ext'])) continue; $image = $p->get($field->name)->get('name=' . $meta['imageName'] . '.' . $meta['ext']); }
    1 point
  28. As a sidenote, regarding the detection of imagefields if (! (bool) ($field->type instanceof FieldtypeImage)) continue; // the only way I know to find all image fields, also those coming in the future, is to check for the instance of FieldtypeImage, what also is true if a field extends FieldtypeImage . As of today (date of this post) we allready have those known image fieldtypes that extend the core images fieldtype: Cropimage -> (also known as Thumbnails) ImageFocusArea -> (formerly known as ImageFocusrect) ImageExtra -> ImageExtraLanguage -> CroppableImage (a fork of Cropimage, coming soon) Images section is growing!
    1 point
  29. hi totoff, using the TemplateFile class is perfect for this, have a look at ryans blog profile: https://github.com/ryancramerdesign/BlogProfile/blob/master/templates/archives.php#L101 simple way: file "site/templates/markup/contact-markup.php" (naming it -markup here to point out the difference to the standard template file) John Doe<br> Sample Street 1<br> Sample City template file eg "site/templates/contact.php $contact = new TemplateFile(wire('config')->paths->templates . 'markup/contact-markup.php'); echo $contact->render(); // don't forget to echo! more flexible: with variables! markup/contact-markup.php <?= $name ?><br> <?= $address ?><br> <?= $city ?> contact.php $contact = new TemplateFile(wire('config')->paths->templates . 'markup/contact-markup.php'); $contact->set('name', 'john doe'); $contact->set('address', 'sample street'); $contact->set('zip', 'sample city'); echo $contact->render(); edit: in your case you can do $sidebar = $contact->render() instead of echoing it... forgot the point of delayed output
    1 point
  30. Hi Philipp, at first, to get the original name from a variations name, you simply have to drop all after the first dot in the basename: (this works with all PW versions, 2.2, 2.3, 2.4 and also with the changed NamingScheme in PW 2.5.+) $imageName = pathinfo($variationName, PATHINFO_BASENAME); // I do not use PATHINFO_FILENAME here because this way it also matches original filenames $imageName = substr($imageName, 0, strpos($imageName, '.')) . '.' . pathinfo($variationName, PATHINFO_EXTENSION); // determines where the first dot is and drops all after that position, and simply add the extension // the only way to find all image fields, also those coming in the future, is to check for the instance of FieldtypeImage, what also is true if a field extends FieldtypeImage: foreach($page->fields as $field) { if (! (bool) ($field->type instanceof FieldtypeImage)) continue; // if no images field, go on //if (count($page->get($field->name)) == 0) continue; // this isn't needed I think because the next check with ->has() covers that case too // find the field that holds the image if (!$page->get($field->name)->has('name=' . $imageName)) continue; // if you reach this line, you have your field and your original image If you are in template scope, you may test to switch of outputformatting when asking with ->has(), or it could raise an error if the imagefield only allows a single image and doesn't return a wireArray. (I'm not sure on this, - just want to note not to forgett to test on this)
    1 point
  31. For me, it looks more like this: I get asked if I can build a site I make an offer and they accept it After that I write the bill, and they pay Now I begin building I upload a beta on my server and we put content in and do changes until it's ready I move it to the client's server (if they already have one) or recommend a hoster (sometimes with a little provision) Now we're done My approach used to be a lot like yours but I've learned to take this approach throughout the years because too many times I've had clients decide at the last possible moment that our initial agreement was out of their budget or that the site wasn't as important to their business model as they initially anticipated. The company I work for doesn't write a single line of anything unless the client has agreed both on paper and with their payment that the work should commence. No partial payment, no half now and half later. I've followed their lead in my independent work and it's worked out much better for me since I started doing this. I ensure clients get what they are asking for and work with them every step of the way until it's done. As far as offering maintenance, I only offer what's needed and what I have the time to do. I offer small packages based on my hourly rate, with a little discount. This way, if they need something like a new template file, pages added, database backup, etc., they don't have to pay me a-la-carte, it's all inclusive up to the agreed number of hours and the hours don't roll over into the next month. Sometimes, with certain sites, I don't offer this at all because of the site would need a more dedicated schedule to maintain it properly. These things are usually discussed at the onset of development, to give them a clear picture of where I'll be after the completion of the project. I used to resell web hosting, I stopped after sites would slow dramatically due to resources not being available (being oversold, even on VPS) or server halts. I don't like being in a situation where people are looking at me to do something about their site being down and them losing money when I don't have any control over the hardware. All you can do in that situation is call whoever your provider is and complain - but that doesn't help your client feel any better! I like being responsible for what I can readily address, not for things out of my hands.
    1 point
  32. Hi Nico, my workflow looks very much the same with two major differences: whenever possible I work according to the principle "content first". That is, I'm trying to have the - written - content ready before I start making the site. Thus I have a better idea of what design is needed and how the site needs to be organised. I never ever offer hosting. The legal situation in Germany means so much risks for a hosting service that I decided not offer it. Just inform yourself how many "Datenschutz" rules you have to consider if - for example - you have access to your clients emails (which you definitely have if you host their site). I would say: It's not worth doing it. Hope that helps
    1 point
  33. Cloud hosting options make it relatively easy to set up even "per-client" environments, but a shared setup still remains a viable option. In the latter case you'll want to consider how secure it is, though, and what happens if one site is somehow compromised, under DDoS attack, etc. Probably the best advice I can give right now would be researching available options carefully and trying to be prepared for all possible (and seemingly impossible) issues -- consider it just a matter of time before they happen to you In any case, I wouldn't call it "like making money without doing stuff". Regardless of what kind of deal you make with the client (and perhaps another company that does the hosting for you), the client will consider you, personally, responsible if something goes wrong. This is also why you'll want to define very clearly what your responsibilities are, what kind of SLA you offer, how fast you'll have to react to issues, what kind of services you provide on a 24/7 basis, and so on. Oh, and trust me: being on call 24/7 gets on your nerves after a while..
    1 point
  34. My process differs per client, but follows a simple model, similar to yours. In terms of hosting, the client pays me for it, and I host it with my HSP. I believe that it's a cleaner way for me to charge a tad extra, which covers maintenance, and ad-hoc server-support (creating email accounts, releasing things caught in SpamBox, etc.). I also ensure that my clients pay me upfront for an entire year of hosting.
    1 point
  35. I don't even know why you're so worried about switching from CMS a to CMS b. It's not you're rebuilding his old site. You're making a new site for him (or did I miss something?). Was he specifically asking you to build the first site with EE? In the end, you built a website, with whatever tools you've chosen at the time. Simply build his 2nd site now with whatever CMS you decide to use. If he even mentions something like "why a different backend this time?", list your arguments then. Everyone should know by now that our business is very fast-paced. Tools come and go, get better or worse; c'est la vie. He'll even be thankful you were trying to avoid costs for him in the long run (EE support), and as a business guy he'll appreciate that. I wouldn't mention that you probably would have to update lots of stuff for his old EE site - he could think that you didn't do your duty in the last two years and start to worry now. I also wouldn't mention that you would have to get up-to-date with EE, since that could be misread as "he doesn't care about keeping up-to-date as a developer".
    1 point
  36. Here is a more personal thing I guess: For me mobile first is more about content then about graphical decisions. There was a trend, (i'm happy that it's mostly gone) is to just hide stuff in the mobile environment if it wont fit the viewport as mobile was a thing people implemented as afterthought. While I think mobile is as important as desktop and should be developed in parallel or strongly kept in mind how to handle. Then there's always my question: When information is not important enough to show it on mobile, what is the importance for this info for the desktop. I do not say it's always a good practise to use the same content everywhere as the environment where the content lives has it's own properties.
    1 point
  37. Joss: glanced through this quickly, and so far I'm liking it. Your terminology is a bit "unique", but that's partly about semantics -- adaptive is actually not the same thing as responsive, etc. Apart from that, this seems like a very good starting point for someone with limited knowledge. Anyway, it's possible that I just missed it, but you might want to cover some common responsive patterns, especially navigational ones. That's one of the areas where even seasoned web experts tend to struggle. Google has some pretty awesome resources on patterns and a few other things you might want to check out for ideas.
    1 point
  38. This with the Textareas in COnfigurable Modules I have tracked down to this line: https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/core/InputfieldWrapper.php#L300 Before this line the content of $ffout looks like: "\n<textarea id=\"Inputfield_textarea-value\" class=\"InputfieldMaxWidth\" name=\"textarea-value\" rows=\"5\">line one\r\nline two\r\nline three\r\n</textarea>" and after processing the preg_replace, $ffout holds "\n\t\t\t<textarea id=\"Inputfield_textarea-value\" class=\"InputfieldMaxWidth\" name=\"textarea-value\" rows=\"5\">line one\r\nline two\r\nline three\r\n\t\t\t</textarea>" I have filed an issue at GitHub: https://github.com/ryancramerdesign/ProcessWire/issues/759
    1 point
  39. I remember that this is also with configurable modules, if you have a textarea in a config screen where you should add params one per line, for example, and if you simply end the last line with a "new-line char", line one (new-line-char) line two (new-line-char) line three (new-line-char) hit submit, you will get back your content with three tab characters added! If you do nothing but only hit submit once again, you will get three more tabs added, and so on and so on. Whereas if you let out the last "new-line-char", you will get back only the content you want, without added tabs: line one (new-line-char) line two (new-line-char) line three This is with PW 2.3, 2.4 and 2.5, you can test this simply by make the HelloWorld Module configurable: class Helloworld2 extends WireData implements Module, ConfigurableModule { public static function getModuleInfo() { return array( 'title' => 'Hello World 2', 'version' => 2, 'summary' => 'An example module used for demonstration purposes.', 'href' => 'http://processwire.com', 'singular' => true, 'autoload' => true, 'icon' => 'smile-o' ); } public function init() { } static public function getModuleConfigInputfields(array $data) { $form = new InputfieldWrapper(); $field = wire()->modules->get('InputfieldTextarea'); $field->label = 'Textarea'; $field->attr('name', 'textarea-value'); $field->attr('value', $data['textarea-value']); $field->columnWidth = 100; $form->add($field); return $form; } }
    1 point
  40. Settings for the CKeditor in the wire folder should actually be put in the inputfieldCKeditor directory in the site/modules folder, so they do not get overwritten by Wire updates. That also includes any additional plugins you might install.
    1 point
  41. thanks jordanlev and horst, i have read topic Create simple forms using API earlier, but i found it to be a lot of work for simple forms. I wanted to be able to write html markup manually. that's why i tried different approach. it also renders error states like you want. It works easily with css frameworks. for anyone who would like to try it (i would love to see someone to take a look at it) ... you just need to download Valitron library https://github.com/vlucas/valitron , then put it in templates directory so you can include it with include("./valitron-master/src/Valitron/Validator.php"); and then make new page using template with the code in my first post... thanks, Marek
    1 point
  42. What about this: $np = $pages->clone($page); $np->of(false); $np->title = 'New Page'; $np->name = 'newpage'; $np->save();
    1 point
  43. Well, I'm no pro at this and you could probably improve it, but here's my attempt which serves my current needs pretty well: /** * Creates a repeater field with associated fieldgroup, template, and page * * @param string $repeaterName The name of your repeater field * @param string $repeaterFields List of field names to add to the repeater, separated by spaces * @param string $repeaterLabel The label for your repeater * @param string $repeaterTags Tags for the repeater field * @return Returns the new Repeater field * */ public function createRepeater($repeaterName,$repeaterFields,$repeaterLabel,$repeaterTags) { $fieldsArray = explode(' ',$repeaterFields); $f = new Field(); $f->type = $this->modules->get("FieldtypeRepeater"); $f->name = $repeaterName; $f->label = $repeaterLabel; $f->tags = $repeaterTags; $f->repeaterReadyItems = 3; //Create fieldgroup $repeaterFg = new Fieldgroup(); $repeaterFg->name = "repeater_$repeaterName"; //Add fields to fieldgroup foreach($fieldsArray as $field) { $repeaterFg->append($this->fields->get($field)); } $repeaterFg->save(); //Create template $repeaterT = new Template(); $repeaterT->name = "repeater_$repeaterName"; $repeaterT->flags = 8; $repeaterT->noChildren = 1; $repeaterT->noParents = 1; $repeaterT->noGlobal = 1; $repeaterT->slashUrls = 1; $repeaterT->fieldgroup = $repeaterFg; $repeaterT->save(); //Setup page for the repeater - Very important $repeaterPage = "for-field-{$f->id}"; $f->parent_id = $this->pages->get("name=$repeaterPage")->id; $f->template_id = $repeaterT->id; $f->repeaterReadyItems = 3; //Now, add the fields directly to the repeater field foreach($fieldsArray as $field) { $f->repeaterFields = $this->fields->get($field); } $f->save(); return $f; } And here's an example of calling it: $f = $this->createRepeater("sc_promos","sc_promo_active sc_promo_code sc_promo_discount","Promotional Offer","shoppingCart"); You can then use $f to add your new repeater field to a fieldgroup/template.
    1 point
×
×
  • Create New...