Jump to content

qtguru

Members
  • Posts

    356
  • Joined

  • Last visited

  • Days Won

    5

Posts posted by qtguru

  1. 9 hours ago, bernhard said:

    ...to get rich? ...to find a woman? ...to get happier in life? ...just for fun? ? Little bit kidding here, but imho the most important question is the "why". Or the "goal" why you are showcasing that. Did you see last weeks showcase of https://siebennull.com/ ? It can be as simple as that:

    JAZNQmX.png

    That's what marketing people call "call to action". I didn't see one on your site

    Just checked back and found it:

    d1D0Dmz.png

    Has it been there before? If the main goal of your website is getting possible new clients I'd say that a small single line with your e-mail is maybe not the best option ? If you don't want to get spammed by client requests because it's a just-for-fun-showcase website, then that would be fine - it's all about the main goal ? 

    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. 

    • Like 6
  2. 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. 

    • Like 1
  3. 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 

    • Like 1
  4. 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

     

    https://okeowoaderemi.com/

     

     

    Annotation 2019-08-28 171120.jpg

    Annotation 2019-08-28 171209.jpg

    Annotation 2019-08-28 171300.jpg

    image.png

    • Like 13
  5. 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. 

    • Like 3
  6. have you covered this ?

    Enabling Pagination

    1. Make sure the "Pager" (MarkupPagerNav) module is installed in Admin > Modules. If it's not installed, click the Install link next to it.
    2. 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.
    3. Pagination should now be enabled and ready to use in your templates.
  7. 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 

     

    • Like 1
  8. 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.  

    • Like 3
  9. 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.

    • Like 2
  10. 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 

    • Like 3
  11. 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 %}

     

  12. 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. 

  13. 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. 

    • Like 1
  14. 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 

    • Like 1
×
×
  • Create New...