Jump to content

Leaderboard

Popular Content

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

  1. Hi, kawaramono.cz is little presentation web for my friend made with PW. Pretty simple solution with full content administration, zurb foundation framework and colorbox.
    4 points
  2. Just comitted v 1.0.1 to Github: - Added checkboxes for include=hidden, include=all so you no longer need to write those in the selector - Made AdminDataTable sortable - Each status is now in its own column - this means you can also sort the results by status - Added message: number of pages found I initially disabled the sorting on the table because there was an issue with the checkbox in the first <th> which can be used to toggle all the checkboxes. The solution is to disable the sorting of a specific column with jqueryTableSorter: $.tablesorter.defaults.headers = {0:{sorter:false}}; ...where 0 = first column, 1 = second and so on, should anyone else ever need this.
    3 points
  3. ha! Mind you, if I start with German and work back to English, the site will be tiny! As a sound engineer I did a lot of multi-lingual dubbing work. A huge amount of it was into French and German. Spoken, German is significantly longer than English (if translated nicely) and with the verb at the end of the sentence, the subject and object would often be reversed. If you had a long sentence, not only was the German too long, but no longer made sense to the picture! We had two particularly wonderful translators, however, that managed to produce perfect fits. Andreas Klatt and the renowned Wolf Kahler. Wolf's voice, especially, was wonderful - he could roll his Rs all the way to lunchtime and still be on the same word! Very nice site, by the way - I forgot to mention that.
    2 points
  4. Thanks for the beer because it works. Took me only 5 minutes . I knew exactly in what behaviour it failed and I even painted in my head why this could be and it was exactly that and just a really minor change. Prosit!
    2 points
  5. I think nateronn also mentioned this before. This will be one of the major drivers behind ProcessWire 2.4. I'm only concerned about actual bugs at this point for the 2.3 release. But it's a valid point and will make this look nicer soon. If using the same one as before, you didn't actually change the password. In this case, it literally needs the password to be changed.
    2 points
  6. I think that all the things you mention sound good. A few questions comments though: What would be the benefit of saving content to disk (vs database?). I'm not sure that it really matters to the user where it is stored, so wanted to inquire more about your thoughts here. What would define old entries? I'm guessing in some cases, people would like to just let it go forever (disk space is cheap). Javascript diff feature sounds awesome. Though also have to admit, just being able to toggle between the different versions and see the immediate change (the way you have it working now) is kind of a nice "diff" effect too. You don't necessarily need anything else for a version 1.0. How does it scale? Meaning, what happens when you've got 100 versions. I haven't tried it yet... and maybe you've already figured this out. But I was thinking maybe it shows the most recent 10 edits when you hover the icon, and ajax/paginates them somehow after that? (or opens a modal to a dedicated Process when you click more?) How does one handle deleting versions? I was thinking it doesn't need to be manual or interactive, but just a global time or quantity setting, i.e. "only keep last 50 versions" or "only keep versions for [n] days" or something like that. But having the option to keep them forever is also good… perhaps the behavior when the "[n] days" is left blank. Just supporting text fields for a 1.0 version seems ideal. This probably covers the vast majority of needs. Versioning of files/images sounds fun, but you are right that it's an entirely different task on the development side, since it has to manage files. And these fields aren't just files, but sort order, description, tags… and more in the future. Probably too much work for too little value here. So if it were me, I would just focus on those text fields. I think that the vast majority of versioning needs for files/images could probably be covered just by a file "trash" (whether global or page specific) where one could retrieve old files if they ever needed to… but that would be a different module. To summarize my thoughts: you've already got something great here that is already hugely useful. I'm not sure what more you need to take it beyond proof-of-concept (seems quite functional as-is), but the only thing I would consider is just making sure it can scale time and quantity. And then get version 1.0 out when ready. I think a lot of us can't wait to start using this. If there is anything that I can do to help (code, testing, etc.), I'm at your disposal.
    2 points
  7. your template should look something like this <?php include("header.php"); if($input->urlSegment1){ // code for the post page $post = $pages->get("/content-management/posts/$input->urlSegment1/"); if(!$post->id) throw new Wire404Exception(); // throw a 404 in case the page doesn't exist echo $post->render(); // you can put all the output code on the real post template }else{ // code for the categories page foreach ($posts as $post) { echo "<a href='{$post->name}'><h4>{$post->title}</h4></a>"; echo "</div>"; } } include("footer.php"); Edit: added the Wire404Exception() to the code and simplified the links
    2 points
  8. I pulled a request which fixes this behavior. https://github.com/ryancramerdesign/ProcessWire/pull/163/files#L0L533
    2 points
  9. I used to use a shopping cart software and I thought if I give you some of the set up options from that, it might help you configure a module for PW. First see attached document that shows the basic tax set up for that software. Some of the main set up selections are listed below: TAX MODE Simple or Advanced (select one) SIMPLE TAX Enter a description e.g VAT Enter a message e.g VAT payable on all UK orders Enter a % Rate e.g 20.00 ADVANCED Product Prices Entered Price inclusive of tax or Price exclusive of tax (Select one) Taxes Enter name e.g VAT Tax Rounding Level - Line Item Order (select one) Tax Rounding Method - Truncate, Round Half Down, Standard, Round Up, Banker's Rounding (select one) Tax By Location Always apply taxes, Tax by delivery address, Tax by Invoice address (select one) Tax Zones Add a Zone (you can add multiple zones) - Enter name e.g UK, select countries to be included in that zone e.g England, Scotland, Wales, Northern Ireland and save it. Then in Shipping and Handling section you would select shipping charges made - yes or no. If yes, choose the Tax Rate e.g VAT (as defined in Taxes above, Zero Rated, Exempt, Custom. If custom is selected enter custom rate. Select if handling charges are made. If yes, select Tax Rate (same as for Shipping selection). Then we get into Shipping configuration e.g Simple or By Zone and Class. That's a bit more complicated e.g Simple is a fixed charge e.g. 5.00EUR, By Zone and Class uses various methods like by weight classes and you can set up different postal charges e.g UK - First Class UK - Second Class UK - Standard Parcel etc. There's more info here I hope that helps. Let me know if you need any clarification. tax_set_up.doc
    2 points
  10. InputfieldMailChimpCampaign This is the very early state of a basic Inputfield & Fieldtype for creating & updating a MailChimp campaign. What it does: on create Creates a campaign on MailChimp Sends the url of the page (where the inputfield lives) to MailChimp and uses that page as campaign. Attache a mailing list to your campaign. Add several settings. Upon save ( check update on MailChimp checkbox ), let MailChimp pull a text-version of the campaign-page and store it on MailChimp. on update Update all previously set settings except the campaign ID Create a new text vesion of the campaign What you should know: Your page must be reachable from the internet. And your page must be in a published state. It's just pushing values from ProcessWire to MailChimp. Settings changed in MailChimp self will get overwritten upon page save. It's only handling campaign create & update. Send functions are not included. You can download it on github. --- note: It's in development state.
    1 point
  11. Have a look at those sad panoramas at http://panorama.philippreiner.de/ It's just a little idea I've had this afternoon. I wanted to post easily from my iPhone to a Processwire installation without using the admin backend* (*= Because I have to login, navigate to the site, click through pages,...) I'm using the tumblr iOs App to post to a Tumblog. (Screen) . Now I'm using apeisas Data Import to get the data from the Tumblr API . I'm using the old v1.1 API because the XML is easier to fetch. The posts are now saved to PW Because I wasn't able to programm a better solution, I'm downloading the images from the URL stored in a field to the original images field. I can now use the PW image functions. Now I can use them as normal pages, do the simple template and start posting. Only problem, the images from tumblr are resized down to 1280px on the long edge. Also, the site is responsiv and the images are loading with lazyload using a <noscript> fallback for older browsers.
    1 point
  12. As you maybe noticed, FontSquirrel doesn't have a custom preview text on the font list. I just found a very neat extension to take care of this https://chrome.google.com/webstore/detail/fontsquirrel-preview/amjelmhhimmobojbpoccmilajoalncem
    1 point
  13. Hi Philipp, hi Ryan, the idea of Philipp was very inspiring to me. So I have thought a bit about that and came to conclusion that the most common denominator is Email. Every smartphone supports Imagesharing via Email, and also one can put up an Image from DesktopPC. I've put together some php-classes to access POP3-Accounts, retrieve and parse Messages to (first find ) and extract Images. I have uploaded it as a first 'proof of concept'. In this state it retrieves the _first_ image from Message, regardless if it is attached, inline-attached, if it is a Textmail or HTML-Mail or from other MultiPart-Mails. The Subject from Email could be the Title of a Post. Adding Bodytext could be an option, but is not very foolproof with that lot of different Email-Mime-Types, but would be posible with some more amount of coding-time. Interesting Option could be to send Title in MailSubject and a Image-URL in MailBody - fetch the Image from URL and process it. Also sending multiple Images could be possible. - So, as I can do the above stuff by myself, I'm not able to put the ProcessWire-Part together at this time. (Maybe next year, - but not for now ;-) ) My question is: "Philipp, can you provide the code / example for the Import into ProcessWire?" If you like, we can put it together to become it a Plugin Module, maybe? At current state my class provides a array with str-Title and str-Imagedata per Mail. (processing till there is on the fly without using diskfiles) The current Setup can be viewed here: http://biriba.de/pw_pop3/pw_pop3_test.php But, please, no stress-tests! Emailadress is in the top-left corner, you may send a picture by mobilephone to it (around 500 px or smaller would be fine, because all images get scaled down to 320px for the test) and reload the page after a minute or two. Horst
    1 point
  14. I'll translate the descriptions of the labels in the backend. So it shouldn't be that hard for you
    1 point
  15. @sevarf2: You hit the same bug I did a while back . See here: https://github.com/ryancramerdesign/ProcessWire/issues/147 So you can either: 1) use trackChange() like WillyC showed you or 2) force the save of (only) the imagefield with $m->save('imageverify') or 3) update to a more recent version of PW where this bug has been fixed (dev branch) and use plain old $m->save() like you were trying to in the first place.
    1 point
  16. Having different languages and a multilang field's value is empty, the value of the default language is returned. http://processwire.com/api/multi-language-support/multi-language-fields/#multi-language-field-values Can we change this behaviour? Is there any method to prevent this already at Db-Level? For example: I don't want to return pages that have an empty title in language xy. This doesn't work: <?php //Default Language set $pages->find("title!=''"); //Works!! //Any other language $pages->find("title!=''"); //Doesn't work, throws exception: Exception: Table 'db.field_title1' doesn't exist I know I can set of = false and then get the unformatted language value, but would be cool to exclude those pages in a search query.
    1 point
  17. Should be. It's not responsive currently but I think that shouldn't be a problem. It's working in IE, too
    1 point
  18. jaoler: I have bunch of translations that I haven't committed yet. Will try to find time soon to make that up to date.
    1 point
  19. @WillyC: I didn't understand anything but adding the trackChange now the code works. Thank you so much!!
    1 point
  20. Is this site ready to announce and link from the main site? Let me know when...
    1 point
  21. only.use post u shold for action.that changess.db for.this work it can.how it is.evenif not good mabe $m->trackChange('imageverify'); $m->save(); ?
    1 point
  22. Probably yeah. Seems that I was actually having same problem as Antti. Thanks for noticing this, there's a fixed version at GitHub now
    1 point
  23. Ryan: thanks for your feedback! As soon as I get some free time for this, I'm going to start making some improvements - judging on your comments and my own thoughts they're going to be mostly about scalability (both in terms of both UI and data.) Main reason for this would be somewhat more manageable (and scalable) data structure. Currently metadata is saved to one table, content to another - which in larger use could result in very large (and thus pretty slow) content table. By using individual files instead of this table might result in better scalability.. though flat file hierarchy probably wouldn't be such a good idea either, since it could result in disk-related bottlenecks in the long run. Another idea would be to just split that content table into smaller chunks. One table for each field, or perhaps each fieldtype? I'll have to take a bit closer look at this one. I'm not even sure if it's really such a huge problem or if I'm just overcomplicating things. What do you think? Probably something similar to what I'm doing with (both) history modules would make sense here too; let the user define this via module settings. Like Joss pointed out, some sites might want to hold on to their data "forever", though I'd like to suggest that abacking things up properly might make more sense in those cases. On the other hand, on many occasions data older than, say, 6 months to a year, wouldn't be of much use to anyone. (Another CMS I've been using stores similar data for approximately 6 months in "easy to get" format, which has been more than enough in 99% of cases.) I guess you're right. It's just that I saw somewhere a nice demo of this and thought it might be really fun to have. Let's see This is a very good point and something I'm going to focus on. Short answer is that it scales "relatively well" at the moment; UI wise this is handled by max-height + overflow-y: auto, but all revisions are loaded and processed when page edit is opened. It could definitely use some extra measures for large amounts of stored revisions, probably something similar to what you've described here. This is very much related to some of the things I mentioned earlier in this post. Removing individual rows might make sense in some cases, but most that's not very high on my list here. I'm definitely going to add a configurable time limit, but would also like a quantity limit (like you're describing here.) If I recall correctly latter was also suggested by Nik and now I've got double the incentive to make it happen
    1 point
  24. Ryan, you're right. My mistake in template settings. It's all ok so far. Thank you for v e r y fast reply!
    1 point
  25. Shouldn't this be? $page = $this->process->getPage();
    1 point
  26. The exception that you got there would be a bug. I must have broken something during some recent updates to make it pass Nik's test suite. I'll investigate further. But I don't think this is related to your question. You should be able to target the value for a specific language like this (assuming I didn't break that too) $pages->find("title.data$user->language=something");
    1 point
  27. Creation of markup and CSS isn't technically a design task in the traditional sense, unless the designer literally designs in markup and CSS (a trend I like). Perhaps that comes from the places I've worked, but front-end development was always a development task. The designers dealt with concepts and visuals, not code (markup, css, Javascript and template engines are all code). I think there is more of a blurred line now though, that's a good thing… I've always liked having my hands in both. But I work with a few design firms that outsource development to me, and all provide me with layouts (whether photoshop or some kind of flat image type). I've never had a designer provide me with code... though maybe my experience is isolated there. Photoshop is both a design and development tool. I don't know many web developers that can do their job without some kind of image manipulation tool like Photoshop. So I would disagree with "I should not need a copy of Photoshop to develop". But I know different companies do it different ways. If you've got designers doing front-end development, that's great, but they are working with code, doing development. If they are producing good quality markup and CSS, and really know how to design, they are a "web designer/developer". That term is what defines most of our audience here. Your company should give those designer/developers a raise. So lets say that's your workflow. I agree with Diogo that this sounds healthy… so long as the designers know their front-end code as well as a dedicated web developer. The "logic" that people use in ProcessWire templates is largely presentational logic. If you are trying to follow an MVC pattern, presentation logic is still a component of the view layer. I think this distinction is important. ProcessWire is already handling the business logic. It doesn't really matter whether you are dealing with a PHP API or a template engine, as the tasks are going to be the same. ProcessWire templates can also be used for business logic. Typically we don't want to be processing forms, saving pages, etc., in the places we are generating markup for output, even if you technically can. There are a lot of good approaches one can take to separate concerns. If using an MVC approach, then you would isolate your presentation logic and markup to a separate view, like we do with the Blog profile. (Though in the Blog profile we really do this more for demonstration purposes, as there's not much in the way of business logic.) If you take this approach, you are using your ProcessWire templates as controllers and dedicating other files as views. You can use the TemplateFile() class for views, as the Blog profile does, or you can use some other template engine like Twig, Smarty, etc. I think that this approach may provide the right balance of separation for the environment you've described. But I'm not sure it's worth the overhead unless building some real business logic (like an application) rather than a traditional web site. I'm not sure about the Smarty module, but the Twig module seemed to have the entire PW API available to it.
    1 point
  28. I forgot about the existence of render() Thanks a million both of you. My boostrap/themable/ultra blog profile is now one step closer!
    1 point
  29. Have a look at the lower right corner of the page you are in
    1 point
  30. How do you find the pages at /news/political/xoxox? To move the pages out of the tree, I guess you have a page somewhere that reads the urlSegment and then finds the approriate page in the tree (ie /content-management/posts/xoxoxo). THis would be your category page. Whatever this page needs is what you have to use as an url. So if your category page (/news/politics/) works like this to find an actual post: $post = $pages->get("name=$input->urlSegment1"); this code: <a href='/news/politics/{$post->name}'> *should* work. (make sure to use "name" not title, and watch the slashes)
    1 point
  31. performed a fresh install of 2.3 and imported my site folder + sql dumb from old installation, works. couldn´t find time to test the upgrade
    1 point
  32. It would be nice. No I didn't, but also thought it should add that anyway for all, or maybe a checkbox to include all? I can't sort the columns. I think there's an option to enable it in the DataTable.
    1 point
  33. Hi Ryan, I replaced the Password.php file and tried to change the user password but I kept getting "Internal 500 Errors" every time I tried to run it through a template or via the API from command line. Anyway I found it easier to actually setup another site in MAMP whilst I was using PHP version 5.2, then copy the "$config->userAuthSalt" setting to my existing config.php and the values in the "field_pass" database table to the existing sites database from the temporary site I setup. This now allows me to login and create extra users. All working now, until I upgrade my server to php 5.4 which will be in the next couple weeks, I'll remember to keep the PHP version to 5.2 both in Dev and Production environments. Cheers Sambo.
    1 point
  34. Thanks Ryan! Just pushed those optimizations to GitHub. Regarding development of this module in general, to be honest I don't have a very good plan right now. Other than making minor improvements here and there, I've planned adding some basic features such as proper cleanup of old entries, option for saving actual content to files on disk and possibly a JavaScript-based diff feature etc. Anyway, if you have any ideas what should be included or to what direction this module could move in order to benefit more users, I'd be more than happy to hear your opinions. For an example I wasn't originally planning to support anything other than basic text fields, but support for images/files would definitely be nice addition at some point. Problem is that it would also add quite a bit of complexity to the module (perhaps that should be another module entirely?) and in the worst case enabling a feature like that could end up consuming a lot of disk space without user even realizing it. That's one idea I'd love to take further, but it will clearly require proper planning first..
    1 point
  35. If xml is simple enough it should work. If there are attributes etc it will fail. Maybe I should finish this. Thinking of making one version for json and another for xml. Or better yet, making these and csv importer working in harmony (sharing some bits of code like mapping etc).
    1 point
  36. Lots more dangerous too. Dragging around the fields in a template has no effect on the front-end of a site. It's a totally safe action. Dragging around your pages can break external and internal links, hurt your SEO, or even worse, break your entire site. Move and delete actions are intentionally not as obvious as they would be in an actual file manager. At least, I don't want my clients performing these actions unless they really really mean it. Web sites aren't file systems. In web sites, stuff really shouldn't get moved or deleted very often (it's bad for business). In a file system, these actions are very common. But in a web site, they should be avoided. Though I understand that as developers, everything we do is intentional and we'd like it to behave like a file system for our convenience. But ultimately the admin panel is balanced towards both the client and the developer. The client will be the primary user long term, so feel it's a careful balance. To be honest, I was reluctant to even have a "move" action in the Page List, as it's a lot safer and more intentional to move stuff around using the Settings > Parent field on each page's settings tab.
    1 point
  37. The list you mention will be very simple from the back-end, so the best starting point is probably to figure out what you want to start from, in terms of front-end framework. Do you want to start from an existing site profile, like the default or blog profile (or another), or do you want to build upon a CSS framework like HTML KickStart, Bootstrap, Foundation, etc. Or you could literally start from scratch, as many of us do. But of the goal is a profile or tutorial, I think it might be better to start from some kind of framework or profile.
    1 point
  38. echo $pages->get("myrepeater.field2=bar")->myrepeater->get("field2=bar")->field1; we should make a compilation of soma's one-liners to rival with this https://www.youtube.com/watch?v=GeeyWvo1rNg
    1 point
  39. $page->numChildren is a whole lot faster and more efficient than $page->children->count(). In a case like this, I would stick with numChildren. It's okay if it's occasionally wrong with published or otherwise non-accessible page inclusions. Also $page->children->count() is one of those things you really can't use at the large scale, because it has to load all those pages. If you just need to check if a page has accessible children (regardless of amount), you can do: $hasChildren = $page->child->id > 0; To count all visible children: $numChildren = $pages->count("parent=$page"); I'll add a $page->numChildrenVisible property in the next commit.
    1 point
  40. Antti here it is if you want to give it a try. Replace these files with those attached: /wire/modules/Fieldtype/FieldtypeFile.module /wire/core/Pagefile.php Test it out on a non-production setup first, as it does make schema modifications. But once installed, it adds 'modified' and 'created' fields to all file/image fields, and these can be queried in selectors as well. They initially start out at the current date/time. If you modify a file/image description or sort, that updates the 'modified' property. The 'created' property stays the same. Let me know how this works for you? If all is good, I'll commit it to the dev branch. FieldtypeFile.module Pagefile.php
    1 point
  41. Than you should use soma's solution if(!$users->get($username)){ // go ahead, add the guy } edit: but it's good that you learned the array stuff
    1 point
  42. Aren't the words the purpose? … The reason for having it in another language?
    1 point
  43. Once the International Organization for Standardization have a 639 classification for WillyC's lingo, we can give him his own sub-forum too.
    1 point
  44. We're planning to have JSON export/import for fields. Templates are a little different in that they have a file on the disk too. But we can still make the data structures templates portable in the same way as fields.
    1 point
  45. Thanks Clinton! That looks like a promising start. Please do keep us up to date. I know Ryan has kicked out a form builder module (and its sweet!), but he has stuck a price tag on it. I realize that he has spent a lot of time on it, but I would prefer if PW was just users helping one another out and not trying to turn a profit. So thanks for taking a stab at this!!
    1 point
  46. Good question. You can use the built-in append() and/or prepend() functions, i.e. $menu_items->prepend($home); I believe the unshift syntax will also work: $menu_items->unshift($home); You don't have to worry about modifying the site tree because you would have to actually save a $page in order to modify the site tree. In addition, none of what you are trying to do here is modifying any pages, so even if you did save a page, it wouldn't modify anything. PageArrays are runtime dynamic arrays, and aren't saved anywhere unless they are attached to something like the result of a Page reference Fieldtype. See /wire/core/Array.php and /wire/core/PageArray.php for all the traversal and modification methods (there are a lot). For the most part, they are patterned after jQuery traversal methods, but I included alternate names like unshift() and shift() for people that prefer PHP function names. Just for fun, here's your example all bundled on one line. foreach($pages->find("parent=/navigation/")->prepend($pages->get('/')) as $item) { ... Or even shorter: foreach($pages->find("parent=0|/navigation/") as $item) { ... The selector above is saying to find all pages that have no parent (i.e. "0") or have a parent called /navigation/. Both examples above return the same result. That won't work because the function only accepts one param (a selector). But because all the pages you are selecting there have the same parent, this would work: $pages->find("parent=/, name=navigation|page|item2");
    1 point
×
×
  • Create New...