Leaderboard
Popular Content
Showing content with the highest reputation on 09/30/2013 in all areas
-
I have just finished and uploaded new layout of the MSSOOnline website. http://mssoonline.org/ I used latest ProcessWire and HTMK Kickstart to develop this website for not-for-profit organization. This is another not-for-profit website I developed with ProcessWire CMS as volunteering work. I love ProcessWire so much that I keep creating website for free for charities!!! Please provide your feedback for improvement or to fix any issues.4 points
-
Add fields to the user template. In the templates, filter options, show system templates.3 points
-
A quick tutorial how to create file downloads using pages You will be able to create a new page using template "PDF" (or any you setup), upload a pdf file. You then can select this page using page fields, or links in Wysiwyg. The url will be to the page and NOT the file itself. This will allow to keep a readable permanent unique url (as you define it), unlike /site/assets/files/1239/download-1.pdf, and you'll be able to update/replace the uploaded file without worring about its filename. Further more the file will also have an id, the one of the page where it lives. Clicking those links will download or open the file (when target="_blank") like it would be a real file on server with a path like /downloads/project/yourfile.pdf. You'll be also able to use the "view" action directly in the page list tree to view the file. Further more you'll be able to esaily track downloads simply by adding a counter integer field to the template and increase it every time the page is viewed. Since the file is basicly a page. This all works very well and requires only minimal setup, no modules and best of it it works in the same way for multi-language fields: Just create the language alternative fields like "pdf, pdf_de, pdf_es" and it will work without modifying any code! Still with me? ok PW setup Download folder: Create a template "folder" or "download-folder" with only a title needed. Create pages in the root like /downloads/project/ using this template. Setup the template for the pdf files 1. Create a new template in PW. Name it pdf 2. Goto template -> URLs tab and set the URL end with slash to no. (So we can have /path/myfile.pdf as the URL) 3. Create a new custom file field, name it pdf. Set its maximal count to 1 under -> Details tab. 4. Add the pdf field created to the pdf template. Easy. 5. Create a new "pdf" page using the pdf template under a download folder you created earlier. 6. Give it the title and in the name field add ".pdf" to the end (could also leave as is) Template PHP file for the pdf files 1. Create the template file pdf.php in your /site/templates folder 2. add the following code: <?php // pdf.php if($page->pdf){ wireSendFile($page->pdf->filename); } Done. To see the options you have with PW's wireSendFile() you can also overwrite defaults <?php // pdf.php if($page->pdf){ $options = array( // boolean: halt program execution after file send 'exit' => true, // boolean|null: whether file should force download (null=let content-type header decide) 'forceDownload' => false, // string: filename you want the download to show on the user's computer, or blank to use existing. 'downloadFilename' => '', ); wireSendFile($page->pdf->filename, $options); } Simple and powerful isn't it? Try it out. Some thoughts advanced Create as many file types as you like. It might also be possible to use one "filedownload" template that isn't restricted to one field type but evaluate it when being output using $page->file->ext, or save the file extension to the page name after uploading using a hook. One last thing. You can add other meta fields or preview images to the template and use those to create lists or detail pages. It's all open to goodness. Again all without "coding" and third-party modules. Further more you can use the excellent TemplateDecorator to add icons per template and have a nice pdf icon for those pages. This as a base one could also easily create a simple admin page for mass uploading files in a simple manner, and create the pages for the files automaticly. ImagesManager work in the same way. Cheers2 points
-
2 points
-
I just went and added support for pagination. I pushed the update to the dev branch of the module you find here: https://github.com/somatonic/ModulesManager/tree/dev Still working out on the details for categories. Currently it just filters on a per page basis, so it possible there's a page not showing anything if category filter is set. Once you changed the limit in modules settings, you should hit refresh first on the ModulesManager screen to delete all cache files. It will create a cache file per page. So it all works now with unlimited modules but still need some work and I'm waiting for the JSON feed from modules.processwire.com to allow for more filtering.2 points
-
2 points
-
Is ProcessBatcher directory directly under site/modules or is the directory structure deeper than that? Just making sure as there's a built-in limit to directory depth, though this isn't something you'll usually need to worry about. One thing you might want to try, even though checking for new modules should already handle this, is to remove all Modules* files from your /site/assets/cache/ just to make sure that module list is properly updated.2 points
-
This must be one of the best ProcessWire quotes ever. Just saying.2 points
-
2 points
-
Do you guys think it makes sense to bring LanguageFieldTabs into the core? So far I haven't come across a multi-language site install where I wouldn't want it, so starting to wish it was just there by default.2 points
-
This is a very simple module that I put together for @Zahari Majini from a PM request. It allows you to enter a URL to a YouTube or Vimeo video in a specified field and when you save the page, it will grab thumbnails for the video and add them to a specified images field. Check the module configuration options for: the field(s) to search for videos name of the video images field which thumbnail(s) you want grabbed whether to grab the first available or all available thumbnails based on those that you list As always, an feedback for improvements is very welcome! Modules Directory: http://modules.processwire.com/modules/process-get-video-thumbs/ Github: https://github.com/adrianbj/GetVideoThumbs1 point
-
This module redirects ID based URLs to the full SEO friendly URL Modules directory: http://modules.processwire.com/modules/process-redirect-ids/ Github: https://github.com/adrianbj/ProcessRedirectIds Very simple module that alllows you to link to pages with their page ID in the URL. The ID can be in any location in the URL. There is a config option to simply load the content to the ID based URL, rather than redirecting to the original PW url if you prefer. If you use this option, the module adds a canonical link to the page to help identify the ID based URL as a duplicate of the proper PW url so Google won't penalize you for duplicate content. For example you could do any of the following, where 1058 is the ID of the page you want to load: http://www.mysite.com/1058 http://www.mysite.com/1058/this-is-the-fancy-title http://www.mysite.com/category1/category2/1058/any-text-you-want/ http://www.mysite.com/category1/category2/any-text-you-want-1058/ Any of those will redirect to the proper URL, eg: http://www.mysite.com/this-is-the-fancy-title/ At the moment for this to work, the page ID segment of the URL must be the only segment that is all numerical, otherwise, anything goes. The reason for this module is mostly as a way to have a very simple shortlink to any page on the site, but it also allows for structuring URLs however you want with any content you want. I guess this could be abused and potentially bad for SEO! I am not sure if this is a good way to do this, so I would definitely appreciate any feedback.1 point
-
Field dependencies are coming in ProcessWire 2.4, and I just wanted to give you guys a little preview of it. The development of this new feature is being sponsored by Avoine, the company where Antti works (he also specified how it should work). Field dependencies are basically just a way of saying that one field depends on another. It dictates which fields should be shown in a given context. In our case, it also gets into whether a field is required or not. This short video demonstrates how it works: (switch to the 720p and full screen version, as YouTube's default settings for this video make it impossible to see): // Edit @Adamkiss: Here's link for those on mobile: youtu.be/hqLs9YNYKMM The implementation here is done both client-side and server side. Javascript handles the showing/hiding of fields and the required vs. not required state changes. On the server side, it doesn't process any fields that aren't shown, and honors the required rules. A separate processing occurs both client side and server side, ensuring that the user can't make their own rules by manipulating the markup or post data. These field dependencies can be used with any Inputfield forms. That means you'll be able to use it not just in ProcessWire, but in FormBuilder, and via the API too. It's very simple to use from the API. All you have to do is specify a ProcessWire selector to either "showIf" or "requiredIf" to the Inputfield, and ProcessWire takes care of the rest: // show this field only if field 'subscribe' is checked $inputfield->showIf = "subscribe=1"; // show this field only if 'price > 0' and at least one category selected $inputfield->showIf = "price>0, categories.count>0"; // make this field required only if 'email' is populated $inputfield->required = true; $inputfield->requiredIf = "email!=''"; This feature will be in the 2.4 core (rather than as a separate module), so it will also be ready and available for things like module and field configuration screens.1 point
-
Awhile back, I made an Ajax API for querying pages in the admin via the ProcessPageSearch module. It is used by [for example] the PageAutocomplete Inputfield. I thought this capability would be useful on the front-end too, so this module brings it to the front-end as a page in your site that you can put wherever you want to. The way you use it is exactly the same as the one in ProcessPageSearch, but this one is a little more strict, given that it's publicly available on the front-end. By "more strict" I mean that you have to define what you want to allow in terms of input and output in the module's configuration. The web service takes it's query from GET variables in the URL and returns results in JSON format. It installs a page called /service-pages/ in your site, and you are welcome to move that page wherever you want. Here is the official page at modules.processwire.com: http://modules.processwire.com/modules/service-pages/ Once installed, you should view the /service-pages/ page that it installs because it outputs detailed instructions and examples on how to use it in your own projects. But here's a few excerpts from what you'll find on that instructions page: Input The /service-pages/ page can be queried with GET variables in the URL to return JSON-format results. The query string should follow a ProcessWire selector format ([field][operator][value]), but modified a bit for use in a URL query string. Here are a few format examples: Specify a single value: ?field=value Specify multiple fields and values to match: ?field1=value1&field2=value2&field3=value3 Specify multiple fields where at least one must match the value. Note use of "," rather than "|", something we had to settle for to make it work as a URL key: ?field1,field2,field3=value Specify one field with multiple possible values (it's fine to use "|" as a separator here): ?field=value1|value2|value3 Note that unlike regular ProcessWire selectors, multiple field=value sets are split with an ampersand "&" rather than a comma ",". Allowed Values The allowed values for field are set with the module configuration. You may also specify the following modifier keyword=value pairs: sort=[field] (Specify field name to sort results by) debug=1 (Enables debug mode producing human readable output) limit=[n] (Specify the max number of pages to return) start=[n] (Specify the result number to start with) include=hidden (Include pages that are 'hidden') Allowed operators The operator demonstrated by the "=" sign in the examples above may be replaced with any of the following operators in the query string: = Equal to != Not equal to < Less than > Greater than <= Less than or equal to >= Greater than or equal to *= Contains the exact word or phrase ~= Contains all the words %= Contains the exact word or phrase (using slower SQL LIKE) ^= Contains the exact word or phrase at the beginning of the field $= Contains the exact word or phrase at the end of the field As an example, this ProcessWire selector: template=property, body*=luxury, bedrooms>5, bathrooms<=3 ...would be specified as a query string to this web service like this: ?template=property&body*=luxury&bedrooms>5&bathrooms<=3 Allowed templates For security, the search will only be performed on pages using templates that are defined in the module's configuration. Output The returned value is a JSON format string in the following format (populated with example values): { selector: "title*=something, template=basic-page, limit=50", total: 2, limit: 50, start: 0, matches: [ { id: 1002, parent_id: 4525, template: "basic-page", path: "/test/hello/", name: "hello" }, { id: 1005, parent_id: 4525, template: "basic-page", path: "/test/contact/", name: "Contact Us" } ] } Each of the 'matches' values will also include all the fields you have specified to appear with the ServicePages module configuration. If an error in the query prevented it from being performed, a JSON string in this format will be returned: { errors: [ "Error message 1", "Error message 2 (if there was one)", "And so on..." ] } The web service honors user view permissions. As a result, if you are accessing this service from a superuser account, you are likely to get pages that others users may not see. Superusers get an "include=all" automatically, unless you override it with an "include=hidden". Returned field values The following field values will be returned for all matched pages: id (integer) parent_id (integer) template (string) path (string) name (string) Any other fields may be included from the module's configuration screen. Pagination To paginate, simplify add a "page[n]" url segment to the request URL, i.e. /service-pages/page2/?template=basic-page&sort=name1 point
-
Chrome Php Logger Module to log useful details directly in your Chrome JS console. You can inspect most as objects and see infos or values. To enable logging with this module you have to enable debug modue in config.php. If debug is set to false in config.php, it will not output any log. Important: It is not recommended to enable it on live stage, as it reveal infos you might not want everybody to see, although it's not obvious as it requires the ChromePhp Extension installed and enabled. - render time - memory consumption - cpu usage - current user infos - current user roles - current user permissions - current page with all its fields and their value and field settings - page cache/loaded on request count - fuel - modules loaded - Server vars etc. - Cookies - Requests - mySQL query log When installed you can also use ChromePhp static methods to output your own data in all your templates or modules: ChromePhp::log($page->somefield); Note: This module requires the ChromePhp Extension installed to see the log in the Javascript console. More infos can be found on http://chromephp.com Download: Modules Directory: http://modules.processwire.com/modules/chrome-php-logger/ Github: https://github.com/s...ChromePhpLogger1 point
-
1 point
-
What's the idea on these lines? foreach(wire('pages') as $p) { $fieldEnabledPages->addOption($p->name); } Grab all the pages? funny, wire("pages") or even wire("pages")->find() also don't return anything to me (the same happens with $pages on templates, by the way), but wire("pages")->find("sort=sort") does. Maybe you can try that. try: foreach(wire("pages")->find("sort=sort") as $p) { $fieldEnabledPages->addOption($p->name); } Anyway, I'm not sure if it is a good idea to iterate all the pages of the site in a module because it might cause problem on bigger sites.1 point
-
@diogo - I have added support for limiting this functionality to only those selected templates (in the module config settings). I was also trying to add support for by page, but have come across a very strange thing - I can't seem to get an array of pages using wire('pages'). I get: Trying to get property of non-object in /share/www/usaus-h2o-dev/site/modules/ProcessRedirectIds/ProcessRedirectIds.module on line 179 I have commented out this section of the code for the moment, but if you have any ideas why this isn't working, I'd love to hear them @alanfluff - thanks for that link - I think this module will take care of what you are looking to do. @Marty Walker - I have added a new tab to page edit screen in the admin called ShortLinks that lists a few key links for that page that the user might be interested in. The last example I give on that tab makes me wonder whether this module should actually be renamed to something that mentions permalinks. I am not sure where to go with this now - I will definitely be using this for an upcoming site, but I would really like some feedback from some other PW gurus, especially Ryan, as to whether this should be a released module and whether you guys think this idea of a permalink like: http://www.mysite.com/1234/articles/my-article-title/ is a good idea to be promoting or not. I know that Page Path History does an amazing job already of handling changes to page names and parents. So would the idea of using this module to create this style of permalink be redundant, or just bad practice? Thanks for any feedback.1 point
-
I'm confused - this would surely just echo the URL of that page: echo $header_page->url; ?? To render it you would want this instead: $header_page->render(); So in your other script, you could do this: // Include ProcessWire require("../index.php"); // Get header $header_page = wire()->pages->get("/external_head/"); $footer_page = wire()->pages->get("/external_foot/"); echo $header_page->render(); //.... the rest of your other script goes here echo $footer_page->render(); That should work I think, unless I've misunderstood what you're asking for. It also assumes that there will be no conflicts between variables in ProcessWire and your other script, but you would know if that's the case soon enough when it throws you errors I must admit, I do like the concept. I know of an intranet script I've worked on in the past where I tried to make ProcessWire work inside that script's header and footer for old pages, and new pages had the header and footer and the pages themselves in ProcessWire, but this would have been a better idea in terms of wrapping a consistent header and footer around both the old and the new pages until they're all ported over to ProcessWire.1 point
-
Roderigo, I'm sorry to hear that Maryla is not at the restaurant anymore...1 point
-
I think we need additional filter param for filtering by category. This would help creating the category filtering in ModulesManager a lot.1 point
-
1 point
-
What did you do? That sound not like a problem we are aware of. What version of PW? Because the line isn't where this problem would appear. It sounds more like your PW install is corrupt, missing files or whatever. Try putting in a new wire folder.1 point
-
@MatthewSchenker: Thanks a lot. We were searching for a CMS/CMF that completely fits our needs for quite a long time. We used to have our own, properitary CMS but quit developing it for several reasons. Afterwards we were using the usual suspects (Typo3, Wordpress, ModX...) but never were really satisfied with each of them. I think we finally found what we were looking for and will be happy contributing stuff to the community (in fact we've already started to ). @NoDice: If it inspires you that's propably the best thing that can happen. Thanks a lot!1 point
-
Now available in the modules directory: http://modules.processwire.com/modules/admin-template-columns/1 point
-
Soma, reading through php.net, it sounds like versions of PHP prior to 5.3.8 had incorrect behavior for is_subclass_of(). In those versions, the only straightforward way to determine it is I guess to use Reflection. I've added a PHP version check which falls back to Reflection in older versions of PHP, but don't have a PHP version to test it out with. Do you want to try replacing your /wire/modules/Inputfield/InputfieldPage/InputfieldPage.module with the attached and let me know if this resolves the issue? InputfieldPage.module1 point
-
Greetings, Sparrow: doing front-end work is great and ProcessWire allows for really nice custom elements. Keep in mind that there are multiple goals here: 1. Enter the material via forms (as discussed above) 2. Editing and/or deleting existing pages 3. Checking for existing pages when creating and/or editing to prevent two pages with the same title/name 4. Different page views depending on user roles (can consolidate certain views with actions mentioned in step 2) This is fairly standard app development stuff, of course. The point is, ProcessWire makes it pretty easy to implement. You just need to focus on each part, one at a time. Follow up with questions on particular parts and you'll get answers! Thanks, Matthew1 point
-
Another tip for anyone working with the PW Foundation theme.... You might want to consider editing the viewport to this, i.e. adding the initial scale bit. <meta name="viewport" content="width=device-width initial-scale=1.0" /> I found that I was getting unwanted text resizing on the ipad when swapping between landscape and portrait. In addition I was getting the "mobile version" of the top nav bar in landscape mode. Editing the viewport values as above solved these issues for me.1 point
-
Actually, I believe it should be 'name' rather than 'title: $images = $page->images->sort("name"); //OR $images = $page->images->find('sort=name'); //OR, by the way, sort descending by name $images = $page->images->find('sort=-name'); //OR, by the way, sort descending by name $images = $page->images->sort("-name"); Tested Btw, you can also sort by other properties, including description, height, width, size (see to be different from "filesize"?), etc. See a list here1 point
-
Try to assign the superuser role when logged into your 'admin' user account. Unless your 'admin' also has the 'superuser' role, they won't be able to assign it. Yes, they'll see it as an option, but once you try to save it, it will throw an error. ProcessWire doesn't know what your roles mean to you (like one user being above another), but it does know what superuser means, so it's not going to let a non-superuser assign superuser to someone else (or yourself). Beyond that, you should consider a user with administration control of users a fairly powerful permission at present. Though I do like your idea of limiting the assignment capabilities to the roles that the user administrator also shares. It would mean giving that user additional roles purely for the sake of assignment permission, which would be a different factor for roles than we usually think. But it is an interesting possibility. Though it might conflict with what page permissions you want the user to have. But if we can assume a user powerful enough to assign a role is also powerful enough to have all the permissions of that role (like with page editing and viewing, etc.–a safe assumption I think) then it could work. I'll think more on this and perhaps it would be a good feature to add.1 point
-
1 point
-
I've gone ahead and committed the Inputfield dependencies to the dev branch, for anyone that would like to help test. I've also posted a documentation page that explains how and where to use them, current limitations and examples. There are a near infinite number of potential scenarios on how these things could be used, so it's not possible for me to test everything locally. As a result, expect bugs and please report them when you find them. Thanks in advance for your help in testing. For non-default admin themes, some updates have to be made in order to support field dependencies. As a result, unless you are an admin theme developer, it's best to stick to the default admin theme when using field dependencies, temporarily. Field dependencies can also be used in FormBuilder. Though I've not done a lot of testing in FormBuilder yet, so don't recommend using field dependencies in front-end production forms just yet. Though in my initial testing, they seem to work just fine. Thanks again to Antti/Avoine for sponsoring field dependencies!1 point
-
Thanks guys, glad that you like how this is looking. Though you are giving me more credit here than I deserve. I didn't realize there would be so much interest in it, otherwise I'd have worked on it sooner! It's been on the to-do list for awhile (with a million other things), but didn't become urgent till I remembered/found out it was needed by the end of August. So figured I better get busy! I like the way they define them there too. Longer term, I'd like to make a new Selectors inputfield that lets you build selectors this way, because it's a little more friendly in some ways, even if less flexible in others. But it's a good option to provide in addition to text input of selectors. However, I'll build that Inputfield later as something separate from field dependencies, so that it can be used elsewhere and by other modules, etc. I agree, especially in the context of the video. Though I also think subtlety is important so that required labels don't become a distraction (especially for common required fields like 'title'). If a field is required, and the user missed the visual que, they will still find out about it when they save. The field dependencies just add (or remove) the "required" class to the .Inputfield container, so the actual look of required fields is dependent upon the admin theme. But I think the field dependencies could do a quick fade-out/fade-in to indicate that something has changed about the field's state. I appreciate the compliment. But this is just not true. There are always bugs to fix, and I'm sure there will be several to find and fix with field dependencies, just like anything else (perhaps more so, given some of the complexity in it). So when those of you on the dev branch start using this, don't expect everything to work perfectly. Instead, experiment, test and tell me when you find something that doesn't work quite right. There are so many scenarios that could happen with field dependencies that it may take a few iterations till we've covered them all. There are also some fieldtypes that may not be compatible with field dependencies. For instance, we don't currently have a way of polling the value from the rich text editors, since they don't update the related <textarea> elements on the fly. We could do it by accessing the TinyMCE and/or CKEditor API functions, but I'm not sure that I want to bundle TinyMCE or CKEditor-specific code into the field dependencies–that's the type of dependency you usually want to avoid in code. So you'll be able to show/hide rich text fields based on the values from other fields, but not based on the values in a rich text field. To be honest, I'm not sure that's a problem though, as I don't see rich text fields as being likely sources of dependencies anyway. Those 3 fields are configured in the template for 33%, 34%, 33% width. Without field dependencies they would all fit on one row. When a field is removed from the mix as a result of a dependency, it simply expands the width of the last remaining field to fill out the row. The concept is really simple. It came about because I didn't like the look of the uneven rows when I started dynamically removing fields as a result of dependencies. While the concept is simple, the implementation proved to be a challenge... it's one of those things I thought would take 30 mins, and it ended taking much longer. Though a good part of that is just that I don't use Javascript every day (I'm definitely not an expert at it), so it can take me awhile to get things right.1 point
-
1 point
-
OK, what programme did you use to make that spoof video?! After effects or something? My goodness! Avoine/Antti, thank you very much!!! As for you Mr Cramer, I don't know what to tell you. Seriously, mate, I can't pick an adjective apt enough. Let's just say that you Sir are one of the best things that has happened to the open source community. Hats off! cheers /k1 point
-
1 point
-
This is epic. Thanks for building it Ryan. Couldn't be happier with how it turned to be!1 point
-
First of all, don't worry too much, you will normally find all the problems after launching Here are some of the things I try to do before launch : - Check the page titles and meta descriptions. Install the Google webmaster tools to get more useful advice on how to optimise the site for search engines https://www.google.c...ebmasters/tools - Create an xml site map and submit to Google (via Webmaster tools) and Bing (http://www.bing.com/toolbox/webmaster) - If this is the an update of an existing site, setup redirects for old pages to new pages - you can check what old links are currently indexed by Google and start with the top ones. The redirect plugin is great for managing this (http://modules.proce...cess-redirects/). - Check and update the 404 error page - Check that all your forms are working and being delivered to email recipients (not stuck in spam). - Change the admin url from /processwire/ to something more secure - Turn off any debug modes - Disable any test accounts and put an extra secure password on the master account. - Check what print layout looks like (or make print style sheet) - Browser testing - this is tough one to summarise - there are some sites that let you take screenshots, but the best way I have found is to have multiple virtual machines with IE7, IE8 and IE9 which can be used for more detailed testing and debugging. Then there is mobile device testing! - Check for broken links and correct redirects. http://validator.w3.org/checklink - Performance testing - you might want to check for any big performance issues. ySlow is a nice tool for checking and provides some good tips that might be useful for speeding up the site. Don't be too disheartened by the results, not even the big sites get top marks. http://developer.yahoo.com/yslow/ - Setup analytics to track usage - Google analytics - Setup monitoring so you know the site is up and running - I really like pingdom.com - https://www.pingdom.com/ - Backup the site files and database! Then I like to say a little website launch prayer… "dear internet gods, I know things will go wrong but please let the issues be small and easy to fix. amen."1 point