Jump to content

ryan

Administrators
  • Posts

    16,714
  • Joined

  • Last visited

  • Days Won

    1,515

Everything posted by ryan

  1. ryan

    Hanna Code

    Just to follow up here in case anyone else ever runs into something similar: WillyC was correct about the issue here. It just needed to be an HTML HannaCode rather than a javascript one. Also wanted to mention I've posted an update to HannaCode, version 0.1.4 which fixes a couple of bugs having to do with the Ace editor. It fixes the issue where extra whitespace was getting inserted at the end of the code. It also fixes the issue where Ace sometimes wasn't active after doing a 'save & test'.
  2. I think both of these issues are fixed on dev, but please let me know if you are still experiencing either.
  3. Pete tracked it down and I put in a fix. The problem was actually related to the prependTemplateFile / appendTemplateFile options not being properly identified in the cache.
  4. Actually I think all instances of $summary were supposed to be $text. Not sure what I was thinking, must have gotten a phone call in the middle or something.
  5. The root is the execution path, but ProcessWire changes it to /site/templates/ when executing a template file. Not sure exactly what would account for the difference here, but it looks like the different access control is resulting in one of the instances occurring while a template is being executed, and and another while it isn't. From within a module file, you wouldn't want to use relative paths like. You'd definitely want to use an absolute path to your resource. Lets say you wanted to include() a file that's in /site/templates/, you'd do this: include($this->config->paths->templates . 'your-file.php'); Or if you wanted to include a file in the current module's directory, you'd do this: include($this->config->paths->YourModuleClassName . 'your-file.php'); // this also works: include(dirname(__FILE__) . '/your-file.php');
  6. You'd have to use the ID for the selector in this case. When no subfield is specified in a database-querying selector, a Page field will attempt to match the name or title of a selectable page if the given value is not numeric or a /path/. This is specifically for making it easier to do imports, like with ImportPagesCSV, where you'd be unlikely to maintain IDs in a spreadsheet. The reason it's not working in the above case is because the selector in question is not a database querying selector, just an in-memory one validating that the page matches the selector. Clearly it should in this case, and I think I can add support for this to the in-memory selectors. But I've been a little shy on this one because name and/or title aren't guaranteed to be unique in a set of selectable pages. So while they are convenient for things like importing, they aren't ideal for most definitions like this. Though the name is guaranteed to be unique, if the Page selection is limited by a parent. Roles is limited by a parent, so it would be fine in this case, but it could get you into trouble in other cases.
  7. I see ProcessWire as a system that you build things on top of, and that's the purpose of it. You don't download ProcessWire to start publishing content in 5 minutes (even if you can), but rather to build a site or application. So ProcessWire is much more of a tool to accomplish some end means, rather than the end means itself. ProcessWire and WordPress are completely different animals in this area (opposites really), and I think it helps to explain why you can't assume that WordPress and ProcessWire would be considered in the same light via the GPL. I think the GPL is flexible enough to handle both. That's not to say we might not switch to MIT in the future, just to avoid even having to talk about it. But I prefer to stick with GPL at this time. When it comes to my own commercial modules, I still consider them open source for the users that have them, and any fees paid are for access to and support of the product. The 1-year timeline applies only to support. You can continue using the products as long as you'd like.
  8. These are styles, not semantic elements. Most of the time, these are exactly the things you don't want your client editing. Determining these things is part of the design process and its the designers job to come up with a typographic system that maps styles to these semantic elements. It's not a limitation, but rather a great thing for the client and their content presentation. Here are the things the client should determine: paragraphs headlines and what level of headline (h2, h3, h4, etc.) bulleted lists numbered list emphasized text (strong, em) contextual links contextual images, if necessary block quotes, if necessary possibly others if called for by the content (definition lists, tables, subscript/superscript, etc.) Note these are all things that say "what" the content is, and not "how it looks". The client should know that when they input content, it will look good and consistent with the overall design system. The designer has already determined the sizes, colors, line heights, etc. for all of these things, and they are defined in the stylesheets. If the site goes through some redesign at some point in the future, all that existing content will be restyled without any edits to the content itself. If you can convince them of the benefits and to use it, then yes. It's hard to beat the long term quality and portability of content kept in markdown or textile. However, I think a well configured TinyMCE/CKEditor (configured to focus on content, not style) is preferable to most clients I've dealt with. You can change it to a plain textarea by going to Setup > Fields > body > details > Inputfiled type > select "textarea". I'm a little embarrassed to link to this because my website is so old and broken right now, but I think the content is relevant here: http://www.ryancramer.com/journal/entries/cms-design-longevity/ (keep in mind this is from 5+ years ago, and my site is a bit broken at the moment).
  9. Your code for setting the language based on the domain looks good. It should be fast, and fine to include in every page. If you wanted to set it to the session, then you would just do something like this (though it's really probably not necessary): if($session->language) { $user->language = $languages->get($session->language); } else { // determine language from domain // ...your existing code here, then... $session->language = $user->language->name; } I don't understand the issue you've mentioned with the homepage. Since the language is being determined from the domain (rather than the path), it really shouldn't matter what page you are on. Is it possible that you've got your output code happening before your language-determination code? Reading your message again, you mentioned that you only had the language-determination code on your homepage? You should really put it in every single template, via a common include (perhaps using $config->prependTemplateFile option). Let the language be determined on every request, regardless of page. There's no guarantee that traffic will always arrive via the homepage, not to mention the potential SEO issues with assuming that.
  10. I had experimented with text-stroke here too, but at least in OSX, it just made the text fuzzy. It didn't seem desirable at all, at least as a cross platform solution. Last I heard, Arimo was looking good on the PC at current font sizes? Is something like text-stroke needed to increase legibility on the PC? The text looks a little fuzzy in both of those examples in the screenshot (maybe from jpeg though), especially the one with the text stroke.
  11. Teppo is correct. Fancybox has IE issues (though wasn't aware it affected IE8 too). You may want to switch to the dev branch if this issue is affecting you, though we are dropping support for IE8 in the new admin theme. In either case, you really shouldn't be using IE8, just for your own security and sanity. IE is now at version 11? Though I'd recommend going for Chrome instead if you can.
  12. I'm assuming your entries have been converted to pages already. Try editing one of those pages and making sure that its category field is consistent with what you expect. If all looks good there, it just comes down to regular PW API selection of the pages that you want. In your case, if you wanted to list the pages in category 'mats' you'd have API code something like this: $entries = $pages->get("/submissions/")->children("category=1018"); Using the ID directly like that "1018" may be efficient, but isn't usually very readable, so you may prefer to use a selector like "category.name=mats" or "category=/categories/mats/" or whatever suits your particular case.
  13. User creation is an administrative task, so if you need non admin/superusers to create users, you'd probably want to create your own form to do it. It would be relatively simple. Creating a user from the API is as simple as: $u = $users->add('username'); $u->pass = 'password123'; $u->addRole('example'); // optional, if role other than guest needed $u->save(); From the sounds of it, you don't want to create actual PW users, but maybe something like them using pages. You could certainly do this (perhaps mapping them all to 1 single PW user behind the scenes). However, I'd encourage you to use PW's users. There is a roles system that is designed to separate users, so the typical way to maintain this separation is by role assignment.
  14. Regarding the page-publish permission, this is an optional one. Most PW installs simply don't need it. When there is no "page-publish" permission installed in the system (which is 99% of installations), it is assumed that if you can edit the page, you can also publish it. If clicking the "publish" button doesn't remove the unpublished state of the page, I would look to a potential database or server issue, as that particular issue has not been reported before this thread. Or as Teppo mentioned, it could be admin theme related (?), so it'd be worth testing out on the default admin theme to be sure. If the issue persists, please post your PW version, MySQL and PHP version and any 3rd party modules installed.
  15. Make sure you have URL segments enabled on your "home" template. This is in Setup > Templates > edit: home > URLs. At the top of your home.php, you should then be able to have something like this: <?php if($input->urlSegmentStr) { $name = $sanitizer->pageName($input->urlSegmentStr); $category = $pages->get("/categories/$name/"); if($category->id) { echo $category->render(); return; } else { throw new Wire404Exception(); } } The other side of it is making sure that your category pages have their $page->path and $page->url calls represent the location you intend. You can do this with a hook. You'd want to add this in your /site/templates/blog.inc file. wire()->addHookAfter('Page::path', null, 'hookPagePath'); function hookPagePath($event) { $page = $event->object; if($page->template != 'category') return; $event->return = "/$page->name/"; } Also for these examples, don't just copy and paste them. Go through line by line to understand how they work, as you may need to modify them specific to your case.
  16. When you say that the editor doesn't appear, can you clarify? Does that mean you see nothing but a white page? Or maybe you see a plain textarea rather than a rich text field? Or just no field where there used to be one (as if it didn't exist?) Looking at the SQL error, do you know what language ID is 1160? I'm wondering if that might be your default language. It looks like you have the LanguageSupportPageNames module installed, just wanted to confirm? How many languages are installed? Do you have any other 3rd party modules installed? Lastly, you mentioned upgrading to dev, but do you know what version of dev? If you aren't sure what version, I may be able to tell if you know approximately what date you grabbed it.
  17. I think that the date format has to have a delimiter somewhere (hyphen, slash, period or anything). ProcessWire assumes that a string of digits is a unix timestamp, so it's probably getting confused. I don't think we have a way of supporting a purely digit based date format. If you have that as your output need, you'd probably want to keep the date output format as unix timestamp, and then just use PHP's date() function on your front-end output.
  18. Cloning seems to work for me. I did recently commit some fixes to cloning, which I think was in 2.3.7, so it sounds like you have the current version. Any other factors that accompany the pages you are trying to clone? For example, are you using any multi-language fields or language support? Are there any 3rd party modules? Do the pages have children or no children?
  19. It's possible for it not to work on an Apache server too, if unzip isn't installed (which would be unusual) or if exec() is disabled (more common). There's also a chance unzip just isn't in the executable path on your server. You might see if you can locate where unzip is on the server.. it would usually be /usr/bin/unzip or /usr/local/bin/unzip. If you can login via ssh, you might be able to find it by typing "which unzip". Anyway, once you know where it is, you can take this line from /site/config.php: /** * uploadUnzipCommand: shell command to unzip archives, used by WireUpload class. * * If unzip doesn't work, you may need to precede 'unzip' with a path. * */ $config->uploadUnzipCommand = 'unzip -j -qq -n /src/ -x __MACOSX .* -d /dst/'; and prepend it with the server path: $config->uploadUnzipCommand = '/usr/bin/unzip -j -qq -n /src/ -x __MACOSX .* -d /dst/';
  20. Actually you should be able to use "children.name=tarjetas", but I tested it out here and it behaves the same as "parent.name=tarjetas", so that is a bug. Looks like this is the first instance I've seen of needing to use something other than children.count. I've now fixed it, but am doing a little more testing locally before committing to dev.
  21. asmSelect doesn't support keyboard input. How are you typing in numbers?
  22. There are limits on field options no matter what route you take. Even a plain Select inputfield has limitations, in that it can't scale to thousands of items. The best bet is to find the solution that can select the pages you need to be selectable, then determine which of the available inputfields to use. There are lots of inputfield options in part because they aren't always interchangeable... each has their strengths and weaknesses.
  23. Part of the goal with rich text editors (and LMLs even more) is to place limitations upon the input in order to maintain quality and consistency. ProcessWire's TinyMCE and CKEditor come configured to focus purely on portable and semantic markup. Once you start introducing non-semantic things in the markup like inline styles, colors, arbitrary font sizes, etc., then your content is no longer semantic or portable. It becomes essentially anchored to your current site design (if you are even that lucky with the client). You'd likely have to go back and make edits to all those fields the next time the site is redesigned. An even bigger problem is that when you give clients the tools to do these kinds of things, they start to get creative and think of it as an art project. But they blame you 1-2 years later when their site no longer looks professional. CMS control of style in text output ensures degradation of consistency and quality of output over time. For these reasons, you usually want to keep your content management tools (and especially rich text editors) focused purely on semantics of content, and as far from style as possible. This is one reason why I think front-end inline editors are a bad practice, as they keep the focus off the semantics of the content and on the subjective aspects of how it fits the area. Let all the style aspects be handled the site designers, in your front-end CSS stylesheets that accompany the site's design. If you still want to inject style, Hanna code is not a bad way to go because it does at least introduce some separation of concerns. It still leaves the content semantic, even if the underlying Hanna code isn't. If the site is for your own use and you are okay with the compromises, then both TinyMCE and CKEditor can be configured to let you do nearly anything you want. I'm not an expert on how to configure them that way, but if you look at the demos at either site, they have "all options enabled" configurations you can see and these configuration options can be duplicated in PW. Lastly, a plain textarea field (no rich text editor) on it's own also works well for just regular HTML input. This is what I use when I do need something that lets me copy and paste HTML directly, though it's something I'd only do on a site where I'm the only admin/editor (at least for that particular field).
  24. No, it's also more efficient (technically faster) on the front-end. It's possible, but you'd have to go in and add them directly in MySQL using PhpMyAdmin or the like, and update the module's code to recognize your new field. Probably not. While the database could handle millions of rows, the admin side won't be able to handle displaying millions of rows in the same page editor. It would be the same issue as with using a repeater, at least from the admin display aspect. Though this solution could technically serve a lot more rows than a repeater could. It would not be as scalable as using pages, simply because everything around pages is already designed in consideration of scale (limits, pagination, selective loading of fields, etc.). Pages are certainly more resource intensive, but those resources go towards making them scalable.
×
×
  • Create New...