Jump to content

SiNNuT

PW-Moderators
  • Posts

    1,011
  • Joined

  • Last visited

  • Days Won

    8

Everything posted by SiNNuT

  1. Only had a quick look but a really nice job Soma. One thing, and maybe this is just me, but the horizontal menu requires a click to show the dropdown items. That's fine, but i would expect it to close the open dropdown if i click it again, but it doesn't, it only re-opens the already open dropdown. You need to click outside for it to close. No big deal but to me this behavior was unexpected.
  2. Indeed, you have to setup apache vhosts and your OS hosts file to match.
  3. Yep, been doing this for a while now as well, and never looked back. It just saves you a lot of headaches.
  4. I'm far from a guru (but pete probably is ) but glad to be of help sometimes. I'm sure you are more than capable of googling PDO, but i wanted to mention there are some good intro/tutorials around like this one http://code.tutsplus.com/tutorials/php-database-access-are-you-doing-it-correctly--net-25338 It's really not hard once you get the concept.
  5. Using SQL I can select rows using "DISTINCT", for example if I have 100000 rows with different IP addresses, I can count all the distinct IP addresses in a table (or field) with a single SQL query in a split second. To my understanding to do this using the api and selectors I would need to foreach through every single page, which is mighty memory intensive and slow. Correct? Yes. 'distinct' and 'group by' like functionality can't really be done very efficiently using the API. So if, like it seems in this case, we're talking about lots of rows/pages/fields you probably want to use an SQL query instead of the API. A google search like "site:processwire.com/talk sql distinct group by" will give you some interesting threads on the subject like, http://processwire.com/talk/topic/2047-group-by/?hl=unique#entry19148 and http://processwire.com/talk/topic/2038-distinct-selector-in-processwire/ If so, I still have a need for direct sql queries, even if using pages rather than custom tables. I've searched for examples of how to do these and gather the $database var is used, but there don't seem to be any clear examples of connect, insert, select etc using PDO.Can someone point the way if such exist? Do I need to "connect" or is a connection already available, is this what $database represents? Yes, $database gives/creates a PDO instance from ProcessWire $config API variable, like this (from wire/core/WireDatabasePDO.php): $database = new WireDatabasePDO($dsn, $username, $password, $driver_options); So the connection part is easy, $database is always available. From there on you can just use a 'select distinct' query and PDO (such as the example Diogo mentioned). Just as well for inserts, deletes etc. I don't think this i specific to PW, it's just SQL/PDO Of course when you use PW pages you could easily use the PW API to handle all the stuff it is really good at, and just use some direct SQL queries where you need it. When using pages make sure the fields you connect to say a 'logentry' template are unique to that template. This is because a field table only contains a pages_id reference and it's data, and it would need a more complex query if the table contained data belonging to other templates. Then there also is the option to create you own fieldtype/inputfield, let say FieldtypeLogentry. This way you can have one field hold as many columns of data you need and it would be only one database table. I haven't yet created a fieldtype/inputfield myself but i've heard say that it's not that hard. Anyway, lots of options, just choose the best according to your needs and data(base)structure. If a custom table works best for you, go for it.
  6. SiNNuT

    Lister

    Very impressed by this video! Lister will be an awesome addition to any site but it seems extremely useful for sites that got a lot of content.
  7. You can always ftp/download all the files and folders to your computer a just do a quick 'Find in Files...' with Sublime Text, Notepad++, or any search tool you've got available. beaten by DaveP
  8. High five, putting those settings in config.php seems to have solved it for me as well.
  9. On the subject of limiting the default PW admin user interface to only show users their own content in some way i can't help you. Maybe others have solutions. But this does sound like you might indeed want to make a 'front-end' system, where a member can login and manage and create their content. You can still use all the power of the PW api, to store the content (pages), users etc. Creating a member role and giving it only the page-view permission will keep them out of the PW backend but this will allow you to use the API to do stuff with roles. You can add as many roles and (custom) permissions to that roles, that you might need for your frontend system. On this subject i once wrote a simple example http://processwire.com/talk/topic/2937-creating-a-front-end-admin/?p=28954 This might help some. Of course, making you own admin basically, will require work, coding skills and a good understanding of (the) PW (api). More knowledgable users will be able to answer more specific questions on this subject.
  10. Let me know you that goes for you, because i am just in the middle of these issues on a Ubuntu server myself and by the looks of it setting these options in config.php does not seem to work but i'll give it a couple of days more.
  11. I believe in one of the posts about session files not getting deleted Ryan mentioned that the database session handler also relies on the native PHP garbage collection. On some Ubuntu servers, with default settings php gc does not run. Maybe you're on a ubuntu server as well? http://processwire.com/talk/topic/5787-sessions-thousands-of-them/?fromsearch=1
  12. Yes, and that's where javascript (jQuery, plain js or other libraries) comes in. On the home page you use PHP and the PW api to list all of the Left column and all of the Middle column, with some correct markup for javascript to do it's magic (step 1). You then use javascript to hide/show the content of the Middle column based on which anchor link is active in the Left column (step 2). The link i posted shows you an example of how to do such a thing. I can't provide you with a copy paste solution, but it in essence just a php foreach (using a PW selector) and some basic jQuery.
  13. In most scenarios i think it would be wise to set up the categories as pages somewhere in your tree. categories (basically a container page) -category1 (using a template with for example a title field for the category name and a field for the category info) -category... -category12 Then on your homepage you can just foreach over the needed content. It sounds like you want to make some kind of vertical tabbed content area, where the tabs(basically just an unordered list in your left column) hide/unhide their info text when clicked. This is done by javascript. I wouldn't bother with ajax loading if the info content isn't that big. Maybe try googling for something like http://designm.ag/tutorials/building-vertical-tabbed-content-with-jquery/
  14. The http://modules.processwire.com/modules/all-in-one-minify/ does output minification. Use it myself a lot. If it suits your work-flow there's a lot more goodies you can use it for.
  15. Do you mean some kind of "did you mean" list of suggestions a user sees when they get the 404 page (in the frontend), based on the url they tried to access?
  16. What's stopping a client from opening devtools? If clients care enough to look at source code and actually base an opinion (negative or positive) on that, i think they are well aware of optimizations like minimize and they actually applaud you for that, or you could tell them: "we minimize (and concatenate) the output for optimal performance, especially on mobile". Keeping cr/lf in there seems an in-between, for no real reason. To me minimize means minimize, but to each it's own i guess.
  17. Doesn't this kind of defeat the purpose of minimizing your html? If you want to look at nicely formatted source every browser nowadays has a good or decent devtools/inspector.
  18. Looking good. Reminds me of ST3, but there seems to be a good filosophy and infrastructure behind it.
  19. Definitely, but also check out the h5bp .htaccess There are some of the same rules but also some other nice stuff.
  20. Nice site. One comment; the logo doesn't really scale nicely upon resizing the screen and on bigger resolutions some artifacts appear. For example when viewing on 1920x1080 Win7 Firefox 27.0.1, it's not really crisp, and some artifacts beneath some of the letters: Google Chrome and IE do a better job, but still not great.
  21. Yep, easily one of the most useful PW modules around. It fits great into my workflow, and now with version 3.0 and the added LESS support it gets even better. Keep up the good work! PS Have you guys considered adding Autoprefixer support to the module (maybe as an option)? I'm not sure if this is easy to implement but it saves people the hassle of writing all kinds of vendor prefixes in their CSS, and instead just automatically takes care of this.
  22. I would vote against making this standard. It isn't neccesary for w3c validation and actually, using title attributes on links is fairly problematic and i don't think good practice at all. http://blog.paciellogroup.com/2013/01/using-the-html-title-attribute-updated/ http://www.rnib.org.uk/professionals/webaccessibility/wacblog/Lists/Posts/Post.aspx?id=38
  23. I don't think that's what Nico is talking about pwired. I think it's about getting your webserver to send compressed html/css/js over the line via mod deflate or alternatives.
  24. Not really a PW thing. You generally enable this via your server config. Have a look at the html5 boilerplate server configs https://github.com/h5bp/server-configs
  25. Do you want to find something in a set of 10.000 pages or do you mean a find result of 10.000 items? Searching in 10.000 pages isn't a problem, PW is really fast. But if there are a lot of possible results it's generally advised to limit the pages->find call to 25, 50 or another sane value. http://processwire.com/api/selectors/#limit . If you want you can combine this with pagination. The reason for this (others can prolly explain better) is that the pages->find call will return a PageArray that gets put in memory and if there are a lot of pages in the array things will inevitably slow down. Of course, depending on the situation, 'slow' in PW terms may still be acceptable. I have grabbed hundreds or even thousands of pages in one go and it still performed pretty well.
×
×
  • Create New...