• Content count

  • Joined

  • Last visited

Community Reputation

64 Excellent

About louisstephens

  • Rank
    Sr. Member

Recent Profile Visitors

1,728 profile views
  1. You could make use of the repeater field to achieve this. You simply create the repeater and assign it the fields in questions, and the customer could add them quite easily. https://processwire.com/api/fieldtypes/repeaters/ Example <?php foreach($page->articles as $article) { echo $article->some_field; } ?>
  2. Thanks abdus! I guess I was unclear of how to add to the find() in processwire. However, knowing this now, this really helps me condense a lot of my code that I have already written. My head was starting to spin trying to figure out ways (sometimes it was a roller coaster) to deal with my foreachs.
  3. Thank you everyone for all the help! Is something like this possible, or am I reaching ? (sorry, still trying to learn my way through php and some things are still a bit intimidating) $ads = wire('pages')->find("parent.template=manufacturer, $today < expiration_date && expiration_date-432000 > $today, sort=expiration_date");
  4. Ah, thanks @flydev for catching my typo. I guess because it is in a "foreach", it just keeps counting so I get "1 2 3..." . I guess I didnt know how to handle putting the if outside the foreach since I dont know how to access $ad->expiration_date. Is there a better way of doing this? Edit** : Just moved echoing the $alert outside the foreach which gave me the count. However, if anyone had a better solution I welcome it. I seem to be using 3 foreach loops with an if inside each one just to accomplish this (so I can wrap a div column around them.).
  5. So I have a bit of code for ad management : <?php $ads = $pages->find("parent.template=client, sort=expiration_date"); $alert_count = 0; foreach ($ads as $ad) { $todaysdate = date("F j, Y H:i"); $today = strtotime($todaysdate); $expireson = $ad->expiration_date; $expires = strtotime($expireson); $fiveaway = $expires - 432000; if ($today > $expires) { $alert = $alert_count=+1; echo $alert; } } //end FOREACH ?> It currently finds all the pages with a parent of "client" and then I can drill down to the pages that have "Expired" in my if statement. I wanted to get a "count" of the pages that met the if statement requirements so I could output that number in an alert at the top of the page. When it runs, it currently just prints out "1 1 1 1..." and not the total count of pages. Does anyone know of a way possibly achieving my desired output? I tried count(), but that did not quite produce my desired output. I should note that I have several other if statements dealing with the date/time for outputting other alerts as well (just didn't think they were needed for this case).
  6. Would something like this work: working on it.... However, using "template=settings" should work for you. Are you using Tracey debugger as well? I find a lot of times this helps me spot an issue with my loops etc. https://modules.processwire.com/modules/tracy-debugger/
  7. It was DaveP and the post was At first I couldn't "like" the post, and I received the message in regards to reputation. After a while, I was able to hit "like".
  8. I guess this is the right place to post this. Just this morning I went to like an answer someone had given, and was met with a popup stating: "Unable to give reputation to this user". Has anyone encountered this before, or is there some "cap" on users with a certain ratio (reputation to posts) that is keeping me from providing reputation. It was not a big deal, but I wanted to give credit to where credit was due.
  9. You could achieve this by using a repeater with the url field in it. https://processwire.com/api/fieldtypes/repeaters/ Once you have that set up you do something like: <?php foreach($page->url_repeater as $url) { echo "<a href=\"{$url->url_field}\">" . "{$url->url_field}" . "</a>"; } ?>
  10. From what I understand, files are saved in page-specific folder (which is why the folder name is the page id). With that, I dont think it is an easy tweak, but someone please correct me if I am wrong. I did find a similar thread here :
  11. Have you tried padloper for processwire? I have not used it yet, but it looks very promising, and would probably cut down on trying to make magento work with processwire. https://www.padloper.pw
  12. My apologies on that. I should have picked up on the function reference.
  13. Also there is this:
  14. Couldn't you do something like: <?php foreach ($page->date_repeater as $date) { #code... } ?> This also has some examples of repeaters being used:
  15. I dont know if this is exactly what you are after, but here is a discussion regarding SSL. I have not done it myself, but it appears you can uncomment something in your .htaccess file .