Jump to content


  • Content Count

  • Joined

  • Last visited

Everything posted by louisstephens

  1. There is this method $input->PageNum https://cheatsheet.processwire.com/input/properties-and-methods/input-pagenum/ https://processwire.com/api/ref/wire-input/page-num/
  2. Are you receiving any errors at mydomain.com/pwone etc etc ? What issues are you exactly running into? A bit more information would be helpful.
  3. From what I have researched (not an expert by any means), Outlook itself does not limit the # of recipients itself. However, you could do a mailmerge with outlook which might work for you: https://www.howto-outlook.com/howto/mailmerge.htm
  4. In you home template, you could do something like: <?php $newsArticles = $pages->find('template=your_news_templates'); foreach ($newsArticles as $newsArticle) { echo "<a href=\"" . $newsArticle->url . "\">" . $newsArticle->title . "</a>"; } ?> This would output each article's title (as well as a url to the article). Obviously you can change the markup to whatever you would need.
  5. Just curious, could you post your code where you are redirecting based on the session? It might help with answers to see the whole picture.
  6. I was really unsure of how to actually title this post, so I do apologize (if someone has a better idea, I will gladly edit it). I am using the profields: pagetable field to allow people to create their own "content" (copy, image, button, etc etc) and rearrange it. I also included a field called "column_size" using the RangeSlider set to (1-12). I guess I'll clarify a bit more on this. I am using flexbox where the "row" is <section></section> and the columns are <div class="column"></div> have given the "columns" flex: 1 1 0; so no matter how many columns you have, the columns will automatically adjust for new content. Where my confusion is coming in: If a user has set up 3 copy items (with 12, 5, 7 respectfully for the column_size), how do I actually output this in my template? I was going to use a switch statement to handle the various items which I thought made it quite easy, but with closing sections and columns I have confused myself as I assume I need an if statement to check if the column size is > 12, or = 12 to determine the actual closing/opening of sections. I apologize if I have not made this very clear. I am a bit unsure how to word this let alone to go about this. Im very appreciative of for any insight into this.
  7. Thanks zeka, I appreciate the help! I tried your suggestion really quickly this morning and the results are still pretty similar to what I was doing previously: [{"id":1644,"title":"ABC"},{"id":1648,"title":"DEF"},{"id":1652,"title":"GHI"},{"id":1686,"title":"JKL"}] However, I did end up "figuring it out" just now by changing my json_encode to echo json_encode(array("clients" => $clientArray)); (Changed $clients_array to $clientsArray to avoid confusion with my field naming scheme.)
  8. A question regarding the formatting here. I know in the example you are assigning the id's from what is typed in the foreach, however, how would you go about doing this programmatically as I am trying to get all the fields from each page? Sorry for my confusion here, just a lot to wrap my head around.
  9. I believe you are right. I was looking at a file and completely missed that the output was supposed to look like the following: { "clients": [ { "id":1644, "code":"abc", "name":"Test Name", "associated_users":null, "url":"\/pw\/clients\/abc\/" }, { "id": 1645, "code": "xyz", "name": "Test Name", "associated_users": null, "url": "\/pw\/clients\/xyz\/" }, ] }
  10. So I have been hard at work creating url segments for a template (api) and everything is working swimmingly in creating a simple end point for svelte.js. I have however, run into a few questions that I can wrap my head around. In my api template I have: if($input->urlSegment1 === 'clients') { header('Content-Type: application/json'); $clients = $pages->find("template=clients"); $client_array = array(); foreach ($clients as $client) { $id = $client->id; $title = $client->title; $url = $client->url; $clientName = $client->client_name; $clientColor = $client->client_color->value; $assigned = $client->assigned_to->user_full_name; $client_array[] = array( 'id' => $id, 'code' => $title, 'name' => $clientName, 'associated_users' => $assigned, 'url' => $url ); } $client_json = json_encode($client_array, true); echo $client_json; } The output json from this is: [ { "id":1644, "code":"abc", "name":"Test Name", "associated_users":null, "url":"\/pw\/clients\/abc\/" }, { "id": 1645, "code": "xyz", "name": "Test Name", "associated_users": null, "url": "\/pw\/clients\/xyz\/" }, ] I was curious is it possible to add in "clients" before this output json so it would appear as clients: [ { "id":1644, "code":"abc", "name":"Test Name", "associated_users":null, "url":"\/pw\/clients\/abc\/" }, { "id": 1645, "code": "xyz", "name": "Test Name", "associated_users": null, "url": "\/pw\/clients\/xyz\/" }, ] I was not really sure of how to tackle this in my php code, and have spent more time than I care to admit trying to figure it out. Another question I have is that "associated_users" is returning null, which in this instance is correct. It is a multi page field that is set to pull a custom name field from the users template, ie "Louis Stephens" would be associated with the first page. I understand that I need to use a foreach to get the correct data, but I was really unsure of how to place this inside an array, or update the array with the new data. Any help with any of this would greatly be appreciated.
  11. The easiest way I have done this is to paste the following in the home.php file (this can be found under site->templates). Once you have saved your change to the home template, visit your site's home page. Once you have visited the page after updating the template, you can remove the code from the template. $admin = $users->get('admin'); // or whatever your username is $admin->setAndSave('pass', 'yo123456'); //change the password to whatever you want it to be
  12. Are you using any modules to "protect" pages or anything of that nature?
  13. This.. I run into little things like this all the time. It is one reason I moved away from outputting html in code/text blocks (unless it it really small), and moved to the php alternant syntax: <?php foreach ($services as $service) : ?> <div class="service"> <h1>Sample Text</h1> <p><a href="<?php echo $service->url; ?>"><?php echo $service->title; ?></a></p> </div> <?php endforeach; ?> At least to me, it is much easier to find an issue since Visual Studio Code doesn't highlight the different syntax in code/text blocks (unless there is a way and I cant find it). I might start integrating twig into my templates as well. I do like the syntax, but I have not really tried it out much.
  14. It might help out to see the actual php markup being used in your template to better help with your issue.
  15. You could just rename this to "Inactive" (downloaded and not installed) and "Active" (downloaded and installed).
  16. You are correct sir. Thanks for pointing that out!
  17. Is there something wrong with the site? The url does not seem to work for me.
  18. I just looked into Prepros and it looks awesome! I must say, I have been using gulp now for awhile and have never had an issue with browser-sync. However, I do find documentation/examples at time to be a bit overwhelming (especially when adding new plugins into your workflow). I guess I got into it at the end of version 3, and the syntax changed in version 4 which really gave me a headache.
  19. I have been curious about this as well. I am currently working on a project which unfortunately has grown to over 50+ fields (at the moment). I always see people writing about re-using fields as much as possible, but for the life of me I just get confused. I guess I just get hung up, ex: fields for modal settings (header_color, width, iframe_src) and then having a different template that also has the same fields (but in a different context). I end up duplicating fields (which I know is terrible) and then going down a bad rabbit hole.
  20. I am not sure how I feel about this... It reminds me of lings cars, but not so flashy/bad (apologies if you had a hand in this, not trying to offend anyone). However, It is awesome to see that it is responsive.
  21. Hey Maxx, it seems that some users have achieved a multi language site (enabling multi language module) with multiple domains. There is a thread that might shed some light for you.
  22. Just double checking, you added your host(s) to the following array: $config->httpHosts = array('123.456.78.9:8888', '123.456.78.9');
  23. @wbmnfktr, that is what people are "claiming". If I had a surface/pencil combo, I would definitely use it. I have found though that just being able to use "cmd + tab" to quickly go to my not app without lifting off the keyboard is really useful for me. A lot of times I do just keep an empty txt doc open in text edit and "word vomit" into just for quick ideas/thoughts, and then just add them into notion later at the end of the day.
  24. I have enjoyed Notion over the last few weeks. However, I do use ClickUp for project management etc, and it has a built in note feature which I use more often (simply because you can convert a note to a task).
  25. @Mithlesh, After looking at your template code, I do see the following (lines 18-29) <section class="map-image"> <div class="container"> <div class="row"> <div class="col-md-12 col-sm-12 col-xs-12"> <div> <img src="<?php echo adapt($page->header_image->last()); ?>"> </div> </div> </div> <!-- Tab Address --> </div> </section> All of this is coming in after the $form rendering on line 13. If you were to remove the section I posted above, the header image would not display.
  • Create New...