Jump to content

Zeka

Members
  • Posts

    1,065
  • Joined

  • Last visited

  • Days Won

    11

Posts posted by Zeka

  1. I have moved my local development domain from .local to .localhost and after this, I'm logged out from admin every time I visit the front of the site. I have tested it on several installations. On .local domain I've used  ' $config->sessionFingerprint = 2; '. But on .localhost I have to change it to ' $config->sessionFingerprint = 0;' to solve the issue, but I can't understand why it worked on .local domain, but doesn't on .locahost. 

    Do you have any idea what can cause it?  

    Thanks, Eugene.

  2. $your_field->label = ''; //first need to set field label as empty string (important!)
    $your_field->skipLabel = true; //works only if the label is set to empty string

     

    • Like 2
    • Thanks 1
  3. Hi @Soma. Thank you for your answer. 

    I still have the issue that this code doesn't find the page with non-default language

    if(input()->urlSegment2)
    		throw new Wire404Exception();
    
    if(input()->urlSegment1) {
      $pagename = input()->urlSegment(1);
      $language = user('language');
      $match = pages()->get("template=blog-category|blog-item, name={$pagename}");
      if(!$match->id)
      throw new Wire404Exception();
    
      echo $match->render();
      return $this->halt();
    }

    but this finds

    if(input()->urlSegment2)
    		throw new Wire404Exception();
    
    	if(input()->urlSegment1) {
    		$pagename = input()->urlSegment(1);
    		$language = user('language');
    		$nameFieldSelector = $language->isDefault() ? "name" : "name" . $language;
    		$match = pages()->get("template=blog-category|blog-item, $nameFieldSelector={$pagename}");
    		if(!$match->id)
    			throw new Wire404Exception();
    
    		echo $match->render();
    		return $this->halt();
    	}

    Do you have any idea what could be the reason? 

  4. There are several possible ways.

    1. Create template as you have proposed.

    2. Create custom field type with custom DB table schema. 

    3. Use Table field from Profields.

    4. Use wire $log (actually, don't think that it's an option here)

    Options 2 and 3 are more efficient from how they store data in DB. 

    • Like 1
  5. Does anybody get it working with Gmail SMTP? 

    I always get

    could not connect to the host "smtp.gmail.com": Connection refused 

    I have tried all possible combinations of settings and ports and double check my credentials. The same thing on localhost and remote hosts. 

    Is it something with Gmail? 

    --------------------

    Get it working on the remote host, ports were closed.

    But what can be wrong with the local setup? 

  6. @MarcoPLY

    You still posting to PHP file.  Instead, you can create a template, for example 'ajax'. Create a template file for this template. Now you have endpoint URL for your requests. 

    site.com/ajax/

    Then in your template file, you can do something like

    if($config->ajax) {
    	if($input->post->email) {
    		do something
    	}
    } else {
    	// $session->redirect("/"); 
    	// or
    	//throw new Wire404Exception();
    }

    Furthermore, you can enable URL segments for 'ajax' template and then you will be able to make requests to URLs like 'ajax/form/', 'ajax/cta/' etc.

    if($input->urlSegment2)
    throw new Wire404Exception();
    if(!$config->ajax) 
    throw new Wire404Exception();
    
    if($input->urlSegment1 && $input->urlSegment1 == 'form') {
    	do something
    }

    Hope you got the main idea. 

    • Like 1
×
×
  • Create New...