Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 02/22/2014 in all areas

  1. 16 points
    Hey guys, first, ProcessWire is a great piece of software. Thanks for that and the great community behind that. So, i'm realy new to ProcessWire, but i will present you my first module for SEO- and performance optimizing: AIOM+ (All In One Minify). AIOM+ (All In One Minify) for CSS, LESS, JS and HTML AIOM+ (All In One Minify) is a module to easily improve the performance of your website. By a simple function call Stylesheets, LESS and Javascript files can be parsed, minimized and combined into one single file. This reduces the server requests, loading time and minimizes the traffic. In addition, the generated HTML source code can be minimized and all generated files can be loaded over a cookieless domain (domain sharding). Install AIOM+ Download current release (link below) Extract and copy the files for this module to /site/modules/AllInOneMinify/ Login to PW backend and go to Modules > Check for new modules Install Module > AIOM+ (All In One Minify) for CSS, LESS, JS and HTML Alternative in ProcessWire 2.4 Login to PW backend and go to Modules Click tab "new" and enter Module Class Name: "AllInOneMinify" Click "Download and Install" Features Combining stylesheets / LESS files or JavaScripts Minimize the combined files No change to the .htaccess necessary (except for the domain sharding) Server-side LESS parsing without plugins HTML source code minimization Cookieless domain / domain sharding Automatic cache management (With changes to the source file, the cache is rebuilt) Configurable via the backend Automatic rewriting the paths in the stylesheet and LESS files. No changes are needed Optional developer mode (combining, but no minimize and browser cache prevention) Clear the cache on the backend Conditional loading for CSS, LESS and JS (since Version 3.1.1) How to use Minimize multiple stylesheet or LESS files into one file. You can even mix stylesheet and LESS files in parsing and combining process! <link rel="stylesheet" href="<?php echo AIOM::CSS(array('css/file-1.css', 'css/file-2.less', 'css/file-3.css', 'css/file-4.less')); ?>"> Minimize multiple javascript files into one file. <script src="<?php echo AIOM::JS(array('js/file-1.js', 'js/file-2.js', 'js/file-3.js', 'js/file-4.js')); ?>"></script> Conditional loading (same with Javascripts) <?php $stylesheets = array('css/reset.css', 'css/main.less', array('loadOn' => 'id|template=1002|1004|sitemap', // PW API selector 'files' => array('css/special.css', 'css/special-theme.less'))); ?> <link rel="stylesheet" type="text/css" href="<?php echo AIOM::CSS($stylesheets); ?>" /> More Information, Documentation and Download AIOM+ in ProcessWire repository AIOM+ on GitHub So, I hope you can do something with this module. Dave
  2. 12 points
    http://www.designsatu.com Satu Jaakkola-Chiari is a Finnish fashion designer. She has two decades of experience with high-end fashion design in Italy. This is a small promotional website for her latest collection.
  3. 9 points
    This website is a recent conversion from a Joomla version built over 2 years ago: https://www.olddominionmc.com My client, Old Dominion Medical Center (ODMC), simply loved the ProcessWire-based colors when I showed them the original "FoundWire" demonstration prototype. This website is a modified version of the original FoundWire Demo Profile that is now using the straight CSS version of Foundation 5. It's my personal preference until I can find the time to install Ruby and LESS/Sass tools on my new development desktop. For this project, our primary objective has always been to have a simple customer-facing website that presents their patients with vital information about the practice. Our secondary objective is to continue to use the website as an information portal for their back office day-to-day operations. Some of the first ProcessWire applications I built (over a year ago) were in direct support of ODMC. I continue to expand their Intranet to incorporate many administrative and support functions not covered by their EMR/EHR system. The following are the critical ProcessWire modules that make this website, especially the Intranet shine: Form Builder Pro Cache Modules Manager Images Manager (which, to me, is the greatest of Soma's many useful modules) Hanna Code Page Edit Field Permission Changelog Custom Upload Names Login History Redirects Template Editor Import Pages From CSV JQuery DataTables Plugin AIOM+ (All In One Minify) I have special thanks for Joss Sanglier (for his fantastic FoundWire Demo Profile) and Ryan Cramer (for his Foundation 4 Profile which got me very interested in Zurb Foundation). There are many others out there to thank (mainly the developers of the above listed modules) that have made my transition to ProcessWire most enjoyable. I'm still learning.
  4. 5 points
    My first process-wire site for a client! Been working on it this week, will add a blog. It was my first 2.4 project. I'm loving 2.4. I put a font awesome icon on everything in the backend! makes me feel good to have icons for some reason. I am hoping I can just save this site as a "template" and use it for future projects as a base. + this was my first zerb site. http://www.principlededu.com/ I started this project as a wordpress project using Avada theme. a theme that got like 20,000 downloads or something crazy. It looked ultra flexible. But when it came time for client to edit, and they saw all the short-codes, they said forget it! (this is an example of an "easy page": the home page had more shortcodes then content) So I decided to give PW a try. It made for a much cleaner solution. (screen shot of home page) the page got more complex, and the client is editing happily. Anyway that is my success story, still working on the the project now, and open to any feedback and tips.
  5. 4 points
    New Processwire Website. Built with HTML KickStart. http://www.carscallen.com Feedback welcome.
  6. 3 points
    Technology evolves and you just have to evolve when things change. The basics I learned in the 80's are still applicable today. Each new technology builds on, circumvents or basically changes what was hot yesterday. If you are serious about learning you will keep up and prosper. Don't look at new ways of doing things as a challenge, look at it as an opportunity. Don't be scared or hostile to reinventing yourself. Good Luck in your endeavours.
  7. 2 points
    Hey, Mr Stevens, glad to see Foundwire helped someone. Rather than go to the trouble of installing Ruby and the rest, either go grab Scout or PrePros Scout is free and PrePros has a free and paid version. PrePros has the advantage that it will handle less and sass as well as minify JS, HTML and the rest. Nice clean site, btw
  8. 2 points
    Networking via LinkedIn, through a contact I hadn't heard from in years. They contacted me and I originally helped them with some Windows PC support. I then redesigned all of their forms. Then I helped them get out of a couple of bad costly support contracts. I next created a custom IVR solution for them which replaced a support contract that was costing them $800 a month. New projects continue to this day.
  9. 2 points
    Hi Helmut, you may create a new template with its own template file. Create a blank textfile and call it myform.php, copy it into the site/templates/ folder of pw. Go into the pw admin and under setup templates and create a new template. There should be a list with template filenames from your site/templates/ folder (without the .php extension). Check the one you have newly created and save it. Now create a new page under homepage and assign your form-template to it. Lets say the url of it is "/contactform/". Go to your Editor and write into your template file some code like that: <?php if($input->post->aFormFieldName) { // a user has send the form, proceed the data and display a thank you message ... echo "<h4>Thank you for contacting us. We will get back to you soon."; return; // stop with template code here } // if we have no post data, lets display a html form $myForm1 = " <form action='{$page->url}' method='post'> // your inputfields and buttons here </form> "; echo $myForm1; Now go to the browser and call: example.com/contactform/ and try it out. If you use a profile with header.inc and footer.inc, add it to the template file like it is within the other template files: <?php include("./head.inc"); if($input->post->aFormFieldName) { // a user has send the form, proceed the data and display a thank you message ... echo "<h4>Thank you for contacting us. We will get back to you soon."; include("./foot.inc"); // load the footer here, because we stop template execution in the next line! return; // stop with template code here } // if we have no post data, lets display a html form $myForm1 = " <form action='{$page->url}' method='post'> // your inputfields and buttons here </form> "; echo $myForm1; include("./foot.inc"); Have fun!
  10. 2 points
    Hello horst and thank you for your feedback! Animation is done with CSS transitions by animating opacity and scale. I wrote a simple jQuery plugin to handle animate-in and animate-out classes. Plugin is similar to Sequence.js.
  11. 2 points
    Greetings Fokke, Thanks for posting this! Great work. Viewing (at the moment) on iPad Safari, and the whole experience of the site is terriric. The large images work well to give an immersive feel to the whole site. Nice design for the slideshows of the "Collection" items. Just a couple of very small comments: the text on individual "Collection" items has odd line breaks (see screen shot below). The slideshow is just a bit slow. Excellent work. The client should be appreciative of how well you present their works! Thanks, Matthew
  12. 2 points
    also worth a look: http://processwire.com/talk/topic/3812-htaccess/?p=37295
  13. 1 point
    Hi all, we lauched this big website for a festival last week, and pout a lot of work and love into this. Check out: boomfestival.org Hope you like it! and it has been received very well so far.. ( 60 000 visits in less then 1 week) It uses processwire as CMS , and I must say awesome decision to replace Wordpress we used the last editions, processwire is highly superior to wordpress as CMS . I even managed to import a lot of content from Wordpress with the Processwire bootstrap API and JSON and the help of this forum Content is loaded all with Ajax , and still backbutton does work and everything can be deeplinked . Ryan ProCache module has helped very much with Site speed and our high traffic server load If I find the time I might do a case study here...as this ajax approach moight be interesting for other developers
  14. 1 point
    What's the best way to adjust the title tag display? For just about every client I have using PW, the page title they're editing is much more relevant to see in the tab title than their site's domain since it's the only site they'd ever be editing.
  15. 1 point
    thanks, I noticed that right away and was trying to figure out how to do that.... thanks, just changed it! Another feature that I thought would be cool would be to minimize repeaters be default. This might already be a feature but I could not find it. Example:
  16. 1 point
    An HTTP hosts whitelist is important from a security aspect because http_host comes from the request rather than from the server... Meaning it can be forged. Maybe not a big deal since we always sanitize it, until you are dealing with cache, which the opens up the possibility of cache poisoning for any page that makes use of the http host. Imagine a hacker priming your cache with their own URL. Unfortunately, PHP's safe server_name variable is not reliable enough to reflect the potential diversity of http host names. So the only safe thing to do is to have a whitelist. If you aren't using the whitelist, I recommend adding it to your config.php. It's actually a little unusual for the http host to be used in PW because usually you'd just use the url() methods, which just output paths and not hosts. There's really no reason to use httpUrl() in most cases. So if you are using it, double check that you need to - it's extra unnecessary bytes unless you need to switch hostnames or schema. But with the next version of ProCache supporting multi-hosts, having an http host whitelist is now absolutely necessary.
  17. 1 point
  18. 1 point
    Definitely, but also check out the h5bp .htaccess There are some of the same rules but also some other nice stuff.
  19. 1 point
    Thanks for sharing this. It motivates me that I can move in a similar direction with the contacts I have. Computer service what I do for many years is slowing down on me by the year because of increasing tablets and smart phones.
  20. 1 point
    Hi Charles, the site is looking great. At first I like the colors, don't really know why! (just kidding) The screen of the information portal is suuuuper. While one can only guess what is behind it, it is not much imagination required to come to the conclusion that certainly it makes fun to work with it. Impressive work.
  21. 1 point
    Nice site. One comment; the logo doesn't really scale nicely upon resizing the screen and on bigger resolutions some artifacts appear. For example when viewing on 1920x1080 Win7 Firefox 27.0.1, it's not really crisp, and some artifacts beneath some of the letters: Google Chrome and IE do a better job, but still not great.
  22. 1 point
    Reading your post, I'm a little impressed what you are all doing out there with processwire. How did you catch that project ?
  23. 1 point
    Thank you for the explanation and link to sequence-js. But I think sequence.js would be to much overhead for a little Ken-Burns effect. To write a own small script is a much better way
  24. 1 point
    Yes Apeisa's shop module works very well but you need some coding experience to make it output your needs.
  25. 1 point
    You added 'FieldtypePage' to the $fieldtypes array correct? What field type does the 'user' template have? Have you tried to connect a single page id?
  26. 1 point
  27. 1 point
    Actually i found the answer $num = count($Page->comments); "<p>Page has $num Comments</p>"
  28. 1 point
    Hmm - I think it would be much better, if no repeater template settings would be involved? If someone has time to check what it would require to support repeaters without access stuff, please send pr.
  29. 1 point
    Yes...repeaters, behind the scenes have their own templates You have to enable "show system templates" under : admin/setup/templates filters. Select radio button "Yes" to show system templates (you can disable this later). Then, under admin/setup/templates system, you will see your specific repeater template named "repeater_nameofyourrepeater" - you know what to do from here...
  30. 1 point
    Out of the box. No changes.
  31. 1 point
    Nice catch horst Can I go one simpler: $pids = array(1010, 1011, 1022); if(in_array($page->id, $pids)) { echo $pages->get("1114")->body"; } or even just: if(in_array($page->id, array(1010, 1011, 1022))) echo $pages->get("1114")->body";
  32. 1 point
    Find concerthouses first: $concerthouses = $pages->find("template=concerthouse, title~=$q"); Then find events that are held in any of those: $concerts = $pages->find("template=concert, event.concerthouse=$concerthouses"); Ah, sorry, missed the repeater part... updated above.
  33. 1 point
    I see you found your solution, but I will post mine anyway, maybe it will be of some help too <?php $today = strtotime('today midnight'); //or if you want to show only events in future //$today = date(); $schedule = $page->schedule->find("schedule_date>$today"); //then put $schedule in your loop Also you can request one item like this: <?php $schedule_item = $pages->get(1007)->schedule->get("schedule_date>=$today"); //maybe you'll want to sort them if they are not in the right order, then add sort=schedule_date to your selector
  34. 1 point
    Have you read the pages on repeaters, especially the section on: "Finding pages by repeater value (using selectors)" You should be able to figure it out from there using a selector that finds items with schedule_date > time() Let us know if that gets you on your way, or if you need more specific help.
  35. 1 point
    I am sure I am missing something about what you want to do, but this works for me: $target_page = $pages->get(xxxx); $target_page->files->add("full url to file"); $target_page->of(false); $target_page->save(); I haven't looked to see what PW is using in the background (maybe file_get_content with a fallback to cURL), but there might be an issue with file_get_contents if you have allow_url_fopen off in your server config.
  36. 1 point
    Second (looks like last) release candidate of stable Czech Language Pack for ProcessWire 2.4 is finished. Czech Language Pack Current version: 1.0rc2 (99 files) + README.txt Changelog: Some minor fixes. Added few missing strings Czech Language Pack for external modules. Current version: 0.6 (28 files) + README.txt Added: ProcessBatcher /site/modules/ProcessBatcher/ProcessBatcher.moduleTextformatterHannaCode /site/modules/TextformatterHannaCode/ProcessHannaCode.module /site/modules/TextformatterHannaCode/TextformatterHannaCode.module Updated: ProcessPageDelete ModulesManager InputfieldCKEditor ShoppingCart FormBuilder Contains: FieldtypeCropImage InputfieldCKEditor ProcessBatcher ShoppingCart TextformatterVideoEmbed FormBuilder ModulesManager ProcessPageDelete TextformatterHannaCode pw_czech_1rc2.zip pw_czech_modules_06.zip
  37. 1 point
    I terms of development and usage standpoint ProcessWire is much better suited for the task then Joomla, Wordpress and even Drupal. But you have to be ready to invest your time in learning some concepts of PW. There are a few of them: page, pageArray, selector, template, template file, field, and module. If you feell comfortable with OOP PHP, CSS and HTML, you will definetely succeed. Of course it will requre some custom coding as with any more or less complex project. I'll try to make some assessment here in terms of efforts required if you have the skills mentioned above: listing and search of properties for rent and sale - easy blog layout display and detail display - very easy gallery for each property - very easy google maps display of location - easy with existing module (some work is required if you need more complex integration) google maps search - (not quite sure what you mean here) I guess it depends on what parameters you want to search, should require some coding user registration - user access control is coming out of-the-box, you just need to customise it for your needs and make registration and login forms for your front end. add to favorites function- easy send to friend - easy social share - some coding requred - I think there are open source social sharing projects you could integrate for this (like this one) and so on - it depends, but I think the rest is super-easy front and back end editing - back-end editing is already here. But front-end editing is what you will have to code yourself. So I suppose could require fair amount of work. restricted access to some sensitive informations (like landlords contact details, clients info and so on) - it depends on the logic of your site, I guess you will have to code some parts. adding property informations with some already defined values in dynamic fields (street names for instance) - from easy to medium, but more info would help. Jquery image upload (automatic resize, thumbnail creation, watermark add) - all is here (thanks @Apeisa and @smd) including watermarks (thanks to @Horst) I am sure you get the picture. Unless you have a strict deadline go with Processwire - it will worth the effort in any possible sense. If it's your first project with PW, it may be not the easiest journey, but an exciting one. In the end you will aquire some great skills and have many insights. And I'm sure, after you've arrived you will never look back . Whereas you arguably could start faster with Drupal (that I think the only competitive CMS option here) dropping some plugins together, you then would almost inevitable struggle with your front-end markup and in general making all work the way you (and not Drupal) want. And again you have to be familiar with Drupal's internals to make those hacks. In PW you develope naturally extending existing functionality and it doesn't make any assumptions about your workflow and markup. So it gives you more rewarding experience during the development process. Almost all the skills you get using PW is transferable to other webdev areas. From the UX point of view PW's interface is a dream coming true (and Drupal is a nightmare IMHO). If you haven't seen PW 2.4 yet, just go and have a look - it's beautiful!
  38. 1 point
    As the others have said, the point with ProcessWire is that you end up with exactly the interface and exactly the tools that your client needs, because you build them for them. The result fits their brand and their need, you are not trying to force them into a compromise. There are a few of us who have come the Joomla route (and would never go back) and we have all been amazed at how quickly we were able to pick PW up and make something solid with it - even people like me with little programming knowledge. And of course, any tools you develop as you go, you can keep and reuse on another project!
  39. 1 point
    Everything you've mentioned is possible with ProcessWire. If there aren't any complete solutions avaible for Wordpress or Joomla then ProcessWire might be your best choice to build it by yourself. But remember that the great flexiblity comes from building your own "logic" and template rather than using 10 different modules from 10 developers. It takes more time but the result is customized for your problem then. Search and list the properties pages. No problem. Example pseudo-code $pages->find('template=house,sale=1"); Another view option for a list of properties. The detail page could be the template of the property. The gallery can be a field with multiple Images or a extra page linked to the property. There is a GoogleMapsMarker Fieldtype. Works fine with some JS libraries for front-end integration. Not sure about this one. Now we come to the weaker spot of ProcessWire. It's no problem to build a simple signup form and make basic user management. But depending on your requirements you will have to put a lot of effort into this topic. Fine if you only need it for a single user/session Just HTML/JS magic. No problem and nothing special to ProcessWire ... The backend might be your problem. Backend Editing is no problem. But building a Front-End live editor thing is a huge project. Whole teams are spending weeks developing such functionality for other plattforms. Here you can look into the Module directory. This is possible with PW Not sure. You would define a source for this pre-populated data. Maybe a combination of a simple module and Page-reference field? Image resizing is no problem, neither is the thumbnail creation one. You can add a watermark with Horsts PIM module. Overall this is a complex project. Especially the front-end editing and the user thing can take some time. A basic system where you can have properties listed with details is easy and should be your first step. If you can invest the time you will get an awesome and flexible site. Split the project into smaller milestones would be my last suggestion.
  40. 1 point
    Thanks Horst for the honest feedback. You're right, I didn't handle this situation and our conversation the right way. Yes, we keep the IPTC information. But please keep in mind, that we do some sort of compression that's not completely lossless. That's right and its already on the list for the next update. Like normal image variations in ProcessWire, the first time you load the page takes longer. The person uploading the images needs to open the page once. That's not perfect but was the fastest working method. See below. We only have one live site and some sites in developement. That's a problem, I know. Same thing as 4. Or should I be quoting myself? _ We sat down today and based on your feedback wrote down some features for the next module version. They should increase performance, make it more configurable and the integration will be easier. We also thought about developers like Horst that have thousands of images. Alternative hook after the image upload (based on selected fields). No need to call the mz() method or changing templates. Option to overwrite original files or to keep a variation. A pseudo "async" upload method. Images will be sent to our servers and then the site will render without the minimized images. If you open the site again, your PW will check if the minimized images are ready for download and replace/create the minimized files. No need to wait for our servers but results may take another page load before they appear. We don't want to open a "pipe" (e.g POST /receiveimages/) to write them back to the file system once compressed. Fallback to PW compressed images. On the server side we will then build a complete queue system for better scaling across multplie server instances. It also allows use to use the slower but better options of PNGQuant or JPEGOptim. The goal is to release this in the last february/first march week.
  41. 1 point
    Hi Radek, the Czech language pack isn't working just like the German one. Thanks for pointing to the environment, I will have a look at my setup. EDIT: I found the problem. It's the Windows environment and it's backslash pathes. PW uses the DIRECTORY_SEPARATOR constant in its php code that is a backslash character under Windows. Basically this is correct. But php isn't quite consistent in that matter. The translation function gets pathes with normal slashes although the code uses backslashes because of the DIRECTORY_SEPARATOR constant. The only function that seems to cause that problem is in "wire/modules/LanguageSupport/Languagetranslator.php": protected function textdomainString($textdomain) { if(is_string($textdomain) && strpos($textdomain, DIRECTORY_SEPARATOR) !== false) $textdomain = $this->filenameToTextdomain($textdomain); else if(is_object($textdomain)) $textdomain = $this->objectToTextdomain($textdomain); else $textdomain = strtolower($textdomain); // just in case there is an extension on it, remove it if(strpos($textdomain, '.')) $textdomain = basename($textdomain, '.json'); return $textdomain; } If you replace DIRECTORY_SEPARATOR with a simple '/', it works. (EDIT3: That change isn't enough, look at the posts below.) I don't know if there is a clean solution or if one should write it off as a Windows php quirk. A quick and dirty fix would be to check for a backslash and a normal slash as directory separator. EDIT2: In the subroutine "filenameToTextdomain" I found an existing directory separator fix: if(DIRECTORY_SEPARATOR != '/') $filename = str_replace(DIRECTORY_SEPARATOR, '/', $filename); But for the problem explained above it comes one subroutine to late. I think it's now on Ryan to decide where and how to fix that check for the DIRECTORY_SEPARATOR in the "textdomainString" function.
  42. 1 point
    To build on top of Ryan's response, redirecting is not just sensible to do on login, but whenever you have forms. The wikipedia page on the Post/Redirect/Get pattern explains it much better than what I can - it's definitely worth the read
  43. 1 point
    <qoute>experience with running $pages->find("selector") api call on over 10,000 pages?</quote> I Don't think you will have any noticeable slowness with that amount of pages to be searched. You can't compare getResources with the ProcessWire way of finding pages. So far I understand Modx loads all the fields with getResources & the custom fields if needed in your results. ProcessWire wil only load the fields when you access them, so there's no field load with a page find. Result, searching 100.000 pages is not a problem. Searching 10.000 pages, just a blink of an eye.
  44. 1 point
    Do you want to find something in a set of 10.000 pages or do you mean a find result of 10.000 items? Searching in 10.000 pages isn't a problem, PW is really fast. But if there are a lot of possible results it's generally advised to limit the pages->find call to 25, 50 or another sane value. http://processwire.com/api/selectors/#limit . If you want you can combine this with pagination. The reason for this (others can prolly explain better) is that the pages->find call will return a PageArray that gets put in memory and if there are a lot of pages in the array things will inevitably slow down. Of course, depending on the situation, 'slow' in PW terms may still be acceptable. I have grabbed hundreds or even thousands of pages in one go and it still performed pretty well.
  45. 1 point
    That is a simple light box functionality or modal window that takes content rather than just an image. There are loads of jquery plugins out there that do it - search for "jquery modal" Here is a very basic one I have just found - haven't tested it! http://leanmodal.finelysliced.com.au/ One note: you need to double check what JQuery you are using - For instance Foundation 5 uses JQuery 2, but not all plugins are working with that.
  46. 1 point
    @Sinmok, From your example you are trying to add a tooltip. I don't know what front-end framework you are working with on your website, however with Zurb Foundation 4 you can do a tooltip using Hanna Code as follows: Your Type would be Text/HTML. Then you just add the Hanna Code in a field that supports Hanna Code. This may not answer your specific request for having Hanna Code within Hanna Code, but it does show how a tooltip can be added using Hanna Code. Good Day.
  47. 1 point
    I think you should probably take a look at the concept behind ProcessWire first, then some of the other docs and the cheatsheet as Macrura suggest - start with the Concept page from here: http://processwire.com/api/ The Cheatsheet then gives you a look at most the possible functionality at your disposal in page templates to access your data and files. As for explaining the line of code you quoted: $skyscrapers = $page->skyscrapers->find("limit=3, sort=random"); From memory, "skyscrapers" is actually a "featured skyscrapers" field, so is just a Page field that links to other pages (probably the most useful fieldtype there is. Here is the exact translation: "For the current page (homepage in this instance), find 3 random pages from the skyscrapers field". The $skyscrapers = bit is just storing the results in a PageArray (it's in the docs linked further up my post here) that can then easily be iterated through to print whatever output you desire. If you're wondering why the demo doesn't seem to pick three random pages, I think page caching must have been accidentally left on here so it's always showing the same 3 in the demo, but that's easy to switch off The syntax is based on jQuery and aims to be human-readable. If you imagine that there are a few database tables and queries behind that code, you can easily see how quick that is to write and all without a line of SQL. You can make all sorts of queries like: $architectsCalledPaul = $pages->find("template=architect, title*=Paul"); // finds all architects (pages with the template "architect" with the name Paul somewhere in the title field // and so on... The idea behind ProcessWire is that once you've learned the basics you can build pretty complicated data structures in the admin quicker than you'd be able to writing database tables from scratch and you have a hugely powerful set of functions at your fingertips to do with that data as you please. Most folks here would agree that it has shaved hours/days/weeks/months off their site build times depending on website scale, but any time saved is good!
  48. 1 point
    If you don't need the page to be saved when the button is clicked, then I think the route you are taking is fine. If you did need the page to be saved, then you'd want your button to be a submit button, and a second (save) hook to be called after the ProcessPageEdit::processInput and to silently do its thing (no redirect). Another route you could take is to setup a separate page with a template that does what you want, and then have your button link to that instead. But the way you've done it is already more compartmentalized (less parts to consider) so I wouldn't change it unless it creates issues with other modules hooking into ProcessPageEdit at some point down the road (which is possible). One issue you probably want to fix here though is the potential for XSS: $href = $this->config->urls->admin.'page/edit/?id='.$this->input->get->id.'&e=1'; Taking a variable directly from $_GET or $input->get and putting it in output (unsanitized) is always dangerous. You'd want to do this: $id = (int) $this->input->get->id; $href = $this->config->urls->admin."page/edit/?id=$id&e=1"; or better, yet this: $id = (int) $event->object->getPage()->id; $href = $this->config->urls->admin."page/edit/?id=$id&e=1";
  49. 1 point
    Thanks Ryan, I ended up hooking into ProcessPageEdit::buildForm: $this->addHook('ProcessPageEdit::buildForm', $this, 'addButton'); public function addButton(HookEvent $event) { $href = $this->config->urls->admin.'page/edit/?id='.$this->input->get->id.'&e=1'; $field = $this->modules->get('InputfieldButton'); $field->attr('id+name', 'email_customer'); $field->attr('class', $field->class); $field->attr('value', 'Email Booking To Customer'); $field->attr('href',$href); $event->return = $event->return->append($field); } I then just check for $_GET['e'], and undertake the workflow needed, and redirect back to the original edit page. A bit of a circus, but gets the job done. Is there a better way to utilize hooks for custom workflows like this?
  50. 1 point
    what.i use this is good it does.work top {not buttock}, of htaccess u will.put it . enjoy <IfModule mod_expires.c> ExpiresActive On ExpiresDefault "access plus 1 seconds" ExpiresByType image/x-icon "access plus 1 year" ExpiresByType image/jpeg "access plus 1 year" ExpiresByType image/png "access plus 1 year" ExpiresByType image/gif "access plus 1 year" ExpiresByType text/css "access plus 1 month" ExpiresByType text/javascript "access plus 1 month" ExpiresByType application/octet-stream "access plus 1 month" ExpiresByType application/x-javascript "access plus 1 month" </IfModule> <IfModule mod_headers.c> <FilesMatch "\\.(ico|jpe?g|png|gif|swf|woff)$"> Header set Cache-Control "max-age=31536000, public" </FilesMatch> <FilesMatch "\\.(css)$"> Header set Cache-Control "max-age=2692000, public" </FilesMatch> <FilesMatch "\\.(js)$"> Header set Cache-Control "max-age=2692000, private" </FilesMatch> <FilesMatch "\.(js|css|xml|gz)$"> Header append Vary: Accept-Encoding </FilesMatch> Header unset ETag Header append Cache-Control "public" </IfModule> <IfModule mod_deflate.c> AddOutputFilter DEFLATE js css AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml BrowserMatch ^Mozilla/4 gzip-only-text/html BrowserMatch ^Mozilla/4\.0[678] no-gzip BrowserMatch \bMSIE !no-gzip !gzip-only-text/html </IfModule>
×
×
  • Create New...