Jump to content

mtn

Members
  • Posts

    8
  • Joined

  • Last visited

Everything posted by mtn

  1. The "Comments" core module has been activated locally with its four associated parts, including an Akismet API key, and has been rendered as per instruction via http://processwire.com/api/fieldtypes/comments/. Testing the comment form continues to render errors after this manner in the 3.0.96 version. Error: Exception: Invalid email address (processwire@localhost:8888) (in ... /wire/core/WireMail.php line 130) After an exhaustive attempt on my part to overcome this error (with limited knowledge), I considered that maybe a corrupt file might be the cause. However, after updating from 3.0.62 to 3.0.96, the same error persists. Below is the particular section/line of code mentioned. /** * Sanitize an email address or throw WireException if invalid * * @param string $email * @return string * @throws WireException * */ protected function sanitizeEmail($email) { $email = strtolower(trim($email)); $clean = $this->wire('sanitizer')->email($email); if($email != $clean) { $clean = $this->wire('sanitizer')->entities($email); throw new WireException("Invalid email address ($clean)"); //<--- this is the line } return $clean; } Inasmuch as this is the final element that needs to be addressed for this particular site, your assistance in helping me understand the issue and the remedy regarding this matter would be greatly appreciated. Good day!
  2. Is it possible to create a custom spam message? Along the lines of: $modules->get('SimpleContactForm')->render(array( 'spamMessage' => 'Custom Spam Message' ));
  3. While testing the recently installed Comments module, the following error is occurring (while using valid email addresses): Error: Exception: Invalid email address (processwire@localhost:8888) (in . . . /wire/core/WireMail.php line 105) Error: Exception: Invalid email address (processwire@localhost:8888) (in /Users/main/Sites/artisan-skill-revival/wire/core/WireMail.php line 105) #0 /Users/main/Sites/artisan-skill-revival/wire/core/WireMail.php(130): ProcessWire\WireMail->sanitizeEmail('processwire@loc...') #1 /Users/main/Sites/artisan-skill-revival/wire/core/WireMail.php(245): ProcessWire\WireMail->extractEmailAndName('processwire@loc...') #2 /Users/main/Sites/artisan-skill-revival/wire/modules/Fieldtype/FieldtypeComments/CommentNotifications.php(151): ProcessWire\WireMail->from('processwire@loc...') #3 /Users/main/Sites/artisan-skill-revival/wire/core/Wire.php(383): ProcessWire\CommentNotifications->___sendAdminNotificationEmail(Object(ProcessWire\Comment)) #4 /Users/main/Sites/artisan-skill-revival/wire/core/WireHooks.php(698): ProcessWire\Wire->_callMethod('___sendAdminNot...', Array) #5 /Users/main/Sites/artisan-skill-revival/wire/core/Wire.php(442): ProcessWire\WireHooks->runHooks(Object(ProcessWire\CommentNotifications), 'sendAdminNotifi... How may this issue be overcome? Thanks!
  4. Thank you kongondo & Robin S! Use of your suggestions led to the following successful code (in case it may be helpful to others): $entries = $page->children("sort=$subcats, sort=page_headline"); $subtitle = ''; foreach($entries as $entry) { if($entry->$subcats->title !== $subtitle) { $subtitle = $entry->$subcats->title; echo "<h3>$subtitle</h3>" } echo "<div class='listing'>"; echo "<img src='{$entry->page_main_image->url}' alt='{$entry->page_main_image->description}'>"; echo "<h2>$entry->page_headline</h2>"; echo "<p>$entry->page_summary <a href='$entry->url'>Read on</a></p>"; echo "</div>"; }
  5. Layout: Pages are created as children of Categories. On the Pages template there is a "Select Option" field to select the particular subheading under which the page is to be displayed. Objective: The Category page is to be an index of child pages listed under various subheadings (as created by the Select Option field). Question: What is the syntax to reference that select option field of the child page template in order to display those subheadings and their respective child pages? Presently, I have a $subcats variable containing the name of the appropriate select option field for the Category and the following code which simply displays the sorted child pages (sans subheadings): $entries = $page->children("sort=$subcats, sort=page_headline"); foreach($entries as $entry) { echo "<div class='listing'>"; echo "<img src='{$entry->page_main_image->url}' alt='{$entry->page_main_image->description}'>"; echo "<h2>$entry->page_headline</h2>"; echo "<p>$entry->page_summary <a href='$entry->url'>Read on</a></p>"; echo "</div>"; }
  6. Is the module compatible with PW v. 3.0?
  7. On a "site-settings" page, I have a "watches" image field that contains 5 images. The first and last are easily echo-ed with"$a->first();" and "$a->last();", but I am having difficulty in creating the correct syntax to display images 2-4. Any help would be appreciated. Thank you! Present code: <?php $selectWatch = $pages->get("/site-settings/")->watches; $watchOne = $selectWatch->first(); echo "<img src='{$watchOne->url}' alt='{$watchOne->description}' class='time'>"; ?>
  8. I'm new to PW -- downloaded and went through tutorials -- and need advice in best approach to template creation. I want to get started on the right track. The website will consist of approx. 300 how-to articles, a list of which (with thumbnail image) is to be displayed on category pages (main menu - 6 categories) under various subtitles (not part of menu). CATEGORY1 -- Subtitle1: ---- Article1 ---- Article2 -- Subtitle2: ---- Article3 ---- Article4 -- Subtitle3: ---- Article5 ---- Article6 CATEGORY2 . . . About 10% of the articles need to be listed under multiple categories. In creating Article template & template files for delayed output pages, what would it be the optimal way to organize template and template files? (A. having two separate template/template files for single and multiple category articles -- simply placing the single-category articles in their respective admin hierarchical page tree and doing what with multiple-category pages?, or B. -- having a single template for all pages that would have 3 category fields (and their respective subtitle dropdown selection fields), using only the first category field for single-category pages?, or C. something else.) What would the resulting admin hierarchical page tree be? What modules would be helpful in creating this site? Thank you!
×
×
  • Create New...