Jump to content

RyanJ

Members
  • Posts

    207
  • Joined

  • Last visited

Posts posted by RyanJ

  1. GoDaddy hosting had a similar issue not too long ago with what you described. They of course never admitted fault, but coincidentally, every WP site that was affected just happened to be hosted on GoDaddy. I had a client site that was affected numerous times. I cleaned up the affected files and two days later it was there again. I moved the cleaned site to a new host and never had the issue again. *knocks on wood*

    • Like 1
  2. I have two installations of PW on the same domain. 1. being in the root and another being in a sub directory. I took Ryan's advice and created a symlink for the wire directory, but I was curious if I needed the following files in the sub directory as well.

    .gitignore

    .htaccess

    I am not sure if the ones in the root would suffice?

    **Edit

    Looks likes Teppo answered my question above and I over looked it. 

  3. It seems you are one the right track. I too struggled with structure and read the excellent guide written by kongondo you posted many times. My advise is to set up your site locally and start building it. Read the api and pay attention especially to the selectors. 

    In my opinion Cities, Towns and Types will all be page reference fields. Create a template for you shops and add those three fields with to it. Then you can try testing out some selectors to query the information you are wanting. :)

  4. I did not see this mentioned, but If you want to skip the first row of the csv which would be your headers you can simply add two simple lines.

    $row = 1;
    $fp = fopen("./skyscrapers.csv", "r");
    $template = wire('templates')->get("skyscraper");
    $parent = wire('pages')->get("/skyscrapers/");
    
    while(($data = fgetcsv($fp)) !== FALSE) {
          if($row == 1){ $row++; continue}
    • Like 1
  5. Are you working on a shared hosting environment? If so, you will need to log into your cpanel account and increase the space. If you are unable to increase your space, you should contact them. Simply deleting some files will not have immediate results as your host does not reflect those changes immediately. I am almost certain this is hosting issue and not a ProcessWire one.

  6. I think most are set to 755, but I do not see any reason why 777 should not work. It depends on your host setup. Also you may want to check your space limitations on your server. This sounds like an issue I had when I was uploading a large amount of photos. Come to find out, I was out of space and had to increase it. 

  7. I am embarrassed that I have to ask this question, but I cannot get my selector to work.  I want to output a list of players that are assigned to their specific team. Each Player has a team_name field which references their team as a page field select drop down. 

    $players = $pages->find("template=player, team_name=$page->id");
       foreach ($players as $player) {
        echo "<li><a href='{$player->url}'>{$player->title}</a></li>";
       }
    

    $page->id is referencing the team page. I have tried multiple variations using both find/get but I am missing something. Any kick in the head is appreciated. My structure is like so 

    Players

     -- Player 1

    Teams

    -- Team 1

  8. If a page contains an image, I get no error. If a page does not contain an image I get the following. Fatal error: Exception: Invalid type to Pageimages::remove(item) message. Any suggestions is appreciated.

    my code:

    $first = $page->image->first;
    
    if (count($page->image) > 1) {
       echo "<h4>$page->title</h4>";
      }
      foreach($page->image->remove($first) as $img) {
    
      if ($img) {
       echo "<img src='{$img->url}' />";
       }
      }
    
×
×
  • Create New...