Jump to content

Peter Knight

Members
  • Posts

    1,377
  • Joined

  • Last visited

  • Days Won

    5

Everything posted by Peter Knight

  1. I have a PageReference field called related_random where my client selects a particular parent page in the tree. On the front end I then need to get a random child page of that page based on some selector values. At the moment I'm using a Matrix field and this outputs the page ID (1090) on the front end <?php foreach($page->related_products as $item) { if($item->type == 'related_product') echo " {$item->related_random->title} "; } ?> What I can't get my head around (and what I really want to do to echo some values of that page IDs children Essentially I want to get a maximum 1 random child page of 1090 with a template of product. The shoddy selector below is clearly wrong but correct in explaining what I want to do. $related_random->child->getRandom("template=product,limit=1") Don't know if that makes any sense?
  2. Hi Mike each language is handled by a folder named after the language domain.com/fr/ domain.com/de/ domain.com/it/ domain.com/es/
  3. Maybe one of the following? Use local optimization tools (on website server) Use your web servers optimization tools Use optimization on website server
  4. Hi Mike I'm creating Jumplinks for a multilingual site and I was wondering what you advise when I come across a URL like following in the 404 monitor /it/products/hooks/ganci-piatto/182728 That's an old URL from the italian tree of the site The reason I'm asking is because when I browse to tree or auto-complete, I can pull up the 1827288 product page but it's not necessarily italian. Should I manually Specify a destination in these cases and ensure we're manually pointing at the correct launguage?
  5. Hi Pete I have XML sitemap installed and it's listing my URLs as http://domain.com without the www The site is set (with .htaccess) to display with the www and this is working. IE any requests for http://domain.com deliver http://www.domain.com. So I'm not sure why it's picking this non www up or where it's coming from. Additionally, I've disabled ProCache, reinstalled the XML Sitemap Module checked that the source of the actual pages META tags are correct IE <link rel="canonical" href="http://www.domain.com" /> Any pointers appreciated. Pete - think this was a caching issue. All fixed now.
  6. Thanks guys. I understand the context now and have fixed the issue. Interestingly a list of UNIX server locales I found online were different than the ones installed on my VPS so that was something to be aware of.
  7. I have just published my first PW multi-lingual site. I'm not understanding the following message and the server locale function Warning: your server locale is undefined and may cause issues. Please translate the “C” locale setting for each language to the proper locale in /wire/modules/LanguageSupport/LanguageSupport.module (shortcuts provided below): • English • Français • Deutsch • Español • Italiano For example, the locale setting for US English might be: en_US.UTF-8 Is it just a case to populate each languages "C" field with an appropriate string? IE English C field: en.UTF-8 Francais C fieldn: fr_FR.UTF-8 Deutsh C field: en.UTF-8 Espanol C field: es_ES.UTF-8 Italiano C field: it_IT.UTF-8
  8. I always assumed duplicate content incurred a Google penalty and affected your rankings. Possibly this isn't as much a problem anymore as @AndZyk mentioned and Google gets better about handling it etc. @adrian I have the usual batch of .htaccess settings, ProCache and and SEO Module. I couldn't narrow it down to any.
  9. Had a question about trailing slashes and forcing one or other. I've a site where most pages can be accessed with AND without a trailing slash IE domain.com/about-us/contact and domain.com/about-us/contact/ are both accessible and being indexed by Google. It's obviously bad for SEO but I can't seem to make PW respect one and redirect etc. There is a setting in templates>template>URLs I must be overlooking something as I have 'yes' selected and both URLs are still reachable with no redirect. What do you guys do to counter this?
  10. That's a good one. The MailChimp one is good too. https://templates.mailchimp.com/resources/inline-css/ I'd love to keep the amount of steps for my client right down but at some stage they'll probably need to use this maually. Thanks for the link
  11. That sounds pretty cool. I think the hardest part to this will be the final integration into Outlook itself and it's quirks.
  12. This is a simple enough use-case but was a good reminder (to me) of how PW can be used for simple stuff. A client rang me with a small but irritating problem. Every member of their staff have slightly different email signatures and it looks unprofessional. Even their clients had mentioned it. Initially I said I'd look into creating a few dreamweaver html templates or seeing what 3rd party signature solutions are available. The problem though is they're not a technical bunch and asking them to edit html etc is out of the question. The solution needs to be super simple for them. After a few hours looking at some solutions I realised I can do this very effectively with PW. It has such as nice UI and they'll be able to self manage most of it My plan is to set up a couple of fields: name (page title), email, telephone, Linkedin etc etc Give the client access to create new pages (staff) Allow client to create new pages (staff members) based on a simple HTML template Use PW's "add new" button to auto save pages into a parent folder called Sigs and we're done! I probably need to look at a way to produce inline css as this is eventually integrated into Outlook A foolproof way to display the actual HTML too (instead of view-source) would be great as I imagine they will need to copy and paste the actual html. I know it's hardly a technical masterclass but it's an interesting little job perfectly suited to PW.
  13. Love it. I use file and image tagging extensively and it's one of the few PW methods which trips clients up. I was just wondering during the week if it was possible to have a tag selector based on something a bit more dynamic. Thanks
  14. Hi Mike I think I'll prioritise the 100 or so most important URLs and then I can work through the others gradually. Client confirmed that actually they don't rank terrible well anyway so it looks like a relatively fresh start and the pressure is off. Just have to upgrade to MySQL 5.6 as it's currently running 5.1.X
  15. Hi Mike I have a multi-lingual MODX site which I've rebuilt in Processwire. PW site isn't live but is on a test server. As the MODX version currently has around 500 resources (lets say 500 URIs) I am keen to follow the old alleged Abraham Lincoln advice I'm thinking of doing following and wanted to sanity check my approach 1. Get a sitemap of the entire MODX site into a XLS or CSV and import into Jumplinks 2. Manually go through each "old" URL and update to the new URL Am I missing something crucial apart from keeping an eye on Google's Search Console (was Webmaster tools) and watching for 404 hits. I'll enable 404 monitoring on Jumplinks too. Cheers for any pre flight advice.
  16. Thanks @PWaddict All working now Thanks everyone for introducing me to something new. I can see how this will be useful as the site grows. Even now it easily replaces several lines of PHP if statements .
  17. OK I think I see my missign step. When I click into a language under Admin > Setup > Languages I need to look at a field group called Site Translation Files I need to select the button called Find Files to Translate which brings up a list of files in /site/ and then select my _translations.php file The only issue I have is adding this to my template outputs nothing <?php echo $page->__product_drawing ?> Also tried <?php echo $page->__product_drawing; ?>
  18. Ok so I create a php file called _translations.php. I upload it to site/templates/ directory. Do I then need to add it as a template under Admin > Setup > Templates > Add new template? I don't already have that file. if I create a file called _init.php does it live under /site/ or /site/templates? My Languages page under Admin > Setup just has my 5 languages listed. If I click into the French one, the only thing I can see is a field called Core Translation Files I know I'm probably missing an earlier step.
  19. I'm not sure how to do that. can you elaborate with a simple example?
  20. You mean create a field somewhere called "download button" and translate it with the field's language tabs?
  21. I was trying to fix an error earlier which was preventing a series of if statements from working. Basically I have a button called "Product Drawing" which needs localising depending on the current language session. Eventually got it working - I had a bracket in the wrong place. Curious as to why both these work though. On the sample below. each echo is surrounded by curly braces. <?php if ($page->files->count()) foreach($page->files->findTag('drawing') as $file) { if($user->language->name == 'default') {echo "<a href='$file->url' class='uk-button uk-button-primary'>Product drawing</a>";} if($user->language->name == 'french') {echo "<a href='$file->url' class='uk-button uk-button-primary'>Le plan du produit</a>";} if($user->language->name == 'german') {echo "<a href='$file->url' class='uk-button uk-button-primary'>Produktzeichnung</a>";} if($user->language->name == 'spanish') {echo "<a href='$file->url' class='uk-button uk-button-primary'>El dibujo del producto</a>";} if($user->language->name == 'italian') {echo "<a href='$file->url' class='uk-button uk-button-primary'>Il disegno del prodotto</a>";} } ?> On the sample below, there are no curly braces around the echo <?php if ($page->files->count()) foreach($page->files->findTag('breakingreport') as $file) { if($user->language->name == 'default') echo "<a href='$file->url' class='uk-button uk-button-primary'>Breaking strain report</a>"; if($user->language->name == 'french') echo "<a href='$file->url' class='uk-button uk-button-primary'>Le test de rupture</a>"; if($user->language->name == 'german') echo "<a href='$file->url' class='uk-button uk-button-primary'>Bruchfestigkeit bericht</a>"; if($user->language->name == 'spanish') echo "<a href='$file->url' class='uk-button uk-button-primary'>Informe resistencia</a>"; if($user->language->name == 'italian') echo "<a href='$file->url' class='uk-button uk-button-primary'>La rottura rapporto ceppo</a>"; } ?> Should the second piece work?
  22. Not yet but I was hoping to look at 2FA soon.
  23. Sincerely hoping you're talking about the same CMS but two different ladies and not the opposite ?
  24. Both $pages->find("id=1|2|3"); and $pages->getById([1216,1217,1218]) worked. My original $formnav = $pages->getById([1216,1217,1218]); // Get specific pages wasn't returning the correct pages because the menu options needed this removing 'show_root' => true, Thanks everyone
  25. is it possible to call multiple page IDs in a selector? I was trying to fetch a few specific pages by ID for a menu as follows $formnav = $pages->get("1216,1217,1218"); // Get specific pages echo $sideMenuForms->render($options, null, $formnav); and it throws the following error Fatal error: Exception: Unknown Selector operator: '' -- was your selector value properly escaped? field='1216', value='', selector: '1216,1217,1218' (in /var/www/vhosts/ It works if there is a single page ID specified but not multiples. Looking up the API reference, there is a "get by ID method" for multiple page IDs but it does nothing and no error $formnav = $pages->getById([1216,1217,1218]); // Get specific pages echo $sideMenuForms->render($options, null, $formnav); I can always revert back to a template or path based selector but was hoping to keep it based on ID for the moment.
×
×
  • Create New...