Jump to content

diogo

Moderators
  • Posts

    4,296
  • Joined

  • Last visited

  • Days Won

    79

Everything posted by diogo

  1. dagan means, pasting the column names int the array "height","width","thickness","weight","price" This is a good point. The good thing is that you don't need to use find() and keep giant arrays in memory, but you should bootstrap processwire in a php file, and call it from the terminal. This will avoid to overcharge the server and allow you to echo the steps and any errors that might ocurr and monitor what's happening in real time. Also use uncacheAll() in every loop, so the PW pages don't occupy memory. Not related with the importing itself, but maybe you will need to interact with all those pages at some point. Don't use find() for this as it will quickly drain all the ram. I posted on another thread a solution that helped me a lot in a similar situation: http://processwire.com/talk/topic/2038-distinct-selector-in-processwire/?p=43720
  2. In that case that's the way to go. The "Import pages from CSV" module works great, and is very flexible. You just have to create the fields and templates that you need and choose to which fields the columns go.
  3. https://support.google.com/drive/answer/55244 http://office.microsoft.com/en-001/web-apps-help/share-it-embed-an-excel-workbook-on-your-blog-HA102029502.aspx https://zohowikihelp.wiki.zoho.com/Embed-Zoho-Sheet.html
  4. wire('pages') is equivalent to $pages. You use it exactly in the same way: $day_shows = wire('pages')->find("show_datetime={$this_date}"); Same goes for the other API variables: $page = wire('page'), $input = wire('input'), $session = wire('session'), etc... Happy Diwali!! (just checked on wikipedia ) --------- edit: speedy nik
  5. Hi dazzyweb, welcome to ProcessWire! For the first question there is a nice answer from Ryan here http://processwire.com/talk/topic/4426-pushing-pw-in-web-design-agencies/?p=43417 I'm not sure concerning form-builder prices, but you can read about it here http://store.di.net/products/processwire-form-builder in case you didn't see it before, There is also a nice tutorial from Soma on how to build forms with the API http://processwire.com/talk/topic/2089-create-simple-forms-using-api/, and a lot about the subject spreaded through the forums. I don't know about pro cache an WP super cache, but I suspect that PW's is better I think all modules are gpl. Have fun! Any more questions, just ask away
  6. This is a bit more complex but works really well (for pw dev version): Create one custom template without fields following my module's instructions and paste this code in the template's file: <dl class="nav"> <?php foreach($page->children as $child) { echo '<dt><a class="label" href="'.$child->url.'">'.$child->title.'</a></dt>'; echo '<dd>'.$child->headline.'</dd>'; }?> </dl> Create a second custom template with the fields "querystring" and "headline" (give them the name you want, but update them in the code above), and paste this code in the template's file (if changed, update "querystring" to the real name of the field) <?php if(!$input->get->q) $session->redirect($page->url.$page->querystring); $page->process = "ProcessPageSearch"; require($config->paths->adminTemplates . 'controller.php'); Create a page under "Admin" and give it the first template. This will list all the children pages of that page using the info from the above fields of each. Create some pages under this page and give them the second template. Copy the query strings (including the "?") from the search pages that you want to recreate and paste them in the querystring field of these children pages. Don't forget that you can remove the sidebar by deleting "show_options=1". Maybe you will also want to update the "children" tab of the first template to accept only pages with the second template as children.
  7. Maybe it makes sense to expand the search process to allow keeping common searches as links that you can use on the search page and even pass to other pages. Meanwhile you can achieve something like this quite easily. Just use the search page and adjust the searches until you get the results that you want. Then copy the url of the results pages and create an admin page with those links. You can adjust the links further by refining the url, remove "&show_options=1" for instance, or turn it to 0, and the sidebar will be hidden. For creating the links page I would suggest using my admin custom pages module () with this code that will style nicely in the admin: <dl class="nav"> <dt><a class="label" href="link">all pages with X template</a></dt> <dd>See all posts</dd> <dt><a class="label" href="link">all pages with tag y</a></dt> <dd>See all posts with tag y</dd> <dt><a class="label" href="link">whatever else you want</a></dt> <dd>Do whatever</dd> </dl> You can also add some fields to the template. A repeater where you paste the links, for instance, and change the code to something like: <dl class="nav"> <?php foreach($page->searches as $search) { echo '<dt><a class="label" href="'.$search->link.'">'.$search->title.'</a></dt>'; echo '<dd>'.$search->description.'</dd>'; }?> </dl>
  8. I agree Here are six more suggestions: http://www.fontsquirrel.com/fonts/asap (I like this one) http://www.fontsquirrel.com/fonts/lato http://www.fontsquirrel.com/fonts/CartoGothic-Std http://www.fontsquirrel.com/fonts/cabin http://www.fontsquirrel.com/fonts/Liberation-Sans (closer to Arial, from Red Hat)
  9. you can also use something like this http://thecodemine.org
  10. Ok, I was mistaken by this If bfd_month is a page field bfd_month=11 will search for the page with the id 11. If 11 is the name of the page you should use bfd_month.name=11 instead.
  11. And what does $todaymonth echo? echo $todaymonth; I'm guessing it's "11" Edit: I just confirmed that date("m") returns the number of the month. If you want it to return the name of the month use date("F") instead. http://php.net/manual/en/function.date.php
  12. Did you follow the instruction for the stable version of PW? For the stable version you need to create a child of the page to hold the template.
  13. That rule was added to correct the input fields funky behaviour because of the borders, so maybe the best things is to apply the border-box only to them. input, textarea { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } We could go a bit further and apply it to all the direct children of .InputfieldContent. I think I prefer this option. .InputfieldContent > * { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; }
  14. I was worried that I might have been rough with what I wrote, but it wasn't my intention. I'm glad you took it how I intended Anyway, It's not only an aesthetics matter, it's also functional if you think that Helvetica was created for printing and Arial is not more than a bad copy of it. There are many fonts (even free) that were created especially for screen, and some of them by really good type designers , For example Fira, that was mentioned before, was designed by Erik Spiekermann (Yaaay, I wrote his name right without looking ). Truth is that the traditional font stacks exist because of a technical limitation that doesn't exist any more, can you imagine if it would be the same with printing? Imagine if all the posters and magazines would be written in the same fonts (boring...), and last but not least, imagine that all online code editors and code in blog posts would be in Courier New
  15. Hm, I have to say, as a designer, it's not that easy to digest this sentence. Not that there is something wrong with those typefaces (with Helvetica at least), but because that thought just throws any design choices in the garbage, not to speak in all the effort that is being put on making typography be finally possible in the web... isn't it a bit like telling a developer "i don't care if it's semantic, just make things appear on screen".
  16. Design is a complex thing, you just can't put everything in the same bag. I agree that in many cases what matters is to put the content out there in the most efficient way possible and son't defend that all websites should have unique designs, but in other cases where uniqueness and aesthetics are important why should why should we prioritize mobile and sacrifice people that are looking at a website on a big screen? Isn't it like lowering the experience of people that go to the movies because the film will also be on DVD soon?
  17. Hi skovar. You. can't use the variable $page inside a function because it's out of scope. use wire('pages') instead.
  18. diogo

    Bitbucket

    Are you guys aware that Bitbucket offers ilimited private projects for teams up to 5 collaborators for free? It's pretty awesome actually
  19. Try: $pages->find('template=event, related_city.status!=21')
  20. Ya, there were some problems in the previous code. This one is tested and should work: $queryArray = explode(" ", $q); // create an array with all the words $authorPages = new PageArray(); $titlePages = new PageArray(); $results = new PageArray(); foreach($queryArray as $word) { $authorPages->import($pages->find("author*=$word")); $titlePages->import($pages->find("title*=$word")); } // intersect both arrays by importing common pages to the $results array //foreach($titlePages as $p) { // if ($authorPages->has($p)) $results->import($p); //} // forget the above 3 lines, this is so much better for intersecting two arrays $results = $titlePages->find("id=$authorPages"); echo $results;
  21. What about this? (also written in the browser and not tested at all) // the code was not good // see my next answer Hope it's clear...
  22. Great to hear from you Joss!
  23. This should do what you want: // untested $q = str_replace(" ", "|", $q); // replace spaces by pipes $results = $pages->find("author|title*=$q");
  24. Draft https://draftin.com/ is also nice.
×
×
  • Create New...