-
Posts
356 -
Joined
-
Last visited
-
Days Won
5
Posts posted by qtguru
-
-
52 minutes ago, bernhard said:
Nice, thx for sharing and welcome back to ProcessWire ? I like the design and I think it gives a good impression of who you are. I also had not the best experience with the navigation. First try was to scroll down but nothing happened, only the menu disappeared. Scrolling several times more finally showed the next section.
What could be missing (if that's not intentional) is a statement what you are looking for. Are you available for hire? Or do you just want to share your projects? I don't get that from the website ?
Lol yes I am not sure what I was thinking when I did the navigation, I guess I got too carried away after looking at awwwards and dribbble. I will work on that
54 minutes ago, bernhard said:What could be missing (if that's not intentional) is a statement what you are looking for. Are you available for hire? Or do you just want to share your projects? I don't get that from the website
Hmmmm this is a very interesting point, So what I aim to achieve is to have a website, where I can share my works, concepts and any crazy idea that comes to mind. I still have so much content to populate the site with, I tend to research and write things down, so I want to use my site as an avenue to share my works. Because I have been told by colleagues that I need to showcase my works and ideas more and also participate in community projects too. That's my goal. I won't mind any advice. Thanks and good to be back.
- 1
-
5 minutes ago, psy said:
Nice ? home page nav was a bit confusing for me, eg when clicking on 'About', it scrolled to your About section but the menu disappeared. There was no obvious way to get back to the top of the page. When I scrolled up, the menu had disappeared. Using iMAC with wide screen. Going into phone mode in Chrome dev tools made it a bit easier... Otherwise, well done you!
Thanks Psy , I will work on that
- 1
-
Hi guys, so since I moved to Processwire, it has been my default go-to CMF/CMS for my website and client applications, apparently my previous job took a toll on me, and made me have less time, but now finally had the chance to change my website to something I always had in mind.
I decided to go with something minimal, as I tend to enjoy writing, so wanted a website to have more text than graphics and I think I whipped up something clean. Currently I still have more to do, but this is my current website, the main purpose to have a content driven website where I will be writing tutorials , articles more and hopefully technical notes.
Please let me know your honest opinion.
PS: I am more of a coder than a designer but i think this old dog still pulled it off
- 13
-
Processwire API and minimalism is so much lean that it feels like you are still writing PHP compared to other CMS which are overly complex, I think Processwire is easy to use Project with so many things taken care of, especially the fields, It's so much easier to build applications for client easily than other frameworks/cms because Processwire provides so many features that are vital.
- 3
-
have you covered this ?
Enabling Pagination
- Make sure the "Pager" (MarkupPagerNav) module is installed in Admin > Modules. If it's not installed, click the Install link next to it.
- Determine what template(s) you want to use pagination with. Go to Admin > Setup > Templates > [Your Template] > URLs, and check the box for: Allow Page Numbers. Save.
- Pagination should now be enabled and ready to use in your templates.
-
Hi you might call it dumb, but this is actually interesting, I was thinking is there any mechanism to /condition to stop a Hook from being called, so pardon this jargon, so I took the time to see if such exists
public function runHooks($method, $arguments, $type = 'method') { $result = array( 'return' => null, 'numHooksRun' => 0, 'methodExists' => false, 'replace' => false, ); $realMethod = "___$method"; if($type == 'method') $result['methodExists'] = method_exists($this, $realMethod); if(!$result['methodExists'] && !self::isHooked($method . ($type == 'method' ? '()' : ''))) { return $result; // The condition for not running is when not hooked or method doesn't exist } $hooks = $this->getHooks($method); foreach(array('before', 'after') as $when) { if($type === 'method' && $when === 'after' && $result['replace'] !== true) { if($result['methodExists']) { $result['return'] = call_user_func_array(array($this, $realMethod), $arguments); } else { $result['return'] = null; } } foreach($hooks as $priority => $hook) { if(!$hook['options'][$when]) continue; if(!empty($hook['options']['objMatch'])) { $objMatch = $hook['options']['objMatch']; // object match comparison to determine at runtime whether to execute the hook if(is_object($objMatch)) { if(!$objMatch->matches($this)) continue; } else { if(((string) $this) != $objMatch) continue; } } if($type == 'method' && !empty($hook['options']['argMatch'])) { // argument comparison to determine at runtime whether to execute the hook $argMatches = $hook['options']['argMatch']; $matches = true; foreach($argMatches as $argKey => $argMatch) { $argVal = isset($arguments[$argKey]) ? $arguments[$argKey] : null; if(is_object($argMatch)) { // Selectors object if(is_object($argVal)) { $matches = $argMatch->matches($argVal); } else { // we don't work with non-object here $matches = false; } } else { if(is_array($argVal)) { // match any array element $matches = in_array($argMatch, $argVal); } else { // exact string match $matches = $argMatch == $argVal; } } if(!$matches) break; } if(!$matches) continue; // don't run hook } $event = new HookEvent(); $event->object = $this; $event->method = $method; $event->arguments = $arguments; $event->when = $when; $event->return = $result['return']; $event->id = $hook['id']; $event->options = $hook['options']; $toObject = $hook['toObject']; $toMethod = $hook['toMethod']; if(is_null($toObject)) $toMethod($event); else $toObject->$toMethod($event); $result['numHooksRun']++; if($when == 'before') { $arguments = $event->arguments; $result['replace'] = $event->replace === true || $result['replace'] === true; if($result['replace']) $result['return'] = $event->return; } if($when == 'after') $result['return'] = $event->return; } } return $result; }
As you can see there isn't any logic to stop hooks from running other than if the arguments are wrong and method doesn't exist or the method itself in question is not hookable. However using an exit should work since the exit method stop the execution of the current script. I think the concept of Hooks is you attaching to them and not stopping them.
But another alternative would be to remove the check from the hook and and have the check determining whether to call the WireHttp::send
Let me know if that suffices
- 1
-
Oops I get the confusion now, sorry my fault I assumed it was the same when i saw horst name here is the link:
- 2
-
Sorry I was referring to topic you posted, the author there had an issue making PATCH Request using WireHttp, I was only pointing that out should you encounter such.
-
Horst beat me to it, WireHttp is basically a wrapper around CURL, However that thread you linked, pointed out something about making a PATCH Request.
-
Out of curiosity, can you dump the data being sent out and validate it's the proper data you intend to send also this stackoverflow also details a way of making PATCH curl calls.
https://stackoverflow.com/questions/14451401/how-do-i-make-a-patch-request-in-php-using-curl
- 1
-
3 minutes ago, HMCB said:
Other than having bought a book there once, I’ve not returned to Leanpub but it does look like a great idea. The multiple-book format is nice. I’ve been buying more through Kindle and bringing writings into Kindle does seem nice. And the other formats make it accessible to all.
Maybe you can take suggestions on content. In my opinion, starting small/very basic is a good starting point.
I have written tutorials here and various tutorials before, it's fun for me however I think starting small is a good idea. I will create a thread for this today or tomorrow where we can deliberate on table of contents and all.
- 3
-
I don't know if this is in works, because I have much free time ( Change of Job) , I am thinking of picking this up, using something that generates from Markdown via Github, I have looked at Leanpub, @HMC
is right, a table of content is necessary, I will create a thread for this, because I think it is long due for this. However I will prefer somewhere , where people can edit and push for changes, Git seems to fit for this purpose if anyone has any comments, please feel free to chime in.
- 2
-
Here is a link to the source of my website, I used Twig for it, I will try and create a repo for this, this week
https://github.com/dojoVader/My-Website/blob/master/remipw-next
- 1
-
That's not a bad idea, I love writing tutorial and that thought has always been there, maybe it is something I can look at except that payment issues is one that discourages me from sure since my country has so many restrictions, but it is something that is due. A book someone can follow from scratch to finish. Good idea
- 3
-
I have been absent in the PW scene, I am still curious about this ChangeLog i think it's long due, is there a repo on it ? or anyone working on it, so i can contribute.
-
On 6/10/2018 at 8:42 AM, Sten said:
Hello Sephiroth,
Thank you for your tutorial, it is very precious although this code above does not work for me.
I had{% block content %}
{% endblock %}which had no problems but did not display the block content.
Thank you for any help.
Sten
{block name="content"}{/block}
Sorry about that, that was a smarty template, my brain went into Smarty mode the correct syntax is what you provided, in your layout where you arr inheritting from, ensure you have something like this
{% block content %} {% endblock %}
-
How i think i might need a new laptop for gaming. nice site. My Nvidia 830M is outdated
-
4 hours ago, horst said:
something like this should work:
<?php class Submissions { protected $site = null; // <= add a handle for the site public function __construct($site) { $this->site = $site; // <= assign the site to the class handle } function insert($data) { $this->site->pages->find(....); // <= use the site through the class handle } }
function insert($data) {
$this->site->pages->find(....); // <= use the site through the class handle
}The problem i find with this, is that now your class knows too much about the site pages, it would be better to simply pass the data, else this would lead to tight coupling, unless you have to create an interface and ensure the contracts are followed.
-
3 hours ago, php said:
Thank you both, this is exactly what I needed. @Sephiroth is your code PHP 7? My IDE didn't like it, but the method worked. I have learned something useful!
Lol I write Java in the office so i make the mistake of fusing Java into PHP.
-
So the reason for uses Classes, is that you want to hide complexity and just expose the method in a clean manner, and also you want to deal with properties internally without side effects as you would when doing procedural type of coding. So if you want to pass any data to your classes, there are multiple ways but the best way is to always pass the data by copy in either constructor like this
<?php class Submisssion{ private data; __construct(data){ $this->data=data } }
or using a Setter method
<?php class Submission { private data; public function insert($data){ $this->data = $data; } $submission->insert($data);
What this does is pass the data through a method and achieves the same as the constructor, because this way the Submission class can handle manipulation of data without external change outside the class.
Which is why OOP is usually preferred as alot of things are hidden and the methods are made simple so you can use a Class without having to read the internal details.
- 1
-
You need insight and analytics, whne you say it's slow is it as a result of time to render on the client, or do you mean time a method or function takes, you will need a profiler for both frontend and the backend to have more detailed information.
-
23 hours ago, bernhard said:
Hi @Sephiroth, thanks for your hint. I know about the cell renderers, but it's not exactly what I'm looking for. If you are only working with one table (grid) then cell renderers are perfectly fine, but I want to make it possible to modify the setup of the table by external plugins, modifying the cell renderers by the needs of the plugin without having to change the initial gridOptions object.
For example I want to have a plugin that shows column statistics. Or one that shows tooltips when hovering over a cell. One that shows action buttons (show page details, delete row, open link in new tab etc). And of course both need to work in combination. So I need to apply multiple cell renderers based on some parameters. I'm thinking of building one cell renderer that applies all the others and does something similar to what we know from processwire hooks: Passing parameters, modifying return values.
What I do NOT want is that the user has to apply complex cellRenderers with a squillion of if/else in the grid's options object
Hope that makes sense. Any hints welcome
Oh i see what you mean, an external plugin that adds to the column without altering the data , Hmm I will look at the documentation more. I think i get now
- 1
-
Glad to hear JeevanisM, even recently I was thinking of a Github open book about Processwire, but I am somehow a bit of a procrastinator sometimes, I guess I will map out something for that.
- 1
-
I maybe be wrong but it seems, you want to render a certain info based on the data provided, ideally most Table give options to enable you have power over the rendering process.
Does this satisfy your feat, and also it's like a plugin too
https://www.ag-grid.com/javascript-grid-cell-rendering-components/
- 2
Personal Website
in Showcase
Posted
Lol I have a good job, I am just looking to showcase my skill and I guess inspire people. Yeah it's just for fun and showcasing my thoughts. Hopefully as time goes by, there would be much more content to share.