Jump to content

Peter Knight

Members
  • Posts

    1,552
  • Joined

  • Last visited

  • Days Won

    18

Everything posted by Peter Knight

  1. Thanks Juergen. I’ll try that. What are the data and square brackets in terms of PHP and the API?
  2. You have so many options. But if it’s a simple gallery, you could have all the images within a single images field. Im not sure what you mean by “catalog the photos” but you could look at image tags. Alternatively ive created galleries where I needed to create a separate page for each gallery.
  3. Hi @Wanze If we want to output just the opengraph tags, the instructions provided work `echo $page->seo->opengraph->render();` But what is the syntax to just echo the robots tag ? `echo $page->seo->robots;` Outputs 'RobotsSeoData' `echo $page->seo->robots->render();` Outputs nothing
  4. Thanks Dragan. This has bugged me for ages and seems to be finally be the fix
  5. Occasionally when I goto Modules > Upgrades I get the following type of error. There's actually about three of them and each one mentions a different line. In the example below, line 266 is $new = version_compare($versions[$name]['remote'], $versions[$name]['local']); ( ! ) Notice: Undefined index: local in /Users/peterknight/Sites/mysite.com/site/assets/cache/FileCompiler/site/modules/ProcessWireUpgrade/ProcessWireUpgradeCheck.module on line 266 Call Stack # Time Memory Function Location 1 0.0011 405040 {main}( ) .../index.php:0 2 0.2602 5197688 ProcessWire\ProcessPageView->execute( ) .../index.php:55 3 0.2602 5198064 ProcessWire\ProcessPageView->__call( ) .../index.php:55 4 0.2602 5198064 ProcessWire\WireHooks->runHooks( ) .../Wire.php:442 5 0.2603 5198480 ProcessWire\ProcessPageView->_callMethod( ) .../WireHooks.php:733 6 0.2603 5198480 ProcessWire\ProcessPageView->___execute( ) .../Wire.php:383 7 0.3009 5463888 ProcessWire\Page->render( ) .../ProcessPageView.module:209 8 0.3009 5463944 ProcessWire\Page->__call( ) .../ProcessPageView.module:209 9 0.3009 5463944 ProcessWire\WireHooks->runHooks( ) .../Wire.php:442 10 0.3015 5465248 ProcessWire\PageRender->renderPage( ) .../WireHooks.php:834 11 0.3015 5465624 ProcessWire\PageRender->__call( ) .../WireHooks.php:834 12 0.3015 5465624 ProcessWire\WireHooks->runHooks( ) .../Wire.php:442 13 0.3016 5466040 ProcessWire\PageRender->_callMethod( ) .../WireHooks.php:733 14 0.3016 5466040 ProcessWire\PageRender->___renderPage( ) .../Wire.php:383 15 0.3032 5470760 ProcessWire\TemplateFile->render( ) .../PageRender.module:514 16 0.3032 5470816 ProcessWire\TemplateFile->__call( ) .../PageRender.module:514 17 0.3032 5470816 ProcessWire\WireHooks->runHooks( ) .../Wire.php:442 18 0.3033 5471848 ProcessWire\TemplateFile->_callMethod( ) .../WireHooks.php:733 19 0.3033 5471848 ProcessWire\TemplateFile->___render( ) .../Wire.php:380 20 0.3036 5493112 require( '/Users/peterknight/Sites/mysite.com/site/assets/cache/FileCompiler/site/templates/admin.php' ) .../TemplateFile.php:287 21 0.3038 5493616 require( '/Users/peterknight/Sites/mysite.com/wire/modules/AdminTheme/AdminThemeUikit/controller.php' ) .../admin.php:15 22 0.3038 5495120 require( '/Users/peterknight/Sites/mysite.com/wire/core/admin.php' ) .../controller.php:15 23 0.3085 5586144 ProcessWire\ProcessController->execute( ) .../admin.php:135 24 0.3085 5586200 ProcessWire\ProcessController->__call( ) .../admin.php:135 25 0.3085 5586200 ProcessWire\WireHooks->runHooks( ) .../Wire.php:442 26 0.3085 5586616 ProcessWire\ProcessController->_callMethod( ) .../WireHooks.php:733 27 0.3085 5586616 ProcessWire\ProcessController->___execute( ) .../Wire.php:380 28 0.3108 5596744 ProcessWireUpgrade->execute( ) .../ProcessController.php:333 29 1.2224 8773000 ProcessWireUpgradeCheck->getVersions( ) .../ProcessWireUpgrade.module:187 30 1.2227 8776256 ProcessWireUpgradeCheck->getModuleVersions( ) .../ProcessWireUpgradeCheck.module:185 I've been living with it for a while and while it doesn't seem to stop me upgrading etc, I'd love to fix it. Anyone recognise this type of error?
  6. What would you suggest if we want to add ' | mysite.com' to the end of every page title but only set it in a single source field. In the example above, a user would need to add acme.com to every page. MarkupSEO had a field called Title Format where you could specify the structure of the Meta Title whether it was inherited or custom and it was very useful. The Sitename placeholder above was essentially an extra field in the config. Could you consider something like this? I can't seem to add a custom field to the SEO module but would be happy to add one to my custom Settings page (a simple private PW page).
  7. I think is an issue when the module Helper Field Links is installed with SeoMaestro Note on the left screen, each field has display issues with the field name. I could probably hide it with some CSS but wondered if you'd consider making it work out of the box.
  8. I tracked down the culprit of the Image field not appearing in the Smart Image option of this module. When an image field is set to Type=CroppableImages3, it is not recognised as an Images field. Setting my Images field from CroppableImages3 back to plain old Image worked. Obviously, you then loose your CroppableImages3 function but this was just to prove a theory. Not sure if this is something for you or @horst but just flagging here in case it's useful to anyone. BTW, upgrading over the existing install seemed to work fine in general. It might be safer to install from scratch but that completely removes all my existing settings. I tried it on a development environment first. Phew!
  9. Thanks Adrian. That looks interesting. So essentially, I have more customised SEO options on a page level. Thanks for the work on this. I don't have the image field available yet. I might try creating a few other images fields and generally good around and see if I can track down the issue.
  10. Should I uninstall the previous one first?
  11. I'm using MarkupSEO 0.8.7 The Smart Image field which lets me select some image fields doesn't recognise one of an image field. Not sure if I should be using a different version? Thanks
  12. Feature request, Mike. I know you're busy so just putting it out there. I am logging 404 hits to a site that get's a ton of spam links. An old SEO spam issue which I am cleaning up. Anyway, I notice that the jumplinks database table was becoming huge and had bloated to thousands of enties making the database itself very large. That better house-keeping is my responsibility but wondered if a feature might be useful to optionally auto-delete these over a certain threshold. Or possibly send an email or notification that the logs were becoming quite big etc.
  13. I'm really enjoying the Repeater Matrix field lately and always wished it could (optionally) be enhanced with some icons. A client recently started using Frontify for their brand portal and I thought their implementation was neat. Video attached. I also really like the categories and filtering. What do you think @ryan ? Screen Recording 2019-04-13 at 08.18.06.mov
  14. Hi @Pete Forums are looking much better. I personally find them easier to use with the updated theme. FYI I notice the Developers Map is currently broken. https://directory.processwire.com/map/
  15. Hi guys I have something working and I'm not sure it's the most efficient API usage. I want to display some content if the page is Vets or any sub page below Vets. My tree structure looks like this: Home Doctors Vets (ID 1116) - Vets sub page 01 - Vets sub page 02 - Vets sub page 03 - - Vets sub sub page 01 - - Vets sub sub page 02 - Vets sub page 04 Pilots Gardeners My working code is: <?php if ( $page->matches('id=1116') // Page is Vets Overview || // OR $page->parent->matches('id=1116') // Parent Page is Vets Overview ) { echo "My conditional content"; } ?> Thanks P
  16. Hi again @tpr I notice on the code below I am getting both a data-srcset and a srcset too. Is this correct? My input <?php $myimage = $page->Images->first(); ?> <img class="lazyload" data-src="<?php echo $myimage->url ?>" data-srcset="<?php echo $myimage->srcset('800x0, /2, /3') ?>" alt="" /> My output in browser <img class=" lazyloaded" data-src="/site/assets/files/1/photo-steps-video.jpg" data-srcset=" /site/assets/files/1/photo-steps-video.800x0.jpg 800w, /site/assets/files/1/photo-steps-video.400x0.jpg 400w, /site/assets/files/1/photo-steps-video.266x0.jpg 266w" alt="" srcset="/site/assets/files/1/photo-steps-video.800x0.jpg 800w, /site/assets/files/1/photo-steps-video.400x0.jpg 400w, /site/assets/files/1/photo-steps-video.266x0.jpg 266w" src="/site/assets/files/1/photo-steps-video.jpg" >
  17. Thanks everyone. I might try the route mentioned above.
  18. Thanks. That all sounds good.
  19. Hi guys Is it possible to have a PW site display content from another PW site? I've been reading about ProcessWire's Multi-site options and I don't think either is a way forward for me. Both PW sites are separate installs with separate databases but crucially they are on the same VPS. So I'm hoping that's a good thing. Basically, Site A has approx 100 reviews consisting of these fields Reviewer name Review Date Instead of setting up the fields onto Site B and duplicating work and creating 100 pages, I want to *somehow* get site B to use a selector to fetch the necessary content from Site A. In future, if I need to update the reviews, I can goto the 'source' Site A to do this.
  20. Are you replacing these manually or with some script?
  21. Thanks guys. I have it working now and see the relevant php docs That's cool. So we put $count++; at the end of the echo because when it loops back around, it uses this new value as the starting number. Good to know.
  22. I am trying to assign an incremental number to each image starting from 0 <li uk-slideshow-item="0"><img src="images/photo.jpg"></li> <li uk-slideshow-item="1"><img src="images/dark.jpg"></li> <li uk-slideshow-item="2"><img src="images/light.jpg"></li> The API docs mention I can use the following But when I apply it below, I get the following error Method Pageimage::eq does not exist or is not callable in this context Here's my usage foreach($item->images as $photo){ echo " <li uk-slideshow-item='{$photo->eq($n)}'><a href='#'><img src='{$photo->size(150,100)->url}' alt=''></a></li> ";} Thanks again P
  23. I have 2 repeater types working with the Repeater Matrix. To keep things simple, I have image gallery a downloads gallery. I can't quite figure out how to echo the contents from within a product_gallery. I can get the code below to display the text 'An image gallery' but not the bunch of images within this. I'm not sure though if it's my variable trail or my nested echo statement. <?php foreach($page->components as $item) { if($item->type == 'product_gallery') { echo " An image gallery..."; foreach($product_gallery->images as $photo) { echo " An image <image src='{$photo->url}'> "; } } else if($item->type == 'downloads') { echo " A download gallery... "; } } ?> Thanks P
  24. Glad you got it fixed. The causes of these things can be elusive?
×
×
  • Create New...