-
Posts
534 -
Joined
-
Last visited
-
Days Won
11
Everything posted by Sergio
-
Confession bear meme on tests: I'm a virgin. Never implemented any of them, mostly because I work alone for many years now. But found this cool project today, called Cypress. This is the easiest way to test a website or app I've found. Check their intro video out: https://docs.cypress.io/guides/getting-started/writing-your-first-test.html Note: I recommend this Chrome extension to speed up videos: https://github.com/igrigorik/videospeed as the narration of this video is kinda slow. ?
-
Page Hit Counter – Simple Page View Tracking
Sergio replied to David Karich's topic in Modules/Plugins
Hi @David Karich! Many thanks! I'll update, test and let you now ASAP.- 111 replies
-
- 1
-
-
- hitcounter
- tracking
- (and 4 more)
-
Cannot access page reference fileds in a hook
Sergio replied to easynowbaby's topic in Module/Plugin Development
Ops! Didn't know that, thank you Robin! ? -
Cannot access page reference fileds in a hook
Sergio replied to easynowbaby's topic in Module/Plugin Development
public function ready() { $this->pages->addHookAfter('added', function ($event) { $p = $event->arguments[0]; if ($p->template->name === "order") { // accessing page reference fields here doesn't work } }); } You forgot to check for the template name. -
Page Hit Counter – Simple Page View Tracking
Sergio replied to David Karich's topic in Modules/Plugins
Sure, but I should rephrase that, it should increment the counter for the page when accessing one, or more, of its segments. Considering the visitor is a different user or that the cookie expired, of course.- 111 replies
-
- hitcounter
- tracking
- (and 4 more)
-
For some bizarre reason, one of the links was broken. Fixed.
-
Page Hit Counter – Simple Page View Tracking
Sergio replied to David Karich's topic in Modules/Plugins
David, I checked here on my project. The module does increment the counter for a page that has Segments turned on BUT it doesn't increment the counter when you access "page-url/segment", which would be expected, right?- 111 replies
-
- hitcounter
- tracking
- (and 4 more)
-
Some previous threads and a module that may help you: https://processwire.com/talk/topic/6158-photography-galleries-best-solution Also, a better way to search the forums: https://cse.google.com/cse/publicurl?cx=014789015761400632609:fxrf0rj4wr4
-
Page Hit Counter – Simple Page View Tracking
Sergio replied to David Karich's topic in Modules/Plugins
Hey @David Karich , just passing by to say that I've sent two small PRs for correcting some typos. Super minor thing, but hope you like it. ? I'm planning to adapt your code to build another module, a download counter. My use case is where the file is hosted on another server, and its link is managed through a URL field.- 111 replies
-
- hitcounter
- tracking
- (and 4 more)
-
These commands should be done in the Linux command line, sorry for the confusion.
-
https://www.php.net/manual/en/function.setlocale.php#metaphone.example.phonemes
-
Custom look for page reference field select, radio or checkbox etc
Sergio replied to sambadave's topic in General Support
I have the same need and I was planning to use RunTimeMarkup module in some way to accomplish this. The difference is that I have these settings on my ProFieldMatrix content blocks instead. Didn't do it yet though, as I have to finish other things first on the project. But If you give it a try, let me know how was it. -
Of course, this it_IT locale needs to be installed on our server to work. So, on a Linux server: //List installed locales $ locale // Install yours if not on that list $ locale-gen it_IT.UTF-8
-
It is it_IT.UTF-8 like Ivan mentioned. Is the language and the country/region, for instance: pt_PT and pt_BR. On for Portugal and the other for Brazil.
-
Add this line on config.php for English (or change it for Italian). /** * Server locale setting * */ setlocale(LC_ALL,'en_US.UTF-8');
-
Great idea, Robin! I was thinking about creating something similar for my current project, this is perfect for its use case. Thank you!
- 13 replies
-
- 2
-
-
What made you change? Long time user of 1Password here and didn't see a good reason to move away. Price is almost the same.
-
I'm using Linux Mint fulltime for a couple of weeks now, as a test, and got everything working fine for developing a project in PW. Much snappier than Windows on my ThinkPad P51 (Intel Xeon, 32GB RAM). Got it installed on a different SSD drive. The only problem is that I use Adobe tools to work as well and got a Win 10 VM with them when simple things are required but probably will need to reboot to Windows when complex things are needed, like editing a large document, as I could not configure the VM video memory for more than the VirtualBox default; so that's a problem I need to solve. Also created a MacOS VM for browser testing, but it's pretty slow on Virtual Box. The only issue on Linux Mint I'm having is that when watching videos there's some small flickery occurring sometimes. Probably an NVIDIA driver issue, but I can live with it for now.
-
Thanks, Rudy! Glad to know it wasn't just me and my setup ?
-
A couple of days ago, I had an issue with Valet on Linux and Tracy. Tracy bar was not loading, giving me an error saying $_SERVER['REQUEST_URI'] was returning a boolean when expected was a string. I solved this by 'brute force' like below but would like to understand the reasons for that. Does anybody know? //ProcessWireValetDriver.php $_SERVER['REQUEST_URI'] = substr(str_replace($dir, '', $_SERVER['REQUEST_URI']), 10); //brute force if(!$_SERVER['REQUEST_URI']) { $_SERVER['REQUEST_URI'] = "/"; } ....
-
Yes, is not the best solution from a UX point-of-view. But I don't think that adding it below the title, as WP does, is the best way around. In most cases, we don't want the user to edit the page name by mistake. In your situation, I would take a look at @adrian's PageRenameOptions module https://modules.processwire.com/modules/page-rename-options/. Another option is to add a warning, using a hook, if the page title is edited to alert the user to also change, or check, the page name on the Settings tab.
-
Yes, it's possible. Set $config->advanced = true; on your config file and a "System" tab will appear while editing the template. And there you can make the change. See screenshot. Similar thread:
-
You can pass a "numPageLinks" option to the $page->render method, like so: $options = array( 'numPageLinks' => 10, 'nextItemLabel' => '<i class="uk-icon-angle-double-right"></i>', // 'nextItemClass' => '', 'previousItemLabel' => '<span><i class="uk-icon-angle-double-left"></i></span>', // 'previousItemClass' => '', // 'lastItemClass' => '', 'currentItemClass' => 'bg-orange', 'separatorItemLabel' => '<span>…</span>', 'listMarkup' => "<ul>{out}</ul>", 'itemMarkup' => "<li>{out}</li>", 'linkMarkup' => "<a href='{url}' class=''>{out}</a>", 'currentLinkMarkup' => "<span class=''>{out}</span>" ); echo $pager->render($posts, $options);