Peter Knight
Members-
Posts
1,377 -
Joined
-
Last visited
-
Days Won
5
Everything posted by Peter Knight
-
That's it - thanks @tpr I had another small error which is fixed now too. I needed to surround the $item->title in double quotes. Cheers
-
Hi guys I have a simple echo statement as follows echo " <h3 class='uk-accordion-title'> $item->title </h3> " I want to add a script provided by ZOHO which tracks clicks on certain web page objects. <a onclick='$zoho.salesiq.visitor.customaction("Track-signup-button")'> SignUp </a> This would be the resulting code when I add that echo " <a href='#' onclick='$zoho.salesiq.visitor.customaction('$item->title')'> . </a> <h3 class='uk-accordion-title'> $item->title </h3> " When the HML is output, it almost works BUT the variable $zoho gets removed every time. <a href='#' onclick='.salesiq.visitor.customaction('Our Location')'> . </a> <h3 class='uk-accordion-title'> Our Location </h3> Is this a bug with my method or some escaping issue? Thanks
-
<?php if ($page->path == "/blog/posts/"){ echo "<script type='text/javascript' src='//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-55e5693b9add30c6'></script>"; } ?> I'm trying to output a script on my blog posts only. They're all children of /blog/posts/ so I thought the above might work. That seems to work only when the page loaded is exactly /blog/posts/ How can I tweak this to work on any page containing /blog/posts/ in it's URL / path and not just /blog/posts/ ? I've been to the API and tried a few variations using the following if ($page->path *= "/blog/posts/") but I think they're more selectors for fields?
-
Sorry - I've managed to confuse you. I wondered if 'local' meant the optimizers *should* be installed on a server or a local machine. I'm pretty sure they're server based but I normally understand 'local' to mean the desktop / laptop on front of me. Anyway, I'm sure optimizers are installed on the host server. No need to revert and thanks again for the help.
-
Thanks for the info. Forgive my ignorance but when you say 'local optimizers' are these installed on my VPS or on a local machine?
-
Not a problem. Thanks for getting back to me. I don't see anything obvious but not entirely sure what to look for. progress.json only has 1 line: {"percentComplete":"1","counter":"Optimizing image 32 out of 2039 - 1% complete","percentNew":"0","error":null,"file":"phoot-security.0x100.jpg","basedir":"1079","url":"https:\/\/www.domain.co.uk\/site\/assets\/files\/1079\/phoot-security.0x100.jpg"} Error log displays a list of files and their reduction and then there's one in error in particular 2017-03-22 12:15:00 Error optimizing /var/www/vhosts/domain.co.uk/httpdocs/site/assets/files/1072/085---dc3420.0x100.jpg, 404 BTW I'm using the online service for all of these. Perhaps I should try install a local optimization tool too?
-
That worked. Thanks matjazp I have a site with about 1951 images to be uploaded and downloaded to reShmush.it server I realise this can be CPU intensive but am running some tests. I always have an error at around 2% of upload Each image is well below 5MB. I wondered if there was a limit to the amount of actual images which can be processed at any one time?
-
Nice - thanks
-
Hi Adrian Thanks for the tip. I normally do install via class name but CI 3 at the time had a more recent version which was only available from GitHub as a ZIP. At least I think that was the case. Thanks anyway for the help.
-
I think I've found the issue. My uploaded CI folder still have the "-master" name. Seems to be working now.
-
I have a recurring prob on PW 3.0.42 and CI 3 v.1.0.0 on PHP 7.0.16 Anytime I try to edit a page which uses an image crop, I get the following error I've refreshed the Modules several times (that worked before) but the problem persisted. I thought perhaps ProCache wasn't helping so I disabled that too temporarily. Anyone have similar issues ?
-
It's wierd alright. This works on it's own <?php if($page->home_hero_image->count > 1 ) { $bgimage = $page->home_hero_image; echo '<script>$("#bg-home").backstretch(["'; echo $bgimage->implode('", "', "url"); // results in url", "url", "url echo '"], {duration: 5000, fade: 1000});</script>'; } ?> Might even be an issue with the whole if, then logic.
-
Hi guys related to above. I have working code which I need to adapt so that $.backstretch becomes $("#bg-home").backstretch Full example below. Everytime I try to surround the #bg-home with double quotes or even escape it, I get a syntax error. <?php // if home_hero_image field contains more than 1 echo images in a slideshow // Mainly for Homepage if($page->home_hero_image->count > 1 ) { $bgimage = $page->home_hero_image; echo '<script>$(#bg-home).backstretch(["'; echo $bgimage->implode('", "', "url"); // results in url", "url", "url echo '"], {duration: 5000, fade: 1000});</script>'; } else // otherwise echo a single image on its own // Mainly for all other pages if($page->home_hero_image->count == 1 ) { $bgimage = $page->home_hero_image; foreach ($bgimage as $image) { echo" <script> $(#bg-home).backstretch('$image->url'); </script> "; } } ?> <!--END Backstretch--> Why would $(\"#bg-home\").backstretch not work on this occasion?
-
Thanks @Soma That was it.
-
I just had same issue after an upgrade to 3.0.51 and it couldn't be fixed by flushing the Modules.
-
If you're moving to HTTPS, please note that Google considers your HTTPS and HTTP sites as 2 different sites. Get all your Search Console verifications set up for www, non www, https, http etc etc and monitor closely. Lots of great articles out there on making the switch without killing your rankings.
-
What would be best approach to hide certain sub-pages from a specific parent? Here's my menu structure. Home Solutions - Solutions Overview - Solution 1 - Solution 2 Services - Services Overview - Service 1 - Service 2 Blog - Blog Post 1 - Blog Post 2 - Blog Post 3 When I mouse over Solutions and Services, I want to see my child pages as sub-menu items (I have this working) but I don't want my blog posts to be showing as a sub-menu. If I could tell the Module not to display certain templates (blog post), that would solve it for me. Normally I've gotten around this by having my Blog setup as follows Blog - Posts (hidden) - - Blog Post 1 - - Blog Post 2 - - Blog Post 3 That's all good but it does create a longer URL http://www.domain.com/blog/posts/blog-post01 than moving the post to the root of Blog and ending up with http://www.domain.com/blog/blog-post01 Cheers
-
Yep - worked, thanks. It was more like 'Modules refresh' X 5 but I got there
-
Oops - I accidentally upgraded a small site from 2.7.X to 3.X not realising that CI was running and am getting following error: Error: Uncaught Error: Class 'ProcessWire\ProcessCroppableImage' not found in /var/www/vhosts/domain.com/httpdocs/site/modules/ProcessCroppableImage/InputfieldCroppableImage/InputfieldCroppableImage.module:170 Stack trace: #0 /var/www/vhosts/domain.com/httpdocs/site/modules/ProcessCroppableImage/InputfieldCroppableImage/InputfieldCroppableImage.module(147): InputfieldCroppableImage->getCropLinks(Object(ProcessWire\Pageimage)) #1 [internal function]: InputfieldCroppableImage->___renderItem(Object(ProcessWire\Pageimage), 'Images_e711d4de...', 0) #2 /var/www/vhosts/domain.com/httpdocs/wire/core/Wire.php(348): call_user_func_array(Array, Array) #3 /var/www/vhosts/domain.com/httpdocs/wire/core/WireHooks.php(548): ProcessWire\Wire->_callMethod('___renderItem', Array) #4 /var/www/vhosts/domain.com/httpdocs/wire/core/Wire.php(373): ProcessWire\WireHooks->runHooks(Object(InputfieldCroppableImage), 'renderItem', Arr (line 170 of /var/www/vhosts/domain.com/httpdocs/site/modules/ProcessCroppableImage/InputfieldCroppableImage/InputfieldCroppableImage.module) This error message was shown because: you are logged in as a Superuser. Error has been logged. Would the manual upload of the PW3 folder and creation of CI3 image field solve this or do I need to restore the site to 2.7X and start again? I'm out of the office right now and thought I'd ask first in case it makes things worse. Thanks P
-
I think this was an error from running 2.7.3 (or similar). Upgraded to 3.0.33 and all is working.
-
I get the following error when installing from PW Modules. Also tried to download and install direct from github. It seems to install fine but this error is apparent when I click the Settings button on AutoSmush 1.0.5
-
Hi I notice if you add a hashtag after a PW domain, you can still access that page as opposed to a 404 page IE processwire.com/# processwire.com/about/# both load the correct page. An SEO company one of my clients use has pointed out that the duplicate pages are getting indexed in Google. Shouldn't the URLs above load the 404 page instead?
-
MarkupSEO - The all-in-one SEO solution for ProcessWire.
Peter Knight replied to Nico Knoll's topic in Modules/Plugins
I noticed that 3.0.42 works with this module but there is some odd-ness when ProCache is installed and enabled MarkupSEO auto injects the Google Analytics code Some minify HTML options are ticked I'm wondering if ProCache is choking on MarkupSEOs injection of the following when it tries to minify it <!-- Google Analytics --><script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga');ga('create', 'UA-XXXXXX-X', 'auto'); ; ga('send', 'pageview');</script> <!-- End: Google Analytics --> I can't quite pinpoint it but disabling all Minify HTML option works. -
MarkupSEO - The all-in-one SEO solution for ProcessWire.
Peter Knight replied to Nico Knoll's topic in Modules/Plugins
Are any you guys having trouble with PW 3.0.42 onwards running ProCache too? -
MarkupSEO - The all-in-one SEO solution for ProcessWire.
Peter Knight replied to Nico Knoll's topic in Modules/Plugins
I'm glad you brought this up. One of my sites visibility on Google tanked a few days / weeks ago and I finally tracked it down to this. Since upgrading to 3.0.45 the following no longer outputs any META Tags <?php echo $page->seo->render;?> Keen to hear other ideas etc I'd consider this critical