-
Posts
17,140 -
Joined
-
Days Won
1,657
Everything posted by ryan
-
Trying to decide if ProcessWire is the right platform
ryan replied to MatthewHSE's topic in Getting Started
I agree with JeffS. You could definitely build this in ProcessWire. But no matter what you build it in, it's largely a custom application that will require significant code on your part. That is, unless there is a software that focuses on these things in particular (which might be Moodle, I don't know). In addition to looking at Moodle, a full blown framework might be another path worth considering. If after evaluating the different options, ProcessWire looks like the simplest way forward, we'll be glad to answer any questions and get you started on the right path to building it. -
I think it's a fine way to go when there is no way to make the site structure consistent with the navigation, for certain parts (like top navigation or footer nav, etc.) Still I think it's always preferable to keep a consistent site and navigation structure whenever possible. A layer of pages separate from the structure, just for menus, is [in most cases] and unnecessary bit of complexity. But for those times when you will benefit from it, it's a nice pattern to have.
-
Thanks -- let me know what you find, and I'll do some more testing here too. If you find that it's repeatable, please post a GitHub issue report so that I don't lose track of it.
-
The reference English translation is actually in the code itself. When you translate a file, it should pick up all the English, ready to be translated. I was maintaining a fake Spanish pack for awhile as a starting point set of files, but probably need to update that as there have been a few additions, though nothing major.
-
Antti here it is if you want to give it a try. Replace these files with those attached: /wire/modules/Fieldtype/FieldtypeFile.module /wire/core/Pagefile.php Test it out on a non-production setup first, as it does make schema modifications. But once installed, it adds 'modified' and 'created' fields to all file/image fields, and these can be queried in selectors as well. They initially start out at the current date/time. If you modify a file/image description or sort, that updates the 'modified' property. The 'created' property stays the same. Let me know how this works for you? If all is good, I'll commit it to the dev branch. FieldtypeFile.module Pagefile.php
-
Error: Unable to Generate Hash when trying to login into Admin
ryan replied to sam's topic in General Support
@sam, @apeisa: can you replace the line that says this (in /wire/core/Password.php): if(!is_string($hash) || strlen($hash) <= 13) throw new WireException("Unable to generate password hash"); with this: if(!is_string($hash) || strlen($hash) <= 13) throw new WireException("pass=$pass | hash=$hash | hashType=$hashType | salt1=$salt1"); Let me know what it says? I'm curious what sort of data is in there. -
Easier said than done. It's a good idea and a regular need. If it were easy, we'd have already done it.
-
The issues with specifying CSS at the page level (in the editor) are that it crosses a boundary between content and style. Ideally these things remain completely separate to ensure the long term portability of the content. As a best practice, styling is best kept part of the site's development files rather than it's content. It's also a security concern, in that you are allowing someone to inject code into a page. However, if all the editors are trusted and know how to use CSS styles in that manner, then only you can decide if the convenience is worth the tradeoffs. For instance, on your own blog site (or something like that) it might be totally fine and convenient. But on something bigger you'd want to be careful, as it is crossing a line.
-
Problems with "not equals" operator and multiple page references
ryan replied to nik's topic in API & Templates
@nik these should now all be working with the latest version of the test suite and latest commit to ProcessWire dev. Thanks for your help in tracking down these issues. -
Assuming I understand the need correctly, what I usually do add this to the <head> section of the main markup include: <head> <!-- all your typical <head> stuff --> <?php $file = "styles/$page->template.css"; if(is_file($config->paths->templates . $file)) { echo "<link rel='stylesheet' type='text/css' href='{$config->urls->templates}$file' />"; } $file = "scripts/$page->template.js"; if(is_file($config->paths->templates . $file)) { echo "<script src='{$config->urls->templates}$file'></script>"; } ?> </head> Using this method, if you have a template named 'product', then it could have dedicated CSS and JS files in /site/templates/styles/product.css and /site/templates/scripts/product.js, when you need it. The nice thing about this is that it's just a system rather than hard coded file. If you determine you need something unique for the CSS (or JS) on pages using some template, the you can just create the CSS (or JS) file and have it start working automatically. You can take this further too. For instance, you could use the same technique with page IDs to assign custom CSS/JS files to specific pages.
- 7 replies
-
- 11
-
-
Error: Unable to Generate Hash when trying to login into Admin
ryan replied to sam's topic in General Support
That error message is coming from this file: /wire/core/Password.php if(!is_string($hash) || strlen($hash) <= 13) throw new WireException("Unable to generate password hash"); It sounds like the server supports Blowfish but when PHP is asked to return a blowfish hash, PHP's crypt function is returning an error for one reason or another. ProcessWire only uses $config->userAuthHashType if the server does not support blowfish. The reality is, it's a bad idea to use anything less when blowfish is available. But in your case, it sounds like we've got the server reporting "I can do blowfish" and then bowing out when we ask it to do so. What you might want to try to do is modify that Password.php file and change this function: public function supportsBlowfish() { return defined("CRYPT_BLOWFISH") && CRYPT_BLOWFISH; } to this: public function supportsBlowfish() { return false; } If that fixes it, please let me know. I can add a config option to bypass blowfish -
I'm not sure I understand -- can you clarify? Does it use ProcessWire, or just has similar features?
-
I think you've probably got it about right in terms of structure, unless your products need to have multiple categories/subcategories. I'd suggest using a different template for category and subcategory rather than the same one. You'd mentioned pretty different output needs between category and subcategory. Not to mention, structurally subcategory requires category as a parent, so you can enforce that with family settings if they are different templates.
-
It sounds like a bug, so I want to find out some more details on how to reproduce. Specifically, what is the source of $events -- is it a Page or a PageArray? Can you provide the code the came before where $events was generated? Also, do you see any difference if you change it to this? $today = strtotime("2013-02-11 21:34"); $rows = $events->find("event_datetime>=$today, limit=3");
-
I'm not sure exactly what changes might be necessary to make it work with nginx, but I have no doubt that if you are able to get ProcessWire safely working under nginx, then ProCache should work fine too. However, you may want to remove write access to your .htaccess file so that ProCache can't write to it. That way you are implementing any updates manually (and adjusting them for nginx). I'm curious to know if the ProCache rules work under nginx as they are, or if you have to make any specific changes?
-
Soma, once we've got 2.3 as the current stable version out there, I'll go through the cheatsheet and figure out what needs to be added, etc.
-
Problems with "not equals" operator and multiple page references
ryan replied to nik's topic in API & Templates
Thanks for finding that Nik. I've tried to find a simple fix, but no luck so far. It seems that I break a lot of the other tests with nearly any solution I implement, so far. So going to need to find time to get further into this soon. Do you have one of these in the tests? -
Looks like the University of Oregon cheerleaders/dance team have made excellent use of the Blog profile: http://uodance.com/
-
Looks to me like the logo is a little too wide for your mobile version. You could solve it by just making a more narrow logo as the default, so that it fits on mobile. Or you could use media queries in the CSS (see the example files) to display the logo at a different size when at mobile portrait. A quick-n-dirty fix might be to add an inline style to the the <img> tag, i.e. <img style='max-width: 100%;' ... />
-
WillyC's example actually works. Returns the 10 last updated files. But the shell commands it executes are pretty unix specific (though am guessing there is an equivalent in Windows). We might be able to just add a timestamp field to the file-based fieldtypes too. I kind of hate to duplicate info like that, but the reality is that disk space is cheap and making them queryable from the PW API would be nice.
-
How to package a site to install it on another machine?
ryan replied to demhan's topic in Getting Started
This is what I usually do. A few things I've occasionally had to take into account when doing this, in addition to the image path you mentioned: The installer never gets to run, so doesn't have the chance to confirm compatibility with the server. If it's a new server you haven't used before, you might try just installing a test copy of PW to see if the installer mentions any issues. I usually do that if something doesn't work after copying the site over. You need to make sure that permissions are retained for /site/assets/. Sometimes I have to reset the permissions after copying to the server so that everything is still writable. If using a cache, you might want to clear it before or after copying to the server: rm -r /site/assets/cache/* Most of the time, I don't have to do any of these. But it's good to know about them for when you do. -
But then how to get the dynamic description into the static HTML from TinyMCE? It would have to be done at runtime with some kind of variable replacement. That's something I've been trying to avoid with TinyMCE, though don't have good enough reasons. One of my problems with the default dialogs in TinyMCE (and most other editors, for that matter) is that they present every possible option and only a developer would understand the vast majority of them. For instance, the distinction between a description and a title is going to confuse the non web-developers. I tend to think we should just make the behavior a checkbox in the module's configuration rather than the image editor. Another thing to consider is that we'd be duplicating an 'alt' to a 'title' for the benefit of javascript. When faced with that, it's technically more efficient to duplicate the attribute in javascript rather than in the markup, i.e. $(document).ready(function() { $(".gallery a > img").each(function() { // copy image 'alt' attribute to a 'title' attribute $(this).parent('a').attr('title', $(this).attr('alt')); } }); Do you mean add attributes? Not possible at present, just because our JS-side of things needs to know what the attributes are ahead of time (though some re-coding could solve that). But since these tags only accept a limited number of attributes anyway, I'm not sure we need that scalability here.
-
Antti, what are the table features that you find to be better in CKEditor? I was playing around with the demo on their site, but couldn't figure out how it was better in that regard (though I didn't experiment for long).
-
On the details tab, what do you have for "number of decimal digits to round to"? On the input tab, what do you have for "numeric input type?"
-
I'm confused -- I haven't changed anything here, and the getDatabaseSchema() function for FieldtypeFloat still says this: public function getDatabaseSchema(Field $field) { $schema = parent::getDatabaseSchema($field); $schema['data'] = 'float NOT NULL'; return $schema; } Can you clarify what you mean about them being stored as ints in the DB? I want to make sure I didn't break something.