• Content count

  • Joined

  • Last visited

  • Days Won


Sérgio last won the day on February 25 2016

Sérgio had the most liked content!

Community Reputation

240 Excellent

About Sérgio

  • Rank
    Sr. Member
  • Birthday 04/13/1979

Profile Information

  • Gender
  • Location
    Belo Horizonte, Brazil

Recent Profile Visitors

3,681 profile views
  1. For simple static sites you can use a javascript based approach like http://lunrjs.com/ Also, check https://www.algolia.com/ for a more powerful solution, although in this case a more complex solution to implement depending on your needs.
  2. Also check this code example where Ryan shows how to create pages using the API. It's pretty simple!
  3. I don't have a code example for this, but if you look at these two modules by Ryan, you can do it: http://modules.processwire.com/modules/markup-rss/ http://modules.processwire.com/modules/rss-feed-loader/ And schedule the export/import with http://modules.processwire.com/modules/lazy-cron/ Also check this module: https://processwire.com/blog/posts/introducing-iftrunner-and-the-story-behind-it/#iftrunner-release
  4. Are both sites on the same server? If yes, what about letting people make new pages on the new site and, using the API, you can export these pages as XML and import them on the old db every night. Or you could hook on the page save on the new site and fire a cron job to create the page on the old db as well.
  5. No need, @Cesco. You can do this on your current installation. To use Italian as your default language on the frontend, and considering your want "example.com/" to open in Italian and "example.com/en/" to change to English, do the following: As this is a new installation, and you have no real data yet, delete all languages but the default one, of course. Change the default language title to Italiano Upload Italian translation files to it Create a new language, name "en", title "English" Edit the homepage and set the "en" language as active and the url as "en".
  6. I have 4728 users right now on my project. No problem so far.
  7. It's better in a way. You have SSL support, which could be a pain in the ass to configure and maintain. Server Pilot free plan does not have SSL enabled. So, $12.49 one time payment is a very nice deal.
  8. Looks like a timesaver app, @szabesz! I think I'm gonna buy it. Thanks for the tip!
  9. You can have something like this, considering your page field is called "categories". Not tested! <?php $categories = $pages->find('parent=/categories/, sort=name'); ?> <?php foreach ($categories as $category) : if ($pages->count("categories=$category")) > 0 : ?> <li><a href="#" data-name="<?php echo $category->name; ?>"><?php echo $category->title; ?></a></li> <?php endif; endforeach; ?>
  10. And if the course options (like Adult Courses) are going to be just options, not entire page (with fields), you can use the Options fieldtype as well.
  11. @Tyssen , if you decided for this approach of caching the xml, you can see how I've done this when I was getting info from Slideshare using GuzzleHttp client. use GuzzleHttp\Client; public function getSlideshows() { $client = new Client([ // Base URI is used with relative requests 'base_uri' => 'https://www.slideshare.net/api/2/', // Set timeout. 'timeout' => 35.0, //Slideshare was taking long 35 seconds to respond. The xml has 100+ items. ]); $api_key = 'xxx'; $username = 'xxx'; $time = mktime(date("H")); $secret = 'xxx'; $sha1 = sha1($secret].$time); $cache = wire('cache'); $response = $cache->get("slideshare_xml"); //save and cache the xml if(!$response) { $url = $client->get('get_slideshows_by_user?username_for='.$username.'&detailed=1&api_key='.$api_key.'&ts='.$time.'&hash='.$sha1); $response = $url->getBody(); $cache->save('slideshare_xml', $response); //default is 24h } $xml = new \SimpleXMLElement($response); echo $xml; // $slide["secret_key"] = (string) $xml->Slideshow->SecretKey; // $slide["title"] = (string) $xml->Slideshow->Title; // $slide["description"] = (string) $xml->Slideshow->Description; // $slide["url"] = (string) $xml->Slideshow->URL; // $slide["thumbnail_url"] = (string) $xml->Slideshow->ThumbnailURL; // $slide["embed_url"] = (string) $xml->Slideshow->SlideshowEmbedUrl; // $slide["created"] = (string) $xml->Slideshow->Created; // $slide["language"] = (string) $xml->Slideshow->Language; // $slide["num_views"] = (int) $xml->Slideshow->NumViews; }
  12. Indeed @Sephiroth, I forgot to think about that. A cache should suffice in this case.
  13. Is the data from the XML needed to be shown in real time? I'm mean, does it change A LOT every minute or so? I don't think so, as is not an auction site apparently. So I think is a good idea to import the data as PW pages and using a cron job or manually import only the fields that changed on a daily update and import new items if not created already.
  14. I've read people talking about how painless ottomatik.io is to restore so I decided to give it a try. Prior to it I was using a local script and also backing up the entire DigitalOcean droplet but decided to use another system, after reading about DigitalOcean losing an entire server backup history. My sanity deserves the $10/month.
  15. For documents such as PDFs, you can use the S3 options you already talked about to store them there, because you'll only need the file URL after all. Remember to config Processwire to store the session on the database.