Jump to content

ryan

Administrators
  • Posts

    16,772
  • Joined

  • Last visited

  • Days Won

    1,530

Everything posted by ryan

  1. Thanks Soma, I can reproduce that. I was not using a segment for my default language, so hadn't noticed. It should be fixed on the dev branch.
  2. Big thanks to Mats for the alltpaoland.com example and his clustering updates to my RCDMap class. With these available, I was able to learn enough (and admittedly copy enough!) to make the map project come together: http://www.synbioproject.org/library/inventories/map/ ... my code is a little messy, but it all works for the deadline, and I can go clean it up later. Beyond Google Maps, tools used here are jQuery Mobile, ProcessWire 2.3, ImportPagesCSV module, and ProcessWire Form Builder (for the add/edit map submissions). Thanks again Mats! I don't think I could have made much progress without your alltpaoland site as an example/guide.
  3. No the session should still be active even if they close the browser. Now if they completely quit the browser, that might be different.
  4. It sounds like what you want is instead the MySQL login info? If so, you can put it in a .my.cnf file in your home directory: /home/samuel/.my.cnf [client] user=your_mysql_username pass=your_mysql_password Following that you can access the mysql/mysqldump clients without specifying a username or password. This is helpful for automated backups or [i'm guessing] git based workflow.
  5. Don't worry, I understand. No need to explain, we're all on the same $page. Just trying to make sure I follow up good questions with good answers.
  6. When/where are you guys seeing the 'guest role required' message? Just wondering if this is something that should be fixed in the core ProcessUser module? I guess I haven't noticed this before.
  7. Don't count on the editor though. Make sure you are sanitizing at the server side with HTML Purifier. Rich text editors like TinyMCE and CKEditor don't do any server-side sanitization (they can't, since they are JS apps). So while it may look like they are sanitizing and validating, they can be bypassed easily.
  8. Nice job Soma! Lots of good thinking here, and I like where you are going with the scalability. I look forward to seeing this in the modules directory.
  9. You can go even shorter if you want to <title><?=$page->{'alt_title|title'}?></title>
  10. I'm not sure that I understand exactly what you are trying to do with asmSelect? But it is fairly straightforward to replace the "add new page" process. To do this, copy the existing /wire/modules/Process/ProcessPageAdd/* to /site/modules/ProcessPageAddLuis/. Then rename the class and filenames to ProcessPageAddLuis. Now login to your admin and install the ProcssPageAddLuis module. Then navigate in the tree to Pages > Admin > Page > Add New Page. Edit the "Add New Page" page. Change the "process" field from ProcessPageAdd to ProcessPageAddLuis. Save. Now edit your new module to work how you want it to. It should be safe through upgrades as well.
  11. @adamspruijt it looks like the download link is broken on the http://modules.processwire.com/modules/metro-wire/ listing. Could you update it? Thanks, Ryan
  12. This is what I'd expect to see. This is kind of a mystery, as the language pack shouldn't make any difference here. I'll have to experiment and see what's up. I was going to go take a look at the MetroWire theme, but looks like it's no longer available for download. I'm getting a 404 when clicking the download link: http://modules.processwire.com/modules/metro-wire/
  13. I've added an httpUrl() function to the Pagefile class on my local dev copy, so this should be appearing on the dev branch soon. Ideally there should be a corresponding httpUrl() function anywhere there is a url() function.
  14. Uniques aren't officially supported by that fieldtype, so it's a bit of an unknown. But I would think we should be seeing an exception thrown (and error message at the top of your screen). Do you see anything related in your /site/assets/logs/errors.txt? Can you try switching back to the default admin theme, just in case something about the theme is causing an error to be suppressed.
  15. Looks good Luis! Thanks for making this. One suggestion I would have (for now or a future version) would be to remove the dependency on a field named 'body'. Not everyone has a field named 'body', and others may have one or more other textarea fields they want to use this module with. So you could take an approach of finding all the textarea fields using TinyMCE and make them editable from your addDivs method: foreach($page->template->fieldgroup as $field) { if(!$field->type instanceof FieldtypeTextarea) continue; if($field->inputfieldClass != 'InputfieldTinyMCE') continue; // if you reached this point, this is a field that can be made editable }
  16. Does your name "Hairygit" have anything to do with Git? I figured it did at first, but since you say you don't use Git…
  17. I would say that the blog profile is not the best place to start. It uses more advanced techniques and was designed to be a demonstration of them– These are techniques I don't even use in my own site development, but felt like we needed a profile that would appeal to those looking for a dedicated MVC strategy. The best place to start really is the basic profile that comes with ProcessWire. When you understand that, you really can build anything. If you are wanting to go further, you might like to look at the skyscrapers profile. But the important thing to remember is that there is no "right" way to build your site in PW. This is why even tutorials can be a mixed blessing when you are learning, because they reflect one approach that may not necessary be the right one for you. Beyond the basic profile, you just need to read $page, $pages, PageArray and about Template files. Ignore everything else, because you may never need it. Don't feel like you need to remember or understand everything on those pages. But read through them and make note of what's there. These pages cover 99% of what you will do in ProcessWire from the code side… and probably a lot you won't ever use too. Once you get going and developing stuff, you'll want to keep the Cheatsheet open, which has sections that cover what's on those links above more succinctly. In ProcessWire, you should be comfortable with HTML markup and CSS. But it's less important that you know PHP. You only need to learn a few basics. You really don't need to know any more than you need to know EE tags. Know how to get in and out of PHP from HTML markup. i.e. <?php ... ?> Know what a $variable is – just a place to store a value. Most ProcessWire API functions return a value. Know how to use an if() statement. In PW, you'd use an if() to test if something had a value you wanted to output. Know how to use a foreach(). In PW, you'd use a foreach() to cycle through a page's children, or the results of a $pages->find(...). Know how to output a value, whether: <?php echo $value; ?> or <?=$value?> …both do the same thing. Know how to use include() to include another file, i.e. "<?php include("./header.inc"); ?> I think that covers all you would have to know to do most things from the PHP side in ProcessWire. Can anyone think of anything major I'm missing? Lastly, when you are developing, enable debug mode in /site/config.php: $config->debug = true; This will ensure that you get helpful error messages rather than ambiguous ones.
  18. I actually find it rather difficult to believe that they would go beyond simply disregarding the links (devaluation), and instead make those links actually penalize the site being linked to. It seems like it could be very easy to mistake devaluation for a penalty. Is there any real evidence? If I was showing up first for some term, and then was off the map, I can see how it would look like a penalty. Yet, the math behind it might not involve any penalty at all, just a devaluation of those links from the equation. Wouldn't this be hugely open to abuse? Creating an entire new industry of SEO of hurting competitors by linking to them? After all, it's incredibly easy to create a bad neighborhood of sites, but incredibly hard to create a quality site. I don't claim to have insight on Google, but it seems silly and unsustainable for them to give bad neighborhoods this level of control and manipulation potential. If you guys are right about this and there is testable proof, then my inclination would be to remove ourselves from the picture and simply not have links. The attribution text is ultimately the most important part. People can find ProcessWire on their own. Though this all seems rather silly, as the point of the link is to be a convenience to the user so they don't have to go find it themselves. But I would want to see actual proof before acting upon it. I suppose we could always link it to a Google search for "ProcessWire" too. If some site has a lot of other sites disavowing its links, I can see that as being a penalty factor for the site doing the linking. That would be understandable. I would not have guessed it could go the other way around. I think your proposal is actually very good. It solves all of my concerns. Thank you for the suggestion and idea. Admittedly, I'm now feeling like I need to do more research, but if what you guys are saying is testable and proven, then I'm more inclined to prefer just text attribution rather than a link. We do have a class of modules called Markup modules. This module idea would fit well within that segment.
  19. This is essentially the same thing as clicking a field name while in the template editor. It opens a modal there, but it's the same thing (template-field context).
  20. You probably want to hook the method via something like this in an init() function with an autoload module: $this->addHook('ProcessPageAdd::getAllowedTemplates', $this, 'myHookFunction');
  21. You might also want to check out the Blog profile, which uses views for output (stored in /site/templates/markup/*.php)
  22. Also to alter the order they display in. One requirement I had for the blog profile is that it should be something that one could get going with and not have to touch code at all (like WordPress in that respect). So the widgets had to be defined in a manner that could be controlled in the admin rather than just the code.
  23. That's right API key isn't necessary with v3. Can you attach the full code? I think there is probably something about the larger context that we're not seeing, and that's most likely where the problem is. But before you do that, enable your Javascript console and see if any error messages are being reported. I am guessing there is a JS error that will answer what the problem is.
  24. Sounds like you already had a page installed called Setup > Languages. Was it for something else? I am guessing there is some other Languages module installed that is preventing installation of the core LanguageSupport module. You may need to uninstall that module before you can install Language Support.
  25. I think this seems like a fine method. There are some users/access modules that you might find helpful, particularly the Page Edit Per User module, that does something very similar to what you are doing. Though your application sounds pretty comprehensive and involved, so you may find any of these modules more as starting points or educational examples rather than complete solutions. Yes. I don't understand the question. But it shouldn't matter where you save the page from. The save() function should always behave the same way. The idea of a "parent page" is purely for structure and doesn't have anything to do with whether a page is viewable. Well, except for access control. If the parent's template defines access and the child's template doesn't, then the child page inherits access from the parent page. I think so, but you are writing about something in-between working directly with an SQL database and working with ProcessWire, so there is some ambiguity there–I don't follow everything you are saying. The API is how you accomplish everything from the code side in ProcessWire. When you know how to put the API to work, you can really automate quite a lot, and accomplish almost anything. What would you use to intercept actions then? GET/POST vars? I don't think there's any problem with using URLs. Avoiding URLs doesn't improve security in any manner I can think of. You'd want access protection either way. Requests that make changes to a database should be POST based, and requests to present information should get GET based (whether using URLs, URL segments or GET variables). ProcessWire includes helpers for doing pagination. Here is more about pagination. Yes. Though most likely you'll call it something other than $page, since $page is the API variable for the currently viewed page. ProcessWire doesn't use a tag-based system, but of course they are very easy to implement for your own use. You might want to look at an existing tag engine like Twig or Smarty. Though if your needs are simple, a preg_match_all() with str_replace() is a reliable way to implement a simple tag engine. However, you may want to evaluate whether a tag engine is really necessary. PHP can do the job faster. So it really comes down to whether writing ":!:first_name:!:" over "<?=$first_name?>" is worth the overhead of a tag engine. One other thing I want to mention overall, is that this sounds like a completely custom application that may potentially be better suited to a full blown framework like Laravel. ProcessWire is both a CMS and a CMF, so it'll certainly do just fine with anything you can throw at it. But I'm questioning whether you need a CMS at all here, as it really sounds like more the territory of a dedicated framework. Personally, I would still build it in ProcessWire because that's what I work in. But you'll find a support system more focused on developing larger custom applications of this sort when working with a dedicated framework. You may still find ProcessWire to be a better fit for what you are doing, but do look at dedicated frameworks just in case.
×
×
  • Create New...