Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/11/2013 in all areas

  1. Solved Never mind. I am a total idiot somehow. I swear I looked and looked and looked. Somehow I had reversed the two options and set debug to false and demo to true... Feel like a total putz. Let the razzing begin. I deserve a round of laughter and finger pointing.
    4 points
  2. EDGE is a responsive site designed by Salvato + Coe Group and developed by myself: http://edgela.com/
    3 points
  3. Something like this? https://github.com/somatonic/PageReferenceLink I have started this module long ago but didn't come to finish it and just pushed to github. If someone likes to help out as I'm busy with other projects this could be taken and improved with settings and what not. Or Maybe it is of use for Fredi.
    3 points
  4. Looks interesting Ryan, you got me curious. Outside I love a strong and foamy espresso, but at home use one of these: Back to the music. This is what I'm listening to http://grooveshark.com/album/Little+Dragon/1417265
    3 points
  5. My opinion is that a good default behavior is to retain the original filename as much as possible. Otherwise you lose relation to the original file on your computer. Usually when a CMS auto-generates filenames, it's because they don't have another means of relating back to the source (Page/id), are using it to define a sort order, or they don't want to go to the effort of making sure the filename is secure (auto-generated names have no user input). Auto-generated names are the quick and dirty way out for a CMS. Never realized they would actually be desirable. If you have a preference for it to auto-generate names like that, it could certainly be done though. One way to accomplish it would be to make a module that hooks before Pagefile::install and rename the file, and send the new filename to the function. That function receives a single argument of just the filename to add. That filename can be local or http, so you'd only want to attempt a rename if local. public function init() { $this->addHook('Pagefile::install', $this, 'hookPagefileInstall'); } public function hookPagefileInstall(HookEvent $event) { $filename = $event->arguments(0); if(strpos($filename, '://')) return; // don't attempt to rename http-based files $page = $event->object->page; // page that will own the file $info = pathinfo($filename); // PHP's pathinfo() function $n = 0; // find the next available filename do { $n++; $newFilename = "$info[dirname]/{$page->name}-$n.$info[extension]"; // my-page-name-1.jpg } while(is_file($filename)); rename($filename, $newFilename); $event->setArgument(0, $newFilename); // update the argument to the install function } The above was written in the browser and not tested, so may need adjustments before functional. What it does is rename the file before it gets added. The do loop may not actually be necessary here, but that is just to account for the possibility that the directory (PHP's upload dir) already has a file with the target name in it. ProcessWire already takes care of adding numbers to files that are placed in it's own assets/files/ dirs.
    3 points
  6. Just updated Captain Hook to 0.2 with latest dev version (+14 new entries) Enjoy
    3 points
  7. A past client of mine which I did a wordpress site for a couple years back is now having issues with their site layout. It's been forever since I dived into wordpress and after playing with PW for a little over a couple months, I really don't even want to attempt trying to fix the wordpress issue. In fact, I thought I eliminated every possible way an issue could come up for them :/ Anyway, I think to myself, "I can convert this entire wordpress site over to PW in a day or two and actually save myself a headache from the wordpress template forest!! Food for thought, even though I tried to make it as user friendly as possible and wrote a user guide, it seems they have never uploaded any photos, videos, or anything of the sort. It's a shame really, and I think it had a lot to do with how Wordpress is still unfriendly to some really non-technical clients. So, I am looking forward to blowing their minds when I show them the beauty of Processwire My rant...
    3 points
  8. Tell me about it. I've been so scared to upgrade plugins and wordpress itself due to the fear of something "breaking". And like you said, the learning experience is worth it alone. As long as PW stays on this track, I may never look back!
    3 points
  9. Hi Wanze, yes with the FPDI extension you can import other PDFs, but in different ways. What I mean with 'as Background' and what I'm find very useful is, for example: You can take a PDF with your e.g. Briefkopf , assuming you have a first page with all your stuff (Logo, adress, bankinfo, tax number, etc.) and a second page with less data (maybe a smaller version of your Logo and only name and phone number), and use it as background-layers: // example use of FPDI-Extension with FPDF. $tplfile = 'C:/fpdf/templates/mein_briefkopf.pdf'; $pagecount = $this->pdf->setSourceFile($tplfile); // defining the sourcefile returns Pagenumber of it for($i=1;$i<=$pagecount;$i++) { $this->fpdiTemplates['tpl_s'.$i] = $this->pdf->ImportPage($i); // import each page and assign it to a variable } $this->Parser_Opened = TRUE; $this->Use_Template = $this->fpdiTemplates['tpl_s1']; ... // write own stuff to the first page // switch the Template to the second page for all // following pages (optional) $this->Use_Template = $this->fpdiTemplates['tpl_s2']; ... // create more pages With the use of FPDI-Templates you can add graphical stuff to your pdf-pages with less effort. On my website one can add images to a virtual lightbox and can download them as a PDF. There are three template pages: one for the image pages, one with my contact-data and copyright notice! and optional one for user notes. ..., und viele Grüße in die Schweiz
    3 points
  10. What any newbie should do first is learn Drupal. After 2 years of: awful theming, i.e. $element['#object']->field_video_embed['und'][0]['value'] instead of $page->field_video_embed searching through 500 line arrays to find out what module is injecting a certain markup in your code writing huge css files to deal with the divs nested within divs nested within divs nested within divs figuring out how to add a meta tag to your <head> using an API and an array getting carpal tunnel syndrome from constantly clearing the cache because Drupal is such a hog, everything has to be cached learning the Views module, a point and click interface that is 3X more annoying and difficult than learning and using straight SQL find a good host that is beefy enough to deal with the Drupal and has advanced caching capability After that, PW will be a walk in the park.
    3 points
  11. Soma is the machine! (I am turning into a repeater here)
    2 points
  12. Hi horst, my suggestion: Template artist - title - other metadata from artist Template album - title - artist (Page field with template artist) - cover (image) Template song - title - tracknumber - album (Page field with template album) If a song/track doesn't have an album, you can leave the album page field empty. EDIT: Just noticed that when a song doesn't belong to an album, you cannot get the artist. So maybe adding the artist field also to song? Hmm... let me think again Possible solution here Another possible way is to organize over the page tree: - Artists (artists) --+ artist1 (artist) ----+ Albums (albums) ------+ album1 (album) ---------+ song1 (track) ---------+ song2 (track) ------+ album2 (album) ---------+ song1 (track) .... ----+ Songs (songs) ------+ song_that_does_not_belong_to_album (song) --+ artist2 (artist) .... Depends on the search queries. Organizing this way you don't need page reference fields. Searches are then over parents/childrens.
    2 points
  13. Ok, I made a very simple hack to the thumbnails module. Inside public function ___executeSave() within the ProcessCropImage.module I added the following lines just before the timestamp comment. if(!$page->$prefix) { $f = new Field(); $f->type = $this->modules->get("FieldtypeImage"); $f->name = $prefix; $f->label = ucwords(str_replace('_', ' ', $prefix)); $f->save(); $page->template->fields->add($prefix); $page->template->fields->save(); } $page->$prefix->deleteAll(); $page->$prefix->add($targetPath); $page->save($prefix); Firstly it checks for the presence of a field named the same as the crops name. So, if you set up your crop as: thumbnail,100,100 then it will look for a field name 'thumbnail'. If it's not found, it creates it and adds it to the current page's template. I would like to be able to set the field visibility and Maximum files allowed settings, but haven't figure that out yet. Then it takes the cropped image and adds it to that field. Only minor inconvenience is that the image won't appear in the thumbnails field until the user saves the page. Not sure if there is any way around that - I feel like there should be a way to hook into the ajax image uploader to refresh the field, but haven't investigated yet. Antti, is this something you'd consider adding (maybe as a configurable option), or do you think my need is too specific?
    2 points
  14. know this is kind of obvious, but the last time i did that i just ran a replacement on the content with the api.. <?php $ps = $pages->find("template=basic-page"); foreach($ps as $p) { $p->setOutputFormatting(false); $new = str_replace('mysite/', '', $p->body); $p->body = $new; $p->save(); } ?>
    2 points
  15. Glad to hear this. We have so many here that are part of the MODX community too that it seems like a family, and I really want to see MODX do well.
    2 points
  16. Create a role called "top-level-editor" (or whatever you prefer). Give that role edit permission, but not delete permission. If you want the role to be able to sort children of these top level pages, then you'll want to assign page-sort permission to the role as well. Assign that role to the template used by your top level page(s). Create another role. We'll just call it "editor". Give that role edit, delete, move and sort permission. Assign that role to the templates indicated, but not the templates where you assigned top-level-editor. Don't forget to assign both of these roles "top-level-editor" and "editor" to your user(s) that you want to have this access. I think this was the part WillyC was trying to communicate.
    2 points
  17. I pushed update to github pages, but it's still not updated... give it some time...
    2 points
  18. I've been in the same predicament with EE and Txp - either with orphaned plugins that don't work on latest versions or server changes that rendered orphaned plugins useless. And because the sites were small enough I've converted them over just to save me (and the client) the hassle of going through an upgrade and also for the learning experience with PW. I haven't regretted doing this once. Cheers Marty
    2 points
  19. Hi pwired, I know this is a tough moment in life, a job is hard to find and clients have less money to spend than 3 or maybe 4 years ago. That's is true because of the bad economic period the world is facing but also because clients are starting to have more knowledge of the "internet world" (even if their jobs or attitudes aren't directly correlated to the web), and so they can percieve and then better - but not of course perfectly - rates a website and its development. What I want to say is that if you want to be competitive and make your clients accept an " fair price per site to surive and eat every day" ( ), you must let them trust you as a professional, with specific skills and be able to solve their needs. I've take a super quick look at the websites you've developed so far and I think you should consider to improve your front-end design skill. Let me explain before I get misunderstood, because there is absolutely no intention to be unpleasant here, really. From my experience in this industry clients tends to prefer a good looking website ( ...without touching the topic of " what is beautiful for everyone"..) rather then a website that is coded extremely well, with all the best-practices that everyone of us need and prefer to follow/achieve. Of course a website needs to fit clients needs and expectations, and be solid and scalable at most. So what about to find a good front-end designer whereby work side by side, where you do all the developing and focus on the back-end, with processwire? I'm telling you this just because, maybe, this could 1) lighten your back in front of the pc and focus more on the coding part and 2) put your future clients in the habit to be better disposed to evaluate an higher fee to pay you (even if you will share a percentage with your front-end designer). I hope I'm not behaving grumpy here, I repeat...not my intention. This is the preview of the site I'm making for the agency I work with (It's really simple and work in progress), just to help you to know how much I usually charge my job : http://www.test.sundaygroup.it/ ( I have my monthly salary so I didn't make a price for this, but probably I would have asked around 1.200 Eur or so. (I made it in a week with plain html+css+js, no php except for the contact form (no processwire there). Last link I suggest you to have a look : http://www.smashingmagazine.com/2011/09/28/youre-pricing-it-wrong-software-pricing-demystified/ Even if that article is focused on product-prices there are some insights that might be considered, IMHO. Good luck!
    2 points
  20. Pricing is very difficult to be honest and unless you are looking to create many of the same types of site (homepage, services page, gallery, contact page for example) you can't really set a price up-front. Even with those types of sites I've often found the client will ask for something unique that means any pricing I might have had at the beginning is automatically different as a result of the unique needs. With that in mind I don't list prices myself and prefer to quote based on at least an initial spec. An analogy would be a plasterer, plumber or electrician trying to have a pricelist for clients without the client first telling them what they need - other trades don't do it and I don't think our industry is much different in that respect. What you can do once if you are in the situation after a few websites that many of them are similar is work out a rough price and put the words "starting from" in front of that price once you're more confident about it, but even then I would worry about potential clients ignoring the "starting from" and focusing on the figure next to it At the end of the day, to most people browsing the internet a website is a website - they just don't know how a "simple" request can mean hours (or on occasion days) of coding or alterations which is, again, a reason why I don't list prices personally. A possible idea for yourself is to work out how much money you need to survive, then take a look on job websites at how much web developers are getting paid near to you and work it out based off those two figures. You should at least be able to work out from a job advert what an average hourly rate is for a developer working at a larger company, though by all means feel free to charge higher than this since you are essentially being designer, developer, salesman and managing director and saving on overheads - you may also find you work longer hours than a normal day job so your fees should take things like that into account if you're trying to give a client a total price for the job up front rather than an hourly fee. Long story short, there is no right answer with pricing, but the world will definitely need more, better websites for the foreseeable future
    2 points
  21. pewpewpewpew.pw A site for 1980's sci-fi laser sound clips
    2 points
  22. AdminSaveActions (Was: After Save Actions - guess why the rename?) Admin Save Actions adds the possibility to choose where the browser gets redirected after saving a page, template or field. Admin save actions are displayed just before the save button in a collapsed container. Chosen action can be saved in a cookie for current user by checking "Remember this setting". By leaving this option unchecked upon save, the chosen action will not become the default. Why? Some of you wanted something like this to exists in ProcessWire - and so did I. I've read discussions here, here, here and here carefully trying to cover at least most of the options discussed. I know this implementation wont satisfy all the needs, but I'm looking into adding some things afterwards to cover even more of them. I called the first version of this module PageEditRedirects but decided to to change the name in to a more descriptive one. So that module got deprecated as of now (and does not exists at GitHub anymore). This new version also does not require PW 2.3 but works just fine on PW 2.2 as well. Special thanks A module by Adam Kiss (ListAfterSave) implemented some of these actions a long time ago. Thanks to Adam for letting me use the ideas introduced by his module. There are actually some things there my module isn't going to cover even in future versions. Links AdminSaveActions can be found from the modules section. AdminSaveAction is downloadable from GitHub. (Edit: added link to the modules section. Edit 2: Implemented config option + version bump. Edit 3: Removed feature list - see GitHub.)
    1 point
  23. On mobile so short. Yes you have to remove or edit the fields name restriction check in the hook function for the multi select. Line 59 in module. It's hard coded and also other hooks i was experimenting are commented out. Back on laptop https://github.com/somatonic/PageReferenceLink/blob/master/PageReferenceLink.module#L59 ... screw it I just updated it and commented out the check so all InputfieldPageListSelectMultiple fields will have an edit link. This module is just experimental prototype but working and a start.
    1 point
  24. This thread and this wiki page might help with explaining render(); Hope this helps
    1 point
  25. @Horst - will you be implementing any functionality to read ID3 tags on those mp3 files?
    1 point
  26. http://modules.processwire.com/modules/form-save-reminder/ I often also forget to save before viewing. This module from soma, takes care of that problem.
    1 point
  27. hi kongondo, yes your suggestion make sense. first i thought the changes on the page title were enough (color, line-through). but maybe the toggle of the label is one step smarter . i updated the repos on github. i don't know whether the code changes are efficent than i am not a coder too . greetings...
    1 point
  28. @3fingers: The default .htaccess in PW blocks access to PHP files in certain locations: # Block access to any PHP-based files in /templates-admin/ RewriteCond %{REQUEST_URI} (^|/)(wire|site|site-[^/]+)/templates-admin($|/|/.*\.(php|html?|tpl|inc))$ [OR] # Block access to any PHP or markup files in /site/templates/ RewriteCond %{REQUEST_URI} (^|/)(site|site-[^/]+)/templates($|/|/.*\.(php|html?|tpl|inc))$ [OR] # Block access to any PHP files in /site/assets/ RewriteCond %{REQUEST_URI} (^|/)(site|site-[^/]+)/assets($|/|/.*\.php)$ [OR] # Block access to any PHP files in core or core module directories RewriteCond %{REQUEST_URI} (^|/)wire/(core|modules)/.*\.(php|inc|tpl|module)$ [OR] # Block access to any PHP files in /site/modules/ RewriteCond %{REQUEST_URI} (^|/)(site|site-[^/]+)/modules/.*\.(php|inc|tpl|module)$ [OR] I'm not sure what the situation was back in 2011, but at least currently you can access php files directly under site/ or in any custom directory (like site/process/). The rules in .htaccess are just to block direct access to files that are supposed to be run/accessed via PW. So if you want to put some standalone code (or a script bootstrapping PW of course) in site/ directory you can, as long as it's not inside directories used internally by PW itself.
    1 point
  29. What are you missing again? Paths prefixes? you mean like /de/... /en/... ? Those are set on the homepage name.
    1 point
  30. Regarding the location of $page->render(): it's implemented as a hook in a module. What else could it be, this is ProcessWire . See wire/modules/PageRender.module.
    1 point
  31. Yep, that is what I meant. Clicking "Edit" would open Fredi with editing and save.
    1 point
  32. Replace only wire folder and do clap your hands two times. Done.
    1 point
  33. I'm not sure, but could be that you have the last stable PW and this feature you looking for is only in last dev-branch: https://github.com/ryancramerdesign/ProcessWire/tree/dev EDIT: Ok, apeisa is to fast for me
    1 point
  34. @jmart - if there are not a lot of pages, don't nest the pages in the admin, but then make a custom menu. That's how it do it on 3 sites now. (in other words make all of the pages child of the root.) As far as making the custom menu, i do it the way discussed in this thread, and works perfectly. You have to adjust the code to your specific menu needs.. http://processwire.com/talk/topic/2787-custom-menu-not-related-to-page-tree/ i also wanted to mention that once you have a lot of pages in the admin, you could use Soma's datatable to look for pages, instead of the tree; then you could filter/sort by some criteria (title, template); so in this sense you would using PW as more of a bucket system... which for some projects is good, and PW handles it fine...
    1 point
  35. If you hook onto page->save(), it's no longer necessary to loop over pages->find(): public function sorttitles($event) { $page = $event->arguments[0]; // Only run if the page we just saved has the "item" template if ($page->template == 'item') { $new_title = (preg_match( "/^(the|a|an)\s/i", $page->title)) ? substr(strstr($page->title," "), 1) : $page->title; $page->sort_title = $new_title; $page->save('sort_title'); } } } } } -evan
    1 point
  36. nice diogo - +1 for little dragon how bout this: http://grooveshark.com/#!/artist/Holy+Ghost/566436
    1 point
  37. That's correct. When PW 2.4 is here, it won't matter, because PW will require PHP 5.3+ as well. But this could be a recurring issue with PHP 5.4, 5.5, etc. I recommend that any modules available on the modules directory be required to have the same PHP version requirements as the version of PW they are written for. An autoload module that requires PHP 5.3 when they only have PHP 5.2 could take down someone's site.
    1 point
  38. I had to go get some coffee after seeing that photo. Just got this thing yesterday called an Aeropress. The guy that invented the Aerobee (frisbee) apparently locked himself away on a multi-year caffeine binge and came up with this clever device that supposedly makes the best coffee in the world. The coffee beans were just roasted from a place a block away from here, tasty.
    1 point
  39. Makes sense to me. If you guys want to post a replacement function here, I'll plug it in (or pull request, whatever you prefer).
    1 point
  40. I'd strongly recommend reading the follow up by MODX Co-founder Ryan (T), posted last night: http://modx.com/blog/2013/04/10/putting-the-band-back-together/ SiphonLabs is not MODX, but it is the Cloud team being flushed away from MODX. And that has the side effect of liberating the MODX team to focus once again on what matters: building MODX. While I can fully understand that there's confusion and people wondering what on earth is going on, this change isn't new - it was put in motion in early January. In that time, Ryan (T) has been working incredibly hard to give MODX a fresh start and making things happen that need to happen.
    1 point
  41. Great idea's here. Would be nice to have the ability to add a watermark to an image. At the moment i'm using phpThumb class to achieve this.
    1 point
  42. Looks like FieldtypeDatetime currently ignores timezone issues? Seems like this needs to be addressed somehow, at some point - it's fine if your applications are used in one timezone exclusively, or if users are aware that all timestamps are in ET say, but it seems this is going to be inadequate for applications used even across multiple timezones in the US, which most US applications probably are. This problem is particularly serious if you're storing dates only - since, without timezone information, a single date actually spans a 48-hour period worldwide. You can't really convert dates if you don't have a time. I would strongly prefer to have all timestamps stored in UTC in the database - with the ability to auto-detect a default timezone for anonymous users, and selecting a timezone for registered users. Anything like that already in the pipeline?
    1 point
  43. I agree that we'll want a UTC-based date fieldtype at some point. Though this is the first that it's come up, so I think that most folks (including me) aren't using the Datetime field in situations where timezone matters. Most usage has to do with dates accompanying content that is specific to server time, in the same way that the built-in created/modified timestamps are. But as the use of PW increases for things involving authenticated users and storage of their data, I think there will be demand for something like this.
    1 point
  44. All good points teppo It's one of those canned functions I found somewhere a long time ago and haven't really thought too much about it. Its formatting could certainly be improved. Mostly I just wanted to get the point across that I think filesizeStr should do some rounding and unit changes when appropriate.
    1 point
  45. Never underestimate the importance of word separation. It's the difference in readability between "pen-is-broken" and "penisbroken". Beyond the potential misunderstandings is raw readability both to users and search engines. While I have a readability preference for underscores, my understanding is that hyphens are the best balance when all factors are taken into consideration. Lastly, this may be obvious, but what gets populated in that name box is only an auto-generated suggestion. After populating the title, one can go modify the name as they see fit (which I often do), before saving the page.
    1 point
  46. 1 point
  47. You can reuse fields between templates (so you don't need different body field for each of your templates), but using same field multiple times on same template is pretty confusing concept to be honest. It's like having twins and giving them same name.
    1 point
  48. Hey Ryan - thanks for replying to this. RIght... i think in most cases using the PW tree to generate the menu is best; But it does speak to the flexibility of PW that you can do something like this with relative ease when required...and in setting this up I learned from Soma's bootstrap menu markup how to generate complex nav markup without using a plugin.. I have heard it said somewhere that the navigation menu should be optimized for the user and not be constrained by the hidden structure of the site, especially for larger sites. In this case, it is a company where many of the products overlap in functionality, so there needs to be several routes for different users to arrive at certain pages. And they are not extremely organized yet about the content, so i'm sort of dumping all of the content into the tree in what seems like a logical structure, and then linking to things as necessary, with the custom menu. It's also helping to prevent confusion in some cases for links to external sites, where those would have been showing in the page tree if we did it that way. This site will also have a lot of advanced search and filter types of things, so the nav is kind of secondary to that route for finding pages... -marc
    1 point
  49. If you wanted all grandchildren, and nothing deeper, you could do this: $page->find("parent=$page->children"); If you wanted grandchildren and anything deeper, you could do this: $page->find("parent!=$page"); If you wanted children, grandchildren and anything deeper, you could do this: $page->find('');
    1 point
×
×
  • Create New...