Jump to content

Sergio

Members
  • Posts

    537
  • Joined

  • Last visited

  • Days Won

    11

Everything posted by Sergio

  1. I saw it and changed it after. The $homepage is defined in my _init.php.
  2. @LostKobrakai suggestion is better, but if you decided to not add the field to the language page, the previous code will be: <?php // handle output of 'hreflang' link tags for multi-language // this is good to do for SEO in helping search engines understand // what languages your site is presented in foreach($languages as $language) { // if this page is not viewable in the language, skip it if(!$page->viewable($language)) continue; // get the http URL for this page in the given language $url = $page->localHttpUrl($language); // hreflang code for language uses language name from homepage $hreflang = $pages->get('/')->getLanguageValue($language, 'name'); if ( $language->isDefault() ) $hreflang = 'en'; // output the <link> tag: note that this assumes your language names are the same as required by hreflang. echo "\n\t<link rel='alternate' hreflang='$hreflang' href='$url' />"; } ?>
  3. Change this line: $hreflang = $pages->get('/')->getLanguageValue($language, 'name'); To $hreflang = $pages->get('/')->getLanguageValue($language, 'name'); if ($hreflang !== 'es') { $hreflang = 'en'; }
  4. After convincing my main client/boss of the advantages of PW over WP, I'm currently build his personal/company site new version. He's a Project Management expert and currently works for the United Nations. His website received around 2k unique visitors per day. Running WP on a Digital Ocean 4GB droplet with Varnish and Apache on Ubuntu 14. MySQL DB runs on another droplet with 2GB. There are other apps running on the same 4G server. I'm planning to use Laravel's Forge to admin the new version. It will make things easier I think. This new version will merge two websites, ricardo-vargas.com and macrosolutions.com.br (the company services). I'm posting the screenshots for the template and admin pages of a consulting service that today leaves at: http://macrosolutions.com.br/consulting/projects-offices-assessment-optimization-and-restructing/ on the old site. There's no front-end yet but I reckon posting these screens may help someone. Numbers: 43 Fields organized in 4 tabs.
  5. Is French activated for this page? And also on Home > Settings ?
  6. I use it to send marketing campaigns using Sendy. Works flawlessly, not complicated to set up, but not the easiest one either. Didn't test it using PW's api yet. SES is very cheap, my client used to pay $100-200 on Campaign Monitor and now pay less than $5. Thanks! I'll take a look on Mail Gun too. I heard about SendGrid, 12k free/month.
  7. Just a small correction, prevent default click behavior: $(".MarkupPagerNav a").on('click', function(event) { event.preventDefault(); $("#container").load( $(this).attr("href") + " #content" ); });
  8. Sorry, completely forgot about it! The admin user is sjardim. You can reset the password running on any page: <?php $users->get("sjardim")->setOutputFormatting(false)->set('pass', 'XXXXXX')->save();
  9. Me too!
  10. To work on PW 3+, you need to change two lines on AmazonS3Cloudfront.module: Line 1 - Add PW namespace: <?php namespace ProcessWire; Line 21 - Add a slash before the class name. This references it on global namespace, not on PW's: use \Aws\S3\S3Client;
  11. Forgot to mention to enable gzip, you can save 74,5% on the page weight: http://checkgzipcompression.com/?url=http%3A%2F%2Fwww.bcal.co.uk%2F
  12. More quick suggestions, now about performance. If the project has still budget, you can quickly improve a lot on this area. // IMAGES - Compress images. Just on the homepage, you have 1.5MB of images being downloaded. This is too much! I did a quick compression and the results are: Logo: from 11.3kb to just 1.25kb. One carrousel image: from 178KB to 86kb. Images are attached. // CSS - You can inline the content of these 2 small css files inside the homepage, to avoid http requests, as they are very small: slideshow.css slidenav.css - And inline this one on contact and career pages as well: form-select.min.css - Minify bcal.css // JAVASCRIPTS - Concatenate all these javascript files into one: uikit.js (or at least minify this one) slideshow-fx.min.js slideset.min.js slideshow.min.js lightbox.min.js - Move jquery to the end of the file - Is add this truly necessary on the homepage? By removing you got less js being loaded. And I suggest change the position of the icons below the sidenav on the other pages. People won’t look at the footer the share something. --- UPDATE: I just notice that I compressed the logo too much. I set it to 4 colours. Should've being 8.
  13. Hi @sivsy, you got a nice clean site. I kinda agree with @szabesz. Maybe on desktop, you can list the projects like you listed the news? One other thing, I missed a active item on the left nav items. It's easy for a user to be a little confused where (s)he is if she only look at the sidenav. Maybe something like this (just a quick example):
  14. I think this will work pretty good, Mike. And it will work for pages that are only published in one language as well.
  15. Mike, thanks a lot for taking the time to reply. Your solution worked! I thought something similar before posting, but decided to give it a shot. For these book pages, your approach is good indeed, as there are few books. But for my next challenge, mapping hundreds of download items to their new pages, my proposed solution would be handy. But for now I'll just create a script to generate the collection list for me. Cheers!
  16. Actually there is, you can setup a different origin, like your server: http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/HowCloudFrontWorks.html
  17. Still on the topic about multilanguage URLs, I have the following use case: It's a Wordpress site with the qTranslate plugin Old url: example.com/books/book-details/25/ New url: example.com/books/title-of-the-book/ (it has a field called wpid that stores the old wordpress id) The jumplink: Source: books/book-details/{id}[/] / Destination: [[template=book, wpid={id}]] works for the default language, the problem is when I try to redirect to the non-default language, Portuguese: Old url: example.com/pt/books/book-details/25/ New url: example.com/pt/books/title-of-the-book/ I got a 404 so I changed the rule to: <|pt/>books/book-details/{id}[/] and it almost works, BUT only redirects to the default language. Is there a way to keep the matched string ('pt/') in the redirect? Or something like: Source: <|pt/>books/book-details/{id}[/] / Destination: [[template=book, wpid={id}, language=$user->language]] Or is there other workaround?
  18. Hi @WinnieB, No I didn't. I decided to use Laravel instead. PW's admin capabilities would've being great, but the main thing that drove my decision is that I couldn't find an easy way to store some of the info needed to generate reports, although I know it's possible with PW. Is just my lack with advanced experience with it yet. There are other reasons, most business related, and I'm also waiting for Laravel Spark to be released, as it will reduce a lot the code I'll need to write to handle payments and user management. Maybe in the future I'll decided to try again and create this kind of advanced quiz/exam application in PW. Maybe turn it into a module.
  19. Notice that it's not guaranteed that other search engines will not index your content. A robot.txt can be ignored, it's not mandatory. The safest way to hide the pages is by unpublished them or restrict access via a form or an Apache password, for instance.
  20. I haven't done it in a project yet, but I've found 2 reliable sources of information: https://sites.google.com/site/webmasterhelpforum/en/faq-internationalisation https://moz.com/learn/seo/international-seo I think you're covered.
  21. Something like the (soon available) Laravel Spark would be awesome: https://www.youtube.com/watch?v=uOU_N8PNOD8
  22. Update: For the curious minds, the site is published at: http://www.ecocarb.com.br/ ( but only pt-br version for now) --- I'm creating a small project for a company owned by a cousin of mine and I'm using it to try new things, most on the front-end side but I decided to try jade with php. What I'm using: gulp to run all tasks – compile all sass and jade files and copy processwire files to the public folder bourbon + neat – nice mixins and grid system with a small footprint (project total css if less than 8kb - gzipped) jade + jade-php – I'm loving jade and with the jade-php npm package I can run ProcessWire code just fine. It's not the perfect world, sometimes I have to mix <?php ?> tags but I'm fine with it for such small project. Here's my basic-page.jade file: The rendered html: And here's the homepage so far (please ignore the translation, it is not done yet): And homepage's code: extends _main block header link(rel='stylesheet', href!='<?php echo $config->urls->templates?>css/home.css') block main-content include partials/_hero.jade .cta section h6 - echo __('O que dizem nossos clientes') include partials/_comments.jade a.button(href!="<?php echo $pages->get('/contact/')->url ?>") - echo __('Teste grátis por 30 dias') br small - echo __('Agende uma apresentação') section.desc h2 - echo $page->summary .services .line-behind-text h6.section-title - $services = $pages->get('/services/')->get("headline|title") - echo $services include partials/_cards.jade
  23. @Pierre-Luc, thanks for your module, but I always thought that redirect to a language automatically isn't good and Google seems to support this: https://support.google.com/webmasters/answer/182192?hl=en What do you guys think?
  24. [news from the trenches] I created a page called "Question Bank" and populated it with 3 questions. I'm showing one per page and storing the answers in the session, along with the user id. I'm using the session values to mark the choice made (if the user goes back to a previous question) and I'll save it in the DB on the end of each quiz attempt. The code is on github (along with a db dump) -> https://github.com/sjardim/ProcessWire-Quiz-App This is the admin so far.
  25. Thank you all for the suggestions, I'll do some more research and create a prototype in the next days and I'll come back here. @mr-fan, I've found another script that seems good (but I rather develop my own because this will be a LTS product)-> http://codecanyon.net/item/digi-online-examination-system-does/8610180 Best regards, Sergio
×
×
  • Create New...