Leaderboard
Popular Content
Showing content with the highest reputation on 12/19/2014 in all areas
-
Hu guys I'm delighted to say that my new site is powered by Process Wire. Or rather, "Priceless Wine" and "Princess Wine" as my iPhone mistakenly predictive texts the name. There is also a page on ProcessWire in the CMS section which I'd love your feedback on. Currently I don't think it truly communicates PWs best features for Editors but it's a good start. Only almost finished? The site isn't 100% complete so consider this a "soft launch". Once complete, it'll replace my existing edenweb.ie site which wasn't being updated or developed as much as it should. - - - - - - - - - - - - - - - - - - - - - - - - - - - Background - Why ProcessWire pt 1. A few months back a key client who uses up approx 3 days of my week (for over 3 years) announced a pause on their web and marketing activities for various internal corporate reasons. This happened quite suddenly and obviously that left me with half my week "open" and needing to be filled. It also meant that I would be looking for new work and approaching prospects with a site which was approx 3 years out of date, under developed and didn't really communicate my latest skills or work. Not ideal! - I rapidly needed something live. But more importantly, I needed something better. I needed something built on a CMS which would allow me to rapidly publish content and accelerate future ideas and development. In short, my current CMS is/was great but I was tired of working around default field sets and presumptions it made about my content (amongst other reasons). With ProcessWire, the ability to have a page with just two fields (if I want) is remarkably underestimated. It means I can customise field layouts appropriate to my content. Even better - it means I can customise field layouts appropriate to my clients content and I choose my CMS on their requirements. Anyway, I made the decision to take a deep breath, take a few weeks to enjoy the extra unexpected free time and to rebuild the site in PW. My business will be 15 years old this January and I thought I'd mark the new year with a new domain, new business name and a new CMS. Here's to new beginnings! - - - - - - - - - - - - - - - - - - - - - - - - - - - Under the hood At the time of writing, the site is running 2.5.10 dev. There's not a huge amount of Modules running in the background. Where I've used a Module, it's been to accentuate back-end functionality rather than the front end. Config allows me to make setting changes directly within the admin. Its a great Module and saves me editing any config files and manually FTP'ing. Lister Pro gives me an easy way to manage the "studio updates". Hanna Code allows me to work with some of the tricker layouts such as the page on PW Forms is used for the Contact Form and I'm using direct embed with some jQuery and CSS to strip out some unwanted formatting. ProCache is running in the background to speed things up. Thats more out of professional curiosity right now Vs any focuseed attention on site speed. AIOM was running recentlyto minify all my style sheets and JS but I pulled it recently. might revisit. Blog module is running the er, blog! I've some work to do there in terms of content layout etc but it's a wonderful piece of work. RenoTheme is keeping everything lovely in the admin Upgrades is a real life saver and allows me to update the whole CMS in a few clicks MarkupSimpleNavigation is powering the menus. Regarding the actual PHP used in templates, I doubt there's anything there of interest to you seasoned PHP guys. I've achieved 99% of the site using simple foreach loops and PW selectors. - - - - - - - - - - - - - - - - - - - - - - - - - - - Background - Why ProcessWire pt 2. When I first heard of PW, I was very content with my current CMS so I had a brief look around the site, read some blog posts but ultimately moved on. It looked interesting but I didn't really have a need to investigate further. Fast forward a few years and realising I need to expand my CMS toolset a bit, I had a better look at PW and downloaded it. I really liked *some* elements and appreciated how I could determine the field layout. You see where this is going? Interest increasing! But honestly? I couldn't imagine putting my clients on front of PW with the theme it had (at the time) and TinyMCE as the default editor. It looked real clunky and I wasn't sure I wanted another CMS with the tree representing pages. Somewhat trivial and shallow reasons not to use something but there we go. I'm a designer and I also have to think about my clients experiences too. But I kept an eye on PW and in the background, a few things were happening which were interesting. Communication from Ryan was frequent, open and transparent Planned updates were being released on or before schedule Unplanned updates were often released on or before I realised I even needed them I discovered TinyMCE could be swappable for CK editor and I could use alternative admin themes I discovered a few Modules for listing pages via DataTables as opposed to tree mode Not really sure of the timeline here but this is from mid 2013 onwards btw. The crazy things is from that point onwards, it seemed increasingly impossible to ignore PW. Every few months there was an amazing leap in either the core features or some brilliant module I hoped for was published. EG: I was looking for a way to decrease the time it takes to publish a page in the right place with the right template and the Add New button appeared I was looking for a way to represent pages in a List rather than a tree and ListerPro was announed Hoping for a better way to upgrade PW and the Update module was released Needing a proper blog with categories and the Blog module was there Looking for a better admin UI and RenoTheme came along Needed more flexible field layouts in a matrix and ProFields released Looking for a way to store chunks of html/php etc and Hanna Code was released Ok, that sounds like an Arethra Franklin song about PW but you get the idea! Seriously, it got to the point where I was either silently (or via the Forums) hoping for a particular feature and Ryan would already be working on it or would just release it having finished it. And it was always done in a much more elegant, scalable and powerful way than I imagined or hoped. Just last month I wrote a forum post highlighting a wish for an admin-based settings module. Thinking "nah, there I go complicating things again. Make do with the config.php file" I deleted it. Literally the next day, the Config module was released. It's spooky! Anyway, I've rambled on a bit. But to sum up - I try to redo my site every few years in a different framework and platform. I can see the front-end framework changing in future but I think EdenStudios has found a good, permanent home in PW. PW and Ryan are doing everything right. It's not the only great CMS but it's a damn fine CMS in great hands supported by a great community.10 points
-
Also: http://modules.processwire.com/modules/inputfield-textarea-markup/. Self-promotion, again6 points
-
Hi @kathep, welcome to PW and the forums. As with the most things here, there are no "right way" to do it. There are a few more or less equal but different solutions possible. What come into my mind are three variations: a) simply going with single pages b) going with repeaters c) going with Profields Pagetable I would go with single pages: 1) build a page called tools or something that only serves as parent for stuff that is not used to be displayed directly to the forntend. Set the page to hidden. 2) Build a template called category, it only needs a title field I think create a page under tools called categories that should serve as parent for your categories build child pages under categories that have the template category and the title are the names of your categories you need 3) Build a template called quotes, build the fields you need to be on a quotes page: quote_text = textarea quote_author = text quote_category = page, best is to use it with ASM select!, the source for it is the category parent! etc and assign them to the template Build a page under tools called quotes as parent for all single quote pages create your quote pages there (if you have to many for a manually creation, there are also automated import solutions available) If you have all setup you can get the quotes from every where in PW with a selector like this // get all quote pages $quotes = $pages->get("/tools/quotes/")->children(); // get all quote pages of a specific category $quotes = $pages->get("/tools/quotes/")->find("quote_category.title=category1"); // get all quote pages of a few specific categories $quotes = $pages->get("/tools/quotes/")->find("quote_category.title=category1|category2|category3"); // to get only one random out of those collections you call ->getRandom() at the end $quote = $pages->get("/tools/quotes/")->find("quote_category.title=category1|category2|category3")->getRandom(); If you get stuck at some point with this, come back and tell us.5 points
-
5 points
-
There are a couple of options: https://processwire.com/talk/topic/5019-template-notes/ https://processwire.com/talk/topic/8392-simple-built-in-docs/ Hope that helps!5 points
-
FieldtypeMatrix and InputfieldMatrix Modules Directory: http://modules.processwire.com/modules/fieldtype-matrix/ GitHub: https://github.com/kongondo/FieldtypeMatrix The module Matrix enables you to save data from a 2D-Matrix table. The rows and columns of the matrix table are made up of pages retrieved via a ProcessWire selector or via a page field selection of parent pages. The matrix values are made up of the data input in the matrix cells, i.e. the 'intersection of rows and columns'. Example Usage You have Products whose prices vary depending on colour, size, material, etc. Using the Fieldtype, you can create a table with rows made up of colours and columns made up of sizes the combination of each making up their respective values (in this case price). So rather than creating multiple text fields to do the following: Colour Size Price Red Small £10 Red Medium £20 Red Large £30 Red X-large £35 Green Small £9 Green Medium £15 Etc... You can instead have the following in one field: Small Medium Large X-Large Red £10 £20 £30 £35 Green £9 £15 Blue Etc... Yellow Purple If you set a selector in the Field's settings, to retrieve pages to build your matrix's rows and columns, it follows that all pages using the template the Fieldtype is attached to will have identical rows and columns. In some cases, this could be the intention. For instance, you might have 'Car' pages, e.g. Audi, Volvo, Ford, Citroen, Mazda, BWM, etc., each of which uses a 'Cars' template that has a single FiedltypeMatrix called 'car_attributes'. If you set a selector to build the Fieldtype's rows and columns, your users can easily compare the cars based on a combination of different values. The following matrix table best illustrates this: Type Engine Size Fuel Efficiency Carbon Emissions Warranty Road Tax Price 1994 Audi brand 1 values, etc. 2000 Audi brand 2 2006 Audi brand 3 2012 Audi brand 4 Each of your car pages would have similar matrices. This allows you to make easy but powerful queries. Such a setup allows you to compare within and across car brands. Say you wanted to find out which car(s) offered the best value for money given certain parameters such as warranty, emissions etc. You can easily make such comparisons (see code below). You can also compare within one car type, e.g. which brand of BMWs does best in what area...The possibilities are endless. In the database, Rows and column pages data are stored as their respective page->id. Matrix-values store any data (varchar(255)). If instead you wanted a template's pages to each have a matrix built of different rows and columns, you would have to name a Multiple Page Field (attached to the same template as the as your matrix field) in the matrix field's settings. When editing those pages, your matrix table's rows and columns will be built using the published children pages of the 2 pages you select in the Multiple page field.. The module allows the creation of matrix tables of any sizes (rows x columns). The rows and columns dynamically grow/shrink depending on the addition of row/column pages that match what you set in the matrix field's settings (see its 'Details Tab'). Please note that, if such pages are deleted/trashed/hidden/unpublished, their data (and presence) in the matrix are also deleted. Entering values in the matrix You have three choices: Manually entry Uploading a comma delimited (CSV) file. This can be delimited by other characters (tab, pipe, etc); not just commas Copy-pasting CSV values. (Tip: you can copy paste directly from an Excel spreadsheet. Such values will be 'tab-delimited'). In addition, if your server supports it, in the field's settings, you can enable the use of MySQL's fast LOAD DATA INFILE to read and save your submitted CSV values. Note that for large tables, you may have to increase your PHP's max_input_vars from the default 1000 otherwise PHP will timeout/return an error and your values will not be saved. I have successfully tested the module with up to ~3000+ values (10x350 table), the Fieldtype is not really optimised (nor was it intended) to handle mega large matrix tables. For such, you might want to consider other strategies. Install Install as any other module. API + Output A typical output case for this module would work like this: The matrix's rows, columns and values are subfields of your matrix's field. So, if you created a field called 'products' of the type FieldtypeMatrix, you can access as: product.row, product.column and product.value respectively foreach($page->matrix as $m) { echo " <p> Colour: $m->row<br /> Size: $m->column<br /> Price: $m->value </p> "; } Of if you want to output a matrix table in the frontend: //create array to build matrix $products = array(); foreach($page->matrix as $m) $products[$m->row][$m->column] = $m->value; $tbody ='';//matrix rows $thcols = '';//matrix table column headers $i = 0;//set counter not to output extraneous column label headers $c = true;//set odd/even rows class foreach ($products as $row => $cols) { //matrix table row headers (first column) $rowHeader = $pages->get($row)->title; $tbody .= "<tr" . (($c = !$c) ? " class='even' " : '') . "><td class='MatrixRowHeader'>" . $rowHeader . "</td>"; $count = count($cols);//help to stop output of extra/duplicate column headers foreach ($cols as $col => $value) { //matrix table column headers $columnHeader = $pages->get($col)->title; //avoid outputting extra duplicate columns if ($i < $count) $thcols .= "<th class='MatrixColumnHeader'>" . $columnHeader . "</th>"; //output matrix values $currency = $value > 0 ? '£' : ''; $tbody .= "<td>" . $currency . $value . "</td>"; $i++; } $tbody .= "</tr>"; } //final matrix table for output $tableOut = "<table class='Matrix'> <thead> <tr class=''> <th></th> $thcols </tr> </thead> <tbody> $tbody </tbody> </table>"; echo $tableOut; The module provides a default rendering capability as well, so that you can also do this (below) and get a similar result as the first example above (without the captions). echo $page->matrix; Or this foreach($page->matrix as $m) { echo $m; } Finding matrix items The fieldtype includes indexed row, column and value fields. This enables you to find matrix items by either row types (e.g. colours) or columns (e.g. sizes) or their values (e.g. price) or a combination of some/all of these. For instance: //find all pages that have a matrix value of less than 1000 $results = $pages->find("products.value<1000"); //find some results in the matrix (called products) of this page $results = $page->products->find("column=$country, value=Singapore");//or $page->products->find("column=$age, value>=25"); //$country and $age would be IDs of two of your column pages Other more complex queries are possible, e.g. find all products that are either red or purple in colour, come in x-large size and are priced less than $50. Credits @Ryan on whose Fieldtype/InptufieldEvents this is largely based @charger and @sakkoulas for their matrix ideas Screens Field Details Tab Inputfield Larger matrix table Example output4 points
-
That turned out (later) to be the easy bit . They are stored similar to Page Fields...(see second screenshot below) Matrix array (see post below - we use this only for grabbing db values to later manipulate to build matrix cells/intersections. We use a different array for saving) Matrix db table (see update below [version 0.0.3] about avoiding saving records with empty values)4 points
-
3 points
-
Update: version 0.0.2 Added ability to reuse a single matrix field across pages/templates to build unique matrix tables on a page by page basis. This is achieved by specifying the name of a Multiplepages select field in the Fieldtype settings (Details Tab). It allows you to select row and column parent pages from within the page containing the matrix itself. The child pages of these parents are used to build the matrix. This setting overrides the Row and Column selector settings of the fieldtype. Example usage: Create a Multiplepages field and call it, for example, 'product_select'. Set it up as you wish (e.g. custom PHP, selectors, etc for selectable pages). You may wish to use ASM select to make things prettier/easier below. Add it to the same template(s) where you will be using a matrix field. In your matrix field's Details Tab, specify the name of the page field (i.e. 'product_select') under the 'Matrix Row and Column Parent Pages' setting. Edit the page where you will be building a matrix table. Select 2 pages in your 'product_select' whose child pages will be used to create your matrix rows and columns. The order is important! The first selected page will be assumed to be the row pages parent and the second one the column pages parent. Any additional pages here will be ignored. Save your page and your matrix table will be built using the children of the selected parent pages. Note: The usual error checking will be done and 'thrown' (e.g. if parent pages do not have children, if your specified page field is not a page field/does not return a PageArray, etc. Note 2: You can swap/change the row/column pages in your page field (product_select) HOWEVER, all previously saved values will be deleted(!) on save and your matrix table rebuilt to reflect the new specified row/column structure. Todo/think about Copy values from Excel and directly paste this in a similarly structured matrix table Export matrix table? 1-click clear all values entered in a matrix table Etc? Download: https://github.com/kongondo/FieldtypeMatrix Screens Named Page Field to select rows and columns parent pages Row and Column parent pages selection in a specified Page Field Reusing a single matrix field on a different page(s)3 points
-
@kongondo, is there any need to store the empty results? Just wondered as once you get into the world of combinatorials things quickly get memory hungry big; and PHP associative arrays aren't exactly the world's most efficient storage format. Any idea how this fieldtype works out memory wise?2 points
-
Any chance you are using these inside a function or module? In that case you'd need: wire('config')->urls->root Do you have debug mode turned on? That should let you know that you have an undefined variable: $config2 points
-
I've been using Mandrill for a year now for various projects and can't rate them highly enough. They're great for sending emails using the SMTP classes built for ProcessWire. For example, on several occasions I've had IPs blocked by Hotmail because someone who subscribed to something marked an email as spam (yes, users do silly things like forget what they signed up to or don;t just use the unsubscribe links) and Mandrill saves you a lot of hassle by a) not letting you send to those users again if the email bounced or was marked as spam and b) ensuring your IP isn't blocked to the rest of Hotmail (or whichever other service this might happen with - isn't Hotmail Outlook.com now anyway?). It also has some great webhooks so you can write some code to let you know which customers aren't interested within your own application. So yeah, great service that does a lot for you, lets you have sub-accounts for each client and all round protects your deliverability on business-critical applications.2 points
-
I think at the moment ryan approves all modules before they appear in the list so I assume he is looking at the code before approving them. The problem is, as a play on what Joss says above, you can do just as much damage without modules on your own. You can open up security vulnerabilities in any CMS with a little effort (I believe both MODx and WP allow you to write pure PHP in templates/snippets as well as PW of course), so even leaving modules aside it's possible to create your own issues in very few lines of code and be totally oblivious to the dangers. My point is, modules or not, a lack of knowledge is the enemy here. Not everyone has the knowledge necessary (myself included) to understand the more complex modules out there so the recommendation that I would love to give of "don't use a module if you've not investigated its code" doesn't even work for me I guess the best thing moving forward is to have a few more people checking out the modules submitted to the Modules page and recommend that nobody downloads modules that haven't been posted there. That might seem harsh as I know there are many good modules only on Github, but if nothing else it will encourage people to submit their modules to the directory - let's face it, it doesn't take much time at all.2 points
-
So you've subscribed to php[architect] too? That's kind of cool, actually Anyway, that article was intended as an introduction to ProcessWire and it's core concepts, so don't expect to find anything too fancy. Just trying to get the word out there2 points
-
I guess this counts as "on the web": http://www.phparch.com/magazine/2014-2/december/.2 points
-
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
-
One of my co-workers found the cause for my problem. The suhosin.ini on our server had a max length of 64 characters and we had to increased it to 128.1 point
-
Thats right, lol. I used a counter for grabbing images from another template. Totally forgot about this method. Thanks Adrian!1 point
-
Hi Charles, I think my fork is well ahead on the attachment functionality. In my limited tests I think it was working in all situations, but I might have missed something - so many different things to consider with different email clients. Anyway, please test my version and let us know how it goes for you.1 point
-
So I think I'm going to change MarkupSEO back to creating "real" fields. This will allow multilanguage and has some other benefits as this module is used by a lot of you lately.1 point
-
1) I think using pages will be the best decision. 2) I would propose to use page field to relate quotes to categories. 3) You can use this to get a random page.1 point
-
Yes. They are subfields of whatever your field is. The subfields are the names of the columns in the Fieldtype's db table, i.e. matrix_row, matrix_column and matrix_value. The selector format would be: field.subfield=value E.g., if your your matrix field was called 'product', you would search for: . product.matrix_row, product.matrix_column and product.matrix_value. I'm in a hurry atm, see examples here: http://processwire.com/api/selectors/#subfield https://processwire.com/talk/topic/5040-events-fieldtype-inputfield-how-to-make-a-table-fieldtypeinputfield/ https://processwire.com/talk/topic/5040-events-fieldtype-inputfield-how-to-make-a-table-fieldtypeinputfield/1 point
-
Partial reply... Looking at this some more I don't think this will be a major concern for most small combinations that people were suggesting (like {S, M, L, XL} crossed with {Red, Green, Blue}) but I am interested in how this might scale if people start specifying a set of pages for the x-axis with a larger number of members - say 30 options and a set of pages for the y-axis with another 20 options. Or perhaps if a user mistypes a selector and end up with 1000s of pages in one of the axis - would there be issues? (I'm kinda asking as I'm hitting an issue with a module of my own that needs a safe fallback position if something goes wrong.) When I've looked at memory usage in the past, I've tended to use the memory_get_usage() function to track this kind of thing.1 point
-
1 point
-
Update: version 0.0.3 Small but important update to correct oversight whereby records with empty values were being saved to the database, thx @netcarver.1 point
-
i do tests with matrixField and seems to be working fine, (i have edit a little the inputfieldMatrix.module to retrieve matrix_columns and matrix_rows from a pagefield inside the same page) i'm still testing it, for any issues i will post here... Thaaaaaaanks kongondo1 point
-
Hi Adrian Can't believe I missed the query way, schoolboy error. I think I was too wrapped up in process wire to even think properly. Your jquery suggestion works a treat. Thanks1 point
-
@Steve, Good catch about empty values! Don't know how I mised that! I have corrected it in Version 0.0.3 (post here soon), thanks! Memory issue: That was my next question. I would like to do/see some real world tests....+ there's also PHP post limits...Would appreciate if anybody could help test , thanks.1 point
-
1 point
-
1 point
-
This might be easiest using jquery which you can do quite easily from your module also. Looking at your str_replace, I don't really get it. Wouldn't you want: $event->return = str_replace('<div class="container">', '<div class="container" contenteditable='true'>', $event->return); But that said, I think jquery might be easier: $('.container').attr('contenteditable', 'true'); Otherwise, you might want to consider domdocument to modify it in PHP if you need to do it server side - it really depends on whether you can guarantee the exact structure of that container div. Have you tested that the $event->return is actually being implemented in the first place? Have you looked at the: $event->replace = true; option?1 point
-
Looks great kongondo!! Very impressed. How are the intersection values being stored? (Sorry, I've not dug around in the code.)1 point
-
Hmm, or maybe I should include this in the present module but with a max 3-way relationship? Otherwise it get messy if more. The 3rd relationship (materials in your case) would only kick in if user configures it in the Fieldtype settings as you suggested. What do you guys think?1 point
-
Sorry about that teppo - I knew there was another one, but had forgotten what it was1 point
-
I suppose this is an inevitable result of open source. If the company is solely responsible for all code, then they can put in tough QC measures in at source. Even then, they can get caught out by their own mistakes, but at least they know where to look. Having said that, you then might have security problems with the server, the OS or the language (PHP has had the odd issue...) The lower down the food chain you are and the more reliant you are on third party input, the more vulnerable you are. Or at least if feels like that from my one man band perspective.1 point
-
Looks pretty good to me. A couple of things though: if ($f->type == 'Email') etc should be if ($f->type == 'FieldtypeEmail') - at the moment those won't be triggered at all. I think you should change though is to add "true" as the second argument for the pageName. This might not be necessary depending on the input, but I don't think it hurts. Glad you got it all working in the end!1 point
-
Hmm, that would be because mySQL fulltext indexes don't include words under 4 letters long by default. So 'Sri' won't be found. If you have enough control of your mySQL setup, you can change that, probably to include 3 letter words (unless there are any possible shorter words you would need to find), although at the cost of increasing index sizes. (The limit is there for a reason.) There are a couple of workarounds. The easiest is to not search for words under 4 letters long. foreach($keywords as $kw){ if(strlen($kw) >= 4){ $selector .= "Meta_keywords|DMCcontact_Country|DMCcontact_Address_2|DMC_Email~=$kw, "; } } ...which might introduce other undesirable side effects. You could also vary the selector operator based on keyword length. foreach($keywords as $kw){ if(strlen($kw) >= 4){ $op = "~="; } else { $op = "%="; } $selector .= "Meta_keywords|DMCcontact_Country|DMCcontact_Address_2|DMC_Email{$op}{$kw}, "; } (I don't think the curly braces are strictly necessary, but they do enhance readability.) And, of course, this might also introduce other side effects, although my own hunch would be that this is likeliest to work well. I have another method in mind, but it would be a lot of code and might be unnecessary. (It includes 2 searches then combining/uniquing page arrays, and still might not work ) See how you get on with these variations and we'll take it from there.1 point
-
Self promotion is such an undervalued artform..... (I must write that down somewhere - one of my better ones)1 point
-
Some want the readers to go to the website and publish only the summary, most commonly because of publicity.1 point
-
Oh, nah, $city is just a page object and weather is a field. The sample was taken out of a foreach loop. To set the city id via API, you can do $page->weather = 12345 and save the page/field.1 point
-
I simply added in the title of the webpage the title I wanted before the current page title gets put in. This seemed to fix the problem partially. Still hope to find out if there is a way to force google to display a title that isn't the standard page title.1 point
-
Yesterday I looked at the HTML output of a PW website of mine and thought it looked kind of messed up. It wasn't because the code was bad or I used the wrong tags. It also wasn't because I somehow forgot to close open tags (w3c validation went fine). No, it only was because the HTML output wasn't well formatted. I think this is a pretty common "problem" when using PHP to generate your HTML code instead of creating static HTML pages. To solve my "problem" I searched a bit and stumbled upon https://github.com/gajus/dindent. The idea behind this remarkable little piece of software is imho great: In opposite to HTML purifier or tidy Dindent doesn't manipulate your HTML code in a sense that it will behave differently. It doesn't close unclosed HTML tags or something like that. No, Dindent only changes the format of the HTML output to make it more readable and appear cleaner. So, as a developer, you are still responsible for creating proper HTML code! So I decided to create a simple little ProcessWire module that hooks into the render-method and applies the magic provided by Dindent. That's all! But I really think it can make a difference in the presentation of your website for everyone that looks a bit deeper into your project and therefore looks at the HTML code your website provides. Beware: Of course the whole beautifying process is not free. It costs some time, so it works best together with a caching mechanisms (favourably the fantastic ProcessWire ProCache)! What do you think? DIndent_v1.0.0.zip1 point
-
Ah, ok, no I misunderstood you. You're right with the namespaces that were introduced with PHP 5.3.0 Anyway, I can't really say which PW version is required for my module, because I've only tested it with PW 2.5 I'm pretty sure thought it would also work with PW 2.2+ (and below was no "requires"-field I think). Right now I'm tending to let the module only require the PHP version and not the PW version so nobody is restricted unnecessarily. Is there somewhere a documentation that points out which feature/hooks/methods/etc. were added at which PW version?1 point
-
@all Perfect! i solved my problem! I've unzipped again the folder, replaced the entire folder 'processwire' and the installation went to the end. Now at http://localhost:12/processwire/ i can see the basic template default site but i found new problem: when i try to move from home page to any page ('About', 'Admin Panel'..) i land on xaamp home page ( http://localhost:12/). NB yesterday i have installed process wire on my mac and all went ok. Topic is about my windows 7 laptop. @kongond thanks for welcome!1 point
-
Hey Joss - thanks for the file. The issue was with some broken images embedded into your blog posts - some linking to an old joomla site . Migrator now handles broken images properly so no errors. I also took the opportunity to add a few more fixes and enhancements to embedded images and captions - links to the original sized version now also work (although I am wondering the best way to add a class for lightbox display of these. I don't want to assume the class that users want, so maybe this needs to be a configurable setting - any thoughts?). Please try the latest versions of both ProcessMigrator and MigratorWordpress (again from my fork) and let me know how you go. Here's a screenshot of what one of blog posts looks like for me once imported. Be patient - it can take quite some time to download all those images, but it will work1 point
-
I have confirmed that the 'missing' file is in the zip file at the download link you have stated. Your unzipping must have gone wrong. I would start the unzipping all over (maybe using a different unzip programme ) in case other files are 'missing' too. Edit: Oh, how rude of me. Matt, welcome to ProcessWire and the forums! Sorry for the bad start1 point
-
@Guy Verville, I played a lot with Shop-for-Processwire with PW 2.5.7 dev without any issues.1 point
-
Great article Joss! And yes this is well worth funding (I'm sure Diogo will offer a free illustration for any PW donations ) Small typo = "flair/flare"1 point
-
PHP's date expects a Unix timestamp. $page->closing most likely returns a formatted date that is set in the fields output formate setting. Try: <?php echo date("Y-m-d", $page->getUnformatted("closing")); ?> The created and updated system values return unix timestamps by default i think, so this is why they work in your example.1 point
-
Apeisa is right. But if you really can't help it and it is a must you can do this: $pages->get("/path/, include=all");1 point