Jump to content

mowerol

Members
  • Content Count

    3
  • Joined

  • Last visited

Community Reputation

1 Neutral

About mowerol

  • Rank
    Newbie
  1. Thanks for the really detailed response @horst. I'll definitely try out all of these options as I continue to work with PW and get stronger at it. The first approach you've suggested is a cool solution!
  2. Thanks, but I've used short syntax throughout my file and have had no problems except with this one. When I make it <?php for some reason I now get this error: There isn't any code on line 89 so it's referring to the end of my doc. Would this mean something else is wrong? //Edit - Cheers again horst. I just changed the endforeach to use <?php too and that's resolved the problem!
  3. Hi everyone, I'm new to processwire and have just started playing around with it for the past week. At the moment, I'm trying to use repeater fields and am having difficulty getting them to output to my page. Instead, what bizarrely seems to be happening is that half of the foreach loop declaration seems to be appearing as plain text on my page and is commented out when I check inspect element. I'm not sure if my syntax is wrong or this is an entirely different problem. Any help would be hugely appreciated! Here's my code: <?php $portfolio=$pages->get("name=portfolio");?> <? foreach ($portfolio->portfoliopreviews as $portfoliopreview): ?> <a href="#"> <div class="port"> <img class="pic" src="<?=$portfoliopreview->portimg->url;?>"/> <div class="portbgrdtext"> <h5><?=$portfoliopreview->portgenre;?></h5> <p><?=$portfoliopreview->porttext;?></p> <button class="portbtn">Read More</button> </div> </div> </a> <? endforeach; ?> And in the attached images you can see what's happening on the page and within inspect element. You can see that the div is being created, albeit without any fields populating inside of it. You can also see that loop is being commented out within inspect element. Cheers!
×
×
  • Create New...