Jump to content

Brian Scramlin

Members
  • Content Count

    31
  • Joined

  • Last visited

Community Reputation

8 Neutral

About Brian Scramlin

  • Rank
    Jr. Member
  • Birthday 03/02/1987

Profile Information

  • Gender
    Male
  • Location
    Wabash, Indiana

Recent Profile Visitors

1,326 profile views
  1. I was mostly interested in the PHP variable insertion. That could make building ProcessWire templates pretty quick.
  2. Hello! I cannot find information on if/how I can change the login URL AFTER installation. I almost always change the default to /login/ and I went through the installation too fast and kept "processwire" Is there a way I can alter this behavior? Thank you!
  3. @wbmnfktr, Thank you for your reply and ideas. I have confirmed that in my config.php file my timezone settings are aligned with my local time. Is this the only place to check for timezone settings? How do I view mail settings?
  4. My confirmation emails are coming in around 12 hours after submission. Does anyone know what settings I can check on my server or the module?
  5. I have noticed that when using builtwith.com, ProcessWire does not show up in the stack. I wonder why that is? I don't know how many people utilize that site, but I often browse through it when I find an exceptional website or application, and I hate for people to miss the greatest CMS of all time!
  6. Thank you, everyone! These are helpful strategies and I will integrate them into my work. What a great community. Regarding the auto-pre/appending, this is documented on the PW (https://processwire.com/docs/tutorials/how-to-structure-your-template-files/) as Direct Output with Automatic Inclusions, but I know Delayed Output and Markup Regions are probably preferred and I will work on switching to those strategies.
  7. 1. Would the file be overwritten when upgrading PW? 2. BLAST! Thank you.
  8. I just wanted to share that I added an AJAX-powered gallery to an artist website that I developed and host: https://jackpinecreations.com/gallery/ There were two things that frustrated me about creating this. Perhaps you can show me a better way. 1. After creating my processing script, which I placed under /templates/scripts/get-items.php, I realized that I would get a 403, due to ProcessWire's routing and security. This forced me to have to create a template and page for this little script. This was frustrating simply because it seemed unnecessarily confusing. But worse, see #2. 2. I usually use config.php to prepend and append each of my templates with a head.inc and foot.inc, which keeps my templates easy to use and I don't have to go and use the GUI to do so on each template separately. However, since I realized I needed to create a new template and page so as to access it, whenever I sent POST params to it, I would get the header and footer along with it!!! I could find no workarounds and had to remove the pre/append calls in config.php and use the GUI on each template individually. Code Below if you're interested: HTML and JavaScript (forgive my sad JavaScript skills, I know this can be tightened up) <!-- Begin Grid --> <div class="container mt-4"> <div id="gallery" class="row"> <?php foreach ($page->children("limit=9") as $child): ?> <div class="col-6 col-md-4 gallery-item"> <a href="<?= $child->url ?>" title="View <?= $child->title ?>"> <img class="gallery-item" src="<?= $child->item_featured_image->size(640, 640)->url ?>" alt="<?= $child->title ?> Image"> </a> </div> <?php endforeach; ?> </div> </div> <!-- End Grid --> <div class="center-block text-center"> <button id="get-more-items" type="button" name="get-more-items" class="btn-vintage">Load More</button> </div> <script type="text/javascript"> var buttonGetItems = document.getElementById("get-more-items"); var indexStart = 0; buttonGetItems.addEventListener("click", function() { indexStart += 9; $.ajax({ url: '<?= $pages->get(1186)->url ?>', type: "POST", dataType:'json', // add json datatype to get json data: ({page_id: <?= $page->id ?>, index_start: indexStart}), success: function(data){ console.log(data); if (data[1]) { //for each element, append it. $.each(data, function(key, value) { $("#gallery").append(value); }); } else { $("#get-more-items").after('<p class="center-block text-center">There are no more items to load.</p>'); $("#get-more-items").remove(); } } }); }); </script> Processing Script <?php $items_array = []; $i = 0; foreach ($pages->get($input->post->page_id)->children->slice($input->post->index_start, 9) as $child) { $i++; $items_array[$i] = "<div class='col-6 col-md-4 gallery-item'> <a href='$child->url' title='View $child->title'> <img src='{$child->item_featured_image->size(640,640)->url}' alt='$child->title Image'> </a> </div>"; } echo json_encode($items_array); I love ProcessWire for hundreds of reasons, but I've been using AJAX more and more, and I'm not liking having to create templates to access scripts. Any advice?
  9. I am reading up on these links now. Thank you @bernhard!
  10. I am getting an error on line 21 for PW version 3.0.89 upon install. Something about the method needing the abstract keyword.
  11. Hello, I am newer to web development, but have fallen in love with Processwire over the past few years. I love the simplicity and flexibility of the entire platform. One area, however, continues to elude me: Modules. Desiring to respect the community, I have done my due diligence in reading other posts, the documentation, and learning more about PHP OOP so I better understand the syntax and patterns of Modules. But, I am still confused and was hoping some interaction would help me. For my first module, I am desiring to create a new Fieldtype which allows a user to Visually select an icon from the Font Awesome library (something like this https://codepen.io/scramlo/full/XGaOgv) Render markup. I have written the necessary parts of the module: <?php namespace ProcessWire; class FieldtypeIconPicker extends FieldType implements Module { public static function getModuleInfo() { return [ "title" => "Icon Picker", "summary" => "The Icon Picker module allows you to preview and render icons from the Font Awesome icon library.", "version" => 1, "autoload" => true ]; } public function ready() { if ($this->page->template == "admin") { } } } I have been looking at the FieltypeSelect and FieldtypeColorPicker modules as I thought I could learn from them. I see they both start by creating this function and returning the value. public function getInputfield(Page $page, Field $field) { $inputField = $this->modules->get('InputfieldColorPicker'); //lots of magic here return $inputField; } Where does this function get called? Please forgive me for my lack of understanding. Here are my confusions: I need to create a button that links to my module's JavaScript file. In my JavaScript file I can create a popup with all of the icons. When a user clicks on an icon, I need to set a value somehow in the database. I can use a hidden field if needed, I would suppose. I need to be able to render the output. I am guessing that in my module, something like the following is what I need: $iconMarkup = "<i class="fa " . $this->icon_class . "></i>"; Perhaps that is the return value of the getInputField function? Thank you for your patience and help. Please feel free to let me know if there is documentation I should have read, but missed. I want to work hard to fully grasp module development in ProcessWire.
  12. I am reading through replies, but wanted everyone to know as of one hour ago, I was able to reload backup from a couple of days ago. Thankfully my server configuration was set up to do this automatically. I'm new to this journey, and I will always be more careful. In fact, I am finally convinced I should have the following workflow: virtualized local configuration matching server config > commit to git local > push git to cloud > upload changes to live site.
  13. Macrura,

    I have a client who has grown beyond my ability to assist them. Are you available for a project quote? I can give you all the details. I came across you when I read about your experience with integrating foxycart with pw. 

×
×
  • Create New...