Jump to content

dragan

Members
  • Posts

    2,007
  • Joined

  • Last visited

  • Days Won

    21

Everything posted by dragan

  1. I'm sure that would be easy to do, e.g. in a "readme" file. But generally speaking, just have a look at the template file(s), and all the include / require files, and that should give you a good overview of "what happens where".
  2. This is a bit ambiguous. Do you want to create a new page for each CSV import? Or do you want to update existing pages (= update fields for already existing PW pages)?
  3. I'm not aware of some plug-and-play frontend examples*, but it's definitely possible. http://php.net/manual/en/function.fgetcsv.php If you're familiar with the PW API, then creating pages, or updating existing pages / fields should not be too complex. * there's the excellent "import from CSV" module, but that only runs from within the PW backend. http://modules.processwire.com/modules/import-pages-csv/
  4. I'd try to clear the browser cache (and logout/login again), and/or update to latest stable version, and/or run some sort of browser dev tool to see possible JS errors / warnings. (and maybe even trying to access the backend with a different browser altogether)
  5. dragan

    Pet Peeves

    What are your personal pet peeves, when it comes to general web / online / digital stuff? I'm gonna start with one of my most-hated "features": lazy loading technique taken too far (as in "load images / assets only when the user scrolls down") The general idea behind it was certainly fine and noble: Load + show additional content only if the user decides to scroll further down a page, otherwise hide that content. Avoid having to wait for content loading that I might - or might not - be interested in. Problem is, that some site-owners not just use, but abuse that method. Case in point: Flickr. It's almost impossible to reach the footer links / menu, because the page keeps loading new pics forever. You may see the footer for a split second, but it disappears again, when addtl. content loads. What's wrong with using pagination? Is that too "old-school"? Making it hard for visitors to reach a certain navigation section is certainly not "best practise", or user-friendly. Some sites have simply exaggerated it to the point, where I'd rather see a "skip intro" button (and that's saying something!). So, what's your favorite pet peeve, when it comes to websites, apps et al?
  6. You can save variables to the page array easily (without having to create input fields first). $page->setOutputFormatting(false); $page->food = array('apple','banana','orange','grape','pasta','sandwich','bread','coffee'); $page->save(); $page->setOutputFormatting(true); echo "<b>Shopping List:</b><br>"; foreach($page->food as $f) { echo "$f <br>"; } You should be able to call such a var from any other tpl / page then, as if it was a tpl-field: $foo = $pages->get(345)->varname. Maybe that way you can store these calculated values for further use in the list?
  7. I know nothing about Twig, but that piece of code you posted looks like Wordpress code. Are you sure you're in the right CMS forum?
  8. Before actually starting to code, I would decide if some sort of login is necessary at all. If anyone can create wishlists, you'd probably want to use cookies. If there's a user-login, you can store the items in the DB, i.e. in a custom user input field. (comma-delimited id page list reference, or JSON).
  9. Yeah well, to paraphrase an old adage... Give a man a fish, and he'll have food for a day. Give a marketing exec a CMS, and he'll ruin a site in no time. We're really not responsible for a) the look and b) the actual content. (some translations are an atrocity... guess it's all done in-house or with housewives who do a bit of hobby translation on the side...)
  10. you can add include=all in your selector For mass-editing stuff like hidden / published etc., use the Batcher module.
  11. I've never used repeaters myself, but if these were "regular" input-fields, I'd just add a text- or textarea input field to the template(s). Inside these, the editor could list the fieldnames (separated by comma or linebreak), and this would dictate the placement / order of fields in the template. Convert the "fieldOrder" from text to an array, and just output them in that order in the tpl. Certainly not as elegant as drag-and-dropping fields in the admin edit area, but simple enough. I'm not sure though how to access / adress repeater fields though, so that might or might not work for your scenario.
  12. A new PW site has just been launched: http://www.seifertsystems.com A teamwork with Beat Beer (frontend development) We had no influence on the visual design / layout. We had to maintain the visual look of the old site. But "under the hood", the markup changed a lot (for the better). The main functions / tasks: Transfer from old CMS (MODX Evo) to ProcessWire. Not everything could be exported / imported via script, due to the old site using a very clunky multilingual system (YAMS). Dynamic product catalogue, with main categories, and product type groups. Automated product catalogue import for all four languages (from MS Excel, import to PW via CSV import modulue and various API scripts). Compact products overview and detail product infos. (accessible tabs) Fully responsive - compatible with laptop, smartphone and tablet displays. Dramatical markup clean-up (HTML, CSS): resulting in much faster loading, and overall smaller filesizes (less than 50% of the old code). Usability, accessibility and SEO improvements. Multilingual setup (german, english, US-english, french), partially custom content per region / language. PW 2.3.2 multilang setup, geoIP for certain geographical filters / redirects. Newsletter 3rd-party app integration. = Mailchimp. Frankly, while it's OK, the possibilities for other languages than english are quite limited. Same goes for styling the signup CSS. But hey, it's free for up to 2000 subscribers or so... Faster loading and much more user-friendly for both site-visitors and site-admins. Hint 1: When using CKEditor, there's a setting "render WYSIWYG only on focus". Hint 2: There a setting to keep empty fields collapsed, when the field is empty. Dynamic XML and HTML sitemaps. XML: For all visible and published pages, for all four languages. HTML: One for each language. Image galleries and slideshows. (Shadowbox + jQuery Cycle plugin) Search with coloured keyword highlighting on the result pages. News section with publishing scheduling. i.e. create pages (news-items) in advance, and set publish and unpublish dates - simply by adding two datetime fields and an appropriate selector in the templates, e.g. $t = time(); $latestNews = $pages->find("parent=1108, limit=4, sort=sort, include=hidden, publish_start<'$t', publish_end>'$t'"); Main PW tools used: Batcher XML Sitemap from demo install (with a tweak, to collect all four languages, and sub-pages inside hidden folders too, all in one single XML) MarkupSimpleNavigation module Language Field Tabs FormBuilder Import Pages From CSV module Modules Manager Page Edit Fold Status module + various pieces from PW demo installs / profiles But by far, the biggest godsends were the great API, the terrific multilang PW functions of v. 2.3.2+, the good documentation, and the great community help here. The difficult parts were not really technical issues, but having to wait endlessly for content, getting new change requests almost daily, and putting up with several launch delays. We seriously didn't believe that we could launch it still in 2013. What may lie ahead next year (or not), is Googlemaps integration and dynamic PDF generation for product sheets.
  13. frontpage bottom right: change to frontpage bottom left: should better be:
  14. Can you post a real-life example of such a query? What's the reason you query mySQL directly, what kind of scenarios?
  15. I'd simply add a textarea field in your templates, and check if there's any content, e.g. if(strlen($page->extraJS) > 3)) { echo $page->extraJS; } And in that field, either enter the JS code. Or, if the JS files are already in your site/templates/scripts/ folder, just specify the .js file-name. if(strlen($page->extraJS) > 3)) { echo '<script src="' . $config->urls->templates . 'scripts/' . $page->extraJS . '"></script>'; }
  16. Well, that's what I meant. I replaced it.
  17. I tried to upgrade from 2.3.0 stable to the latest dev version, but got this error msg: PHP 5.3.22, PDO enabled (double-checked in phpinfo() and my hoster) I have only overwritten the wire-folder. When I was updating 2.3.0. to 2.3.2 it worked nicely. Do I have to install it as a completely new PW site, in order to use the latest functions (especially field dependencies) ?
  18. Just a little word of caution: It only works "out of the box" with the PW default language. If you have a multi-language site, all alternative languages have to be updated seperately. I've been importing and updating product pages for a 4-language site the last couple weeks (you know... clients' deadlines are always very flexible...). It's also possible to write PHP code directly in your Excel sheets, copy and paste it into a text-editor, and run the script just once. Just make sure the field-name arrays and field-value arrays always match (hidden rows in Excel are the devil - they get exported to .csv as well). With 50 or 100k products / pages, it's a good idea to add set_time_limit(), or split the data in chunks... http://php.net/manual/en/function.set-time-limit.php
  19. You could try https://code.google.com/p/php-excel-reader/ Or convert the XLS to CSV, and use default PHP CSV functions to import / parse the data. http://php.net/manual/en/function.str-getcsv.php Depending on the number of imports and the number of different templates / fields, you could write a few lines of PW API code. It's quite easy to copy and paste Excel fields and convert to PHP arrays. Simple example: $f = array("height","width","thickness","weight","price"); // field names $v = array(38,75,3,220,10); // field values $id = 123; // page id $myPage = $pages->get($id); $myPage->of(false); foreach($f as $k=>$v) { $fld = $f[$k]; $myPage->$fld = $v; } $myPage->save(); It's also quite easy to update a whole bunch of pages with one script (e.g. define a parent and/or template in the selector).
  20. On a somewhat related note, I was looking into (standalone) browser-based file-managers, and found this gem: http://elfinder.org/ It's got an API, drag-and-drop goodness, archive creation / extraction functions, and instructions how to integrate it in tinyMCE + CKEditor. Gonna play around with it this weekend...
  21. if (file.name == "justinbieber.jpg") { done("Naha, you don't."); } The dropzone guy has clearly a sense of humour...
  22. Thanks Ryan. I completely overlooked that tab in the image / file fields.
  23. I have a (somewhat) related question, so I thought better to ask here than creating a new thread... Is it possible to make the image / file description field multiline? i.e. textarea? I'd like to create a simple way for logged-in users to look at images and Flash files and add comments (in the frontend, via API). A second text-field wouldn't be necessary - as long as I can add linebreaks for feedback / remarks in the existing default desc. field.
  24. Nice site! Personally, I'd make the top navigation bigger. It almost gets overlooked beneath the phone number. Site loading / speed is absolutely OK over here (Google Chrome / desktop browser).
×
×
  • Create New...