-
Posts
534 -
Joined
-
Last visited
-
Days Won
11
Everything posted by Sergio
-
Thanks, @Robin S! Yes, it's a great feeling! After everything was running apparently fine, it was like removing a heavy weight from the shoulders. The project took more time than as I was expecting for some reasons, it was developed in "waves" as I have to stop it for 2-3 weeks many times to handle some other of our projects. I didn't track the time but I can estimate that if done without stopping, it would have taken at least 9 months. But now that I know more about PW's advanced features, like building modules and how to create a member area, it would take 33% less time I think. The project has 66 templates and 1849 pages so far, some of them with lots of content like the ones on Consulting and Training sections, so a lot of time was spent importing content. -- Very strange you had problems in the book section rendering, could you tell me what browser you used? I'm using a Mac and also tested in Firefox on Ubuntu and Edge and IE11 on Windows 10.
-
Hi guys, after several months I finally released my most complex ProcessWire project so far: https://ricardo-vargas.com About the client: Ricardo Vargas is a specialist in project management and strategy implementation. He's an accredited professional and author of several books. Since 2007, he publishes a bilingual podcast about project management with millions of episodes listened. From 2012 to 2016, he worked for the United Nations Office for Project Services (UNOPS) in Copenhagen, Denmark. He currently lives in Portugal. The previous site was developed in 2009 using Wordpress by my team at the agency I was working for. In 2011, Ricardo invited me to work with him and I started to maintain the site ever since. The front-end side was good, performance-wise, but the backend started to become horrendous to work with so in 2012 I started my quest to find a better CMS and found PW. After developing small projects and messing around with it I convinced my client/boss last year to let me develop his new website with PW. I did all the stuff (design, frontend, backend, and server ops) so if you find something buggy or strange, let me know, please! I'll appreciate! The site is currently running on Digital Ocean droplet with 2GB of RAM. Nginx and Cloudflare (for SSL mostly). I'm using forge.laravel.com to manage it. Approx. 3,000 unique users per day doing 72,421 requests (Cloudflare stats). Key features: Pages are loaded with ajax using https://github.com/miguel-perez/smoothState.js so the podcast player (Soundmanager ) can continue to play the podcast episode as the user navigates other pages. Member area where the user can see the books his own (and download their files) and also see his bookmarks and reports. I imported and the users (+ 4k) from the WP database and decided to get rid of passwords (the future!) so after some research and tests, I chose Auth0 login system. I've mentioned the member area on this topic (there are a couple of screenshots there): Modules used AdminLinksInFrontend AdminOnSteroids AdminTemplateColumns Auth0Login (Custom made) BatchChildEditor ClearCacheAdmin FieldtypeRuntimeMarkup FlickrAPI (Custom made) FormBuilder InputfieldCKEditor MarkInPageTree MarkupLoadRSS PageReferencesTab PageViews (Custom made) PduReport (Custom made) PrevNextTabs ProCache ProDrafts ProcessDatabaseBackups ProcessJumplinks ProcessSendyAPI (Custom made) ProcessWireUpgrade ReaderAreaManager (Custom made) SlideshareAPI (Custom made) TemplateLatteReplace TextformatterAccordion TextformatterHannaCode TextformatterMarkExternalLinks TextformatterMultiValue TracyDebugger UserBookmarks (Custom made) WireMailMailgun importPagesCSV
-
Convert existing page to multilanguage
Sergio replied to Noel Boss's topic in Multi-Language Support
Hi @noelboss, welcome to the forums! You should have installed the necessary fields and module instead, and their install process will take care of everything. As the documentation says:- 2 replies
-
- 2
-
-
- multilanguage
- existing page
-
(and 1 more)
Tagged with:
-
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!