Peter Knight
-
Posts
1,374 -
Joined
-
Last visited
-
Days Won
5
Posts posted by Peter Knight
-
-
22 minutes ago, LostKobrakai said:
You could create hanna codes, which call code stored elsewhere.
True ?
whatd also be great is a module that watched a Real folder where you added your HC chunks. Anything dropped in there would auto create a matching HC in the admin.
-
That’s very helpful. Thanks for taking time to type it all up.
I really like Hannah Code but I also wish I could store my PHP in files within templates/components or such instead of having to edit and add to a HC
personally it’s esaier for me to edit using sublime text etc than try to tweak a HC
-
2 hours ago, elabx said:
I have sometimes used a combination of repeater matrix with a "identifier field" that is later used as an attribute in a hannah code.
Thanks for the info. Can you provide an example of your repeater code and the basic Hannah code mechanism?
-
I have a template where a slider widget appears within my clients body tag. It’s never in the same place twice and client wants freedom to add and remove it as they need
And I wondered if I am up to date on my options in PW to achieve this..
A) use the pro fields matrix field type to allow client to add the premade slider. They can then follow this by adding another body/content field.
B) make the slider a Hannah code chunk. Client can then add manually or use the Hannah code plugin to insert.
Are they my 2 main options ? Sometimes the latest methods mentioned in the recent blog posts don’t really make sense to me until I really need a new way to do things and someone says “hey checkout markup regions” etc. there’s possibilly newer ways to execute this.
Cheers
-
Thank you!
So straightforward when you see how.
I got up at 5AM this morning to work on this project and thought I'd get a good 12 hours at it. Instead, I had computer and internet problems all day. At least I can wake up tomorrow AM (not at 5AM though) knowing I have this fixed ?
-
I could go that direction if I had separate sub-pages. But these quotes are repeaters within each page. Or did I misunderstand your approach?
-
Hi guys
A few pages on my site are required to output a random quote from a bunch of 5 which are associated with that page.
IE
About has 5 quotes
Home has 5 quotes
Company has 5 quotesNormally I'd just make a few child pages for each parent and give it it's own template. Using a selector to do that would be easy.
However, I've decided to go down the route of adding each pages 5 quotes to a repeater field.
I can output ALL the pages quotes using this...
<?php foreach($page->one_liner_group as $one) { echo "{$one->one_liner}<p>"; }?>
but I'm not so sure where to add (limit=1) and getRandom when using repeaters within a page.
Thanks
-
Hi guys
I'm building a homepage with a full screen, responsive video background.
The client wants the video file to be hosted on their own server and I wondered if instead it should be hosted on YouTube instead.
I'm thinking that YouTube will have much better bandwidth detection etc and handle the playback more intelligently than simply throwing an MP4 on a server.
If anyone has any experience with both scenarios, can they confirm or deny?
Thanks
P
-
Hi
One more question
I have 2 FTP applications here successfully connecting to a destination server over FTPS SSL/TLS
When I add the exact same credentials to Duplicator, I get the following
Quote2018-09-06 15:00:43: - job finished in 110.8802sec
2018-09-06 15:00:43: [FTP] error: cannot upload file <2018-09-06_14-58-52-www.domain.co.uk.package.zip> on server.
2018-09-06 14:59:40: FTP: starting upload of /home/sites/domain.co.uk/public_html/site/assets/backups/2018-09-06_14-58-52-www.domain.co.uk.package.zip
2018-09-06 14:59:40: FTP: directory listing of Backups successfull.
2018-09-06 14:59:40: FTP: retrieving directory listing of Backups...
2018-09-06 14:59:40: FTP: directory listing of Sharey01 successfull.
2018-09-06 14:59:40: FTP: retrieving directory listing of Sharey01...
2018-09-06 14:59:39: FTP: logged in.
2018-09-06 14:59:39: FTP: connection established.
2018-09-06 14:59:39: FTP: connecting to myserver.com:21...
2018-09-06 14:59:39: - package built successfully in 46.558444secSo it looks like Duplicator is successfully building the package, logging in to the server and listing the directory files. It only fails to actually upload the ZIP
There are no size restrictions on the server and there are I have disconnected the other FTP apps to ensure that's not the issue either.
Any ideas why the upload might fail? This only happens on TLS/SSL and not under 'regular' unencrypted FTP
Thanks
- 1
-
I notice on the Module settings that the username and password are displayed in plain text.
I've a few admins that I wouldn't like to be able to view these. Is masking these on the roadmap or even encrypting them?
Does this also mean that they're stored in the database in plain text?
Thanks
- 1
-
On 2/12/2016 at 9:45 AM, iNoize said:
1and1 check your htaccess
I know this problem there
# RewriteBase / # RewriteBase /pw/ # RewriteBase /~user/ change to RewriteBase / # RewriteBase /pw/ # RewriteBase /~user/
Worked for me too. Thanks for the tip.
Interestingly if you think it'd the database connection error, please try the above first.
I couldn't connect to the database remotely (since learnt this is disabled) or via their own php test scripts. Was convinced it was database until the above worked.
-
10 minutes ago, LostKobrakai said:
A php setting can never override what htaccess does. PHP is not even started when the htaccess file is read/executed.
So the config setting ($config->noHTTPS = true; ) is ineffective if there’s a htacess setting of always use https ?
That seems a bit odd as any site running Http would probably have this htaccess directive enabled for SEO reasons.
-
Thanks, Ryan for the https config setting.
Few Qs if you've got time
- Does this need to be manually included in a config? I just updated to 3.0.110 © 2018 and noticed it's not there (possibly is not meant to be).
- Even after including this, I notice the HTTPS setting in the htaccess file over-rides this. it's be great to have a config that over-rides both the HTTPS and www V non www settings too
-
The current PW homepage has a few screenshots of the admin featuring the old UI.
@ryan For what it's worth and because I had 5 minutes I remade it in the new UIKit theme. It's just a screengrab - nothing fancy.
Might not even be the right size but it's been annoying me irrationally for months ?
- 5
-
Anyone using Google Maps and unhappy with their recent changes might want to explore the updated ToS from maps service, Here
- 2
-
On 5/2/2018 at 6:34 PM, Zeka said:
You can change label field globally in the setting of ProcessPageList module - {title} | {template.name}
Thanks @Zeka Worked for me on 3.0.X and saved me applying to individual templates.
-
8 hours ago, Soma said:
It actually only adds active to the active nav item. All parents of the active nav items get "parent". The first options in MSN. https://github.com/somatonic/MarkupSimpleNavigation#same-with-comments
$options = array( 'parent_class' => 'parent', // overwrite class name for current parent levels
Cheers Soma.
-
On 5/7/2016 at 2:19 PM, Ivan Gretsky said:
@Peter Knight: I believe it is this option:
'current_class' => 'active'
This doesn't seem to work. It only applies 'active' to the active child link.
On a drop down menu any page/link that is active should have it's root parent marked as active too.
On my example a user has no obvious indicator of what 'section' they are on just by looking at the top navigation bar.
-
What could it mean when latest PW is not showing in the Upgrade Module?
I've reinstalled it subsequent to this screenshot bit the Dev and Stable versions are sill a few versions behind the real versions.
https://www.evernote.com/l/ANK7GoqdE9lFwrWhhWTMduCUzwEpN8d694c
-
I have a 3.0.62 site running the RenoTheme.
Even when ChangeLog is installed there is no link under the Setup Tab.
I can confirm ChangeLog can be found in the tree under Admin > Setup
-
On 7/17/2018 at 6:28 PM, adrian said:
Hi @netcarver - thanks for your thoughts.
Anyone else have any thoughts on how best to proceed to ensure no-one breaks there site when upgrading to my new version? Maybe I just need to add an upgrade() method that prevents the module from updating old installs?
I'd simply call it a new version with a different fork . Put a notice on the current version that a new version is available.
Perhaps a user like me can have V1 installed and then simply install separately install V2, test and then remove V1.
-
3 hours ago, gebeer said:
@Peter Knight What do you want to do with products that do not have images? In your foreach you define the $image variable only when there are images. Then you echo the images even if there are none. This will give you a PHP notice for $image is undefined. You'd need another if condition within your echo to check for isset($image) and only output the image if there is one.
The way you setup your images field it should definitely return an empty array if there are no images so the
if (count($prod->images))
should work as expected.
Makes sense. Wasn't aware of isset so I'll look forward to using ?
-
Thanks @gebeer
That's not having any effect.
My images field has the following properties
Max Files allowed
0Formatted value
AutomaticJust to recap, I am trying to
- check that an images field is populated
- if so - create a variable called $image
- safely output an image based on the 1 and 2 above being tru
<?php $products = $page->children(); foreach ($products as $prod){ // Check that images field is poulated if (count($prod->images)) { // Create variable from first image in field $image = $prod->images->first(); } ?>
<?php echo" <div> <div class='prod-ov-wrapper'>"; // If the pages are the following (Rollers contain tall/thin images) if ($page->matches('id=1129|1145|1160|1163')) { echo " <a href='$prod->url'><img src='{$image->url}' class='prod-preview-tall'></a> "; } else { // If any other page echo " <a href='$prod->url'><img src='{$image->url}' class='prod-preview'></a> "; } echo" <div class='prod-ov-text'> <span class='preview-title'><strong>Part No:</strong> {$prod->title}</span> <br/> {$prod->prod_summary} <a href='$prod->url' class='uk-icon-button icon-linky' uk-icon='icon: chevron-right'></a> </div> </div> </div> ";} ?>
-
Thanks you both. It's working somewhat inexplicably now with no changes at my end ?
I have a feeling a database and server backup which was running was affecting this. That's the only explanation I can think of.
- 2
List child pages of a specific path
in General Support
Posted
I have a structure as follows
Department A
- meet
-- John
-- Will
Department B
- meet
-- Lisa
-- Amy
I want to give Department A and B the same template with a general selector that will list only the people in its child 'meet' folder.
Normally I'd just specify a parent id but because both Departments need to list their people, I am looking to list by a path.
IE
Department A will only list John and Will
Department B will only list Lisa and Amy
I'll keep hammering away at it ...