-
Posts
531 -
Joined
-
Last visited
-
Days Won
11
Everything posted by Sergio
-
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.
-
How to migrate sections / subsections from old PW to new PW site?
Sergio replied to MarcC's topic in General Support
Also check this code example where Ryan shows how to create pages using the API. It's pretty simple! -
How to migrate sections / subsections from old PW to new PW site?
Sergio replied to MarcC's topic in General Support
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 -
How to migrate sections / subsections from old PW to new PW site?
Sergio replied to MarcC's topic in General Support
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. -
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".
-
Is there a limit on the number of users within PW ?
Sergio replied to Doc's topic in General Support
I have 4728 users right now on my project. No problem so far. -
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.
-
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; ?>
-
Grouping pages - Same page under different sectionss
Sergio replied to mikeuk's topic in General Support
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. -
@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; }
-
Indeed @Sephiroth, I forgot to think about that. A cache should suffice in this case.
-
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.
-
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.
-
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.
- 10 replies
-
- 2
-
-
- remote file system
- s3fs
-
(and 2 more)
Tagged with:
-
Never done it myself, but I know it's possible to decouple the image processing and keep the goodies on an API for manipulation, similar to PW's. You can take a look at Cloudinary feature to upload an image by its URL. Also, there's IMGIX .
- 10 replies
-
- 5
-
-
- remote file system
- s3fs
-
(and 2 more)
Tagged with:
-
@Robin S's code is an excellent approach, @j00st! The ConnectPageFields module is great to have the admin user manage the relations is a much easier way. I have to implement it on this site the screenshot came from yet, as when I developed these connections the module wasn't available. As for your question, the code I used to create this page shown on the screenshot is taken from Ryan's blog profile tag template, mine version is below: /** * Generate a list of tags A-Z * * Used by the /site/templats/tags.php template file. * * VARIABLES: * ========== * $tags PageArray of tags * * Each of the tags has a numPosts property containing the number of posts used by the tag. * */ $lastLetter = ''; $out = ''; $letters = array(); $tags = $page->children(); foreach($tags as $tag) { $letter = strtoupper( substr( $sanitizer->pageName($tag->title, true) , 0, 1 ) ); if($letter != $lastLetter) { if($lastLetter) $out .= "</ul></div>"; $out .= "<div class='letter-group'>"; $out .= "<h3 id='letter_$letter' class='bg-tags text-center'>$letter</h3>"; $out .= "<ul class='no-bullet'>"; $letters[] = $letter; } $lastLetter = $letter; $page_count = $pages->count("tags=$tag"); $class = $page_count >= 10 ? 'u-strong' : ''; if($page_count > 1) { $out .= "<li class={$class}><a href='{$tag->url}'>{$tag->title} <span class='color-tags-dark25'>({$page_count})</span></a></li>"; } } $out .= "</ul></div>"; /I'm using TemplateLatteReplace module to outup to a view file. $view->letters = $letters; $view->tag_list = $out;
-
-
Just a small correction on @Robin S code: If you're using PW 3.0+ will need to reference the PDO class outside ProcessWire namespace: $ids = $query->fetchAll(\PDO::FETCH_COLUMN); Or, put this in the beginning of the file: <?php namespace ProcessWire; use \PDO;
-
On my current project I decided to keep the .php extension but on the next one I'll enjoy this new approach for sure. Many thanks, @tpr !
-
Has anyone installed Processwire on Amazon EC2?
Sergio replied to modifiedcontent's topic in General Support
As you are stuck with AWS, check this tutorial on their site, explaining how to host a Wordpress site: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/php-hawordpress-tutorial.html#php-hawordpress-tutorial-launch -
New blog post: Working towards a new admin theme
Sergio replied to ryan's topic in News & Announcements
Ryan, it looks really great indeed! A great improvement on the theming capabilities! Looking forward to create a dark theme on it! -
Has anyone installed Processwire on Amazon EC2?
Sergio replied to modifiedcontent's topic in General Support
If you really need Apache, you need to install it yourself via ssh. Processwire runs fine in Nginx. -
Has anyone installed Processwire on Amazon EC2?
Sergio replied to modifiedcontent's topic in General Support
Maybe you can try https://forge.laravel.com/, from the author of the Laravel framework. I use it for my DigitalOcean droplets and it's great! You can use it to setup a server on Amazon, Linode or with a custom VPS too. -
Excellent post, thanks for sharing @szabesz! I recently reset one of my Macbooks and I did almost all described in that post, but I've followed Jeffrey Way's free videos on https://laracasts.com/series/setup-a-mac-dev-machine-from-scratch . Great resource too!