Jump to content


  • Posts

  • Joined

  • Last visited

Posts posted by gregory

  1. On 3/27/2018 at 1:11 AM, mtn said:

    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!


    The error is triggered when we leave empty the configuration field "Notifications From Email". 

  2. Hi guys,

    in my _head.php template when I add the PHP code to display the menu I get an error. 

    #0 wire/core/TemplateFile.php (304): require()
    #1 wire/core/Wire.php (394): TemplateFile->___render()
    #2 wire/core/WireHooks.php (823): Wire->_callMethod('___render', Array)
    #3 wire/core/Wire.php (465): WireHooks->runHooks(Object(TemplateFile), 'render', Array)
    #4 wire/modules/PageRender.module (536): Wire->__call('render', Array)
    #5 wire/core/Wire.php (397): PageRender->___renderPage(Object(HookEvent))
    #6 wire/core/WireHooks.php (823): Wire->_callMethod('___renderPage', Array)
    #7 wire/core/Wire.php (465): WireHooks->runHooks(Object(P (line 7 of site/templates/_head.php) 
    This error message was shown because: site is in debug mode. ($config->debug = true; => site/config.php). Error has been logged.

    This is the code for render menu: 

    foreach($home->and($home->children) as $item) {
    	$class = $item->id == $page->rootParent->id ? 'uk-active' : '';
    	echo "<li class='$class'><a href='$item->url'>$item->title</a></li>";

    How can I solve? Thanks

  3. To build my templates I usually use "Direct Output". I ask you if it is possible to avoid reloading the menu included in _head.php when browsing the website. For example, I noticed that using "Delayed output" the menu does not reload (optically) and appears to remain fixed. 

    How can I do the same thing through "Direct Output"?

    Thank You

  4. 1 hour ago, kongondo said:

    I see. However, I still don't get where the icons are coming from. For instance, where have you stored your wifi icon? Where is the icon for Piscina? Etc..Unless it is a new feature I am not aware of, FieldtypeOptions doesn't store icons.

    Unfortunately the icons are not stored anywhere.
    I'll see what I can do with PageReference... 😉

  5. Hi Guys,

    is it possible to retrieve the icon of a field set in FieldtypeOptions? Eg, setting a "WiFi" icon to a "WiFi" field (checkbox) in the admin, and then show this icon + name on frontend?

    // Output multiple selection:
    foreach($servizi as $item) {
      echo '<ul class="uk-list">';
        echo '<li>' . $item->title . '</li>';
      echo '</ul>';

    Thank You in advance.

  6. 31 minutes ago, kongondo said:

    Do you mean how you can build the selector for the options field?

    I think I have solved it this way thanks to your suggestion.

    if($input->get('tipologia')) {
    	$value = $sanitizer->selectorValue($input->get('tipologia'));
    	$selector .= "tipologia={$value}, ";
    	$summary["tipologia"] = $sanitizer->entities($value);
    	$input->whitelist('tipologia', $value);


  7. Hi guys.
    In Skyscrapers search-form.php, I have added a select to filter the contents based on an Option (type) field.

    				<div class='uk-form-row'>
    					<label class='uk-form-label' for='search_tipologia'>Tipologia</label>
    					<div class='uk-form-controls'>
    						<select id="search-tipologia" name="tipologia" class="uk-select">
    							<option value="">Qualsiasi</option>
    									foreach(array('Bed and Breakfast', 'Agriturismo', 'Masseria', 'Hotel') as $range) {
    										$selected = $range == $input->tipologia ? " selected='selected'" : '';
    										echo "<option$selected value='$range'>$range</option>";

    In the search.php template how can I retrieve the contents?

    $selector = '';
    // we use this to store the info that generates the summary of what was searched for
    // the summary will appear above the search results
    $summary = array(
    	"city" => "",
    	"height" => "",
    	"floors" => "",
    	"year" => "",
    	"keywords" => "",
    	"tipologia" => "",
    // if a city is specified, then we limit the results to having that city as their parent
    if($input->get('city')) {
    	$cityName = $sanitizer->pageName($input->get('city'));
    	$city = pages("/cities/$cityName/");
    	if($city->id) {
    		$selector .= "parent=$city, ";
    		$summary['city'] = $city->title;
    		$input->whitelist('city', $city->name);
    // if a tipologia is specified how to show the content?
    if($input->get('tipologia')) {
    // we are allowing these GET vars in the format of 999, 999-9999, or 999+
    // so we're using this loop to parse them into a selector
    foreach(array('height', 'floors', 'year') as $key) {

    Thank You in advance.

  8. Hi guys.
    I would like to show only the first image as a preview of a slideshow. The code below shows the first image but is repeated. Do you know a solution? Thank you

    //Call image
    foreach($story->galleria as $img) {
      echo "<img src='{$story->galleria->first()->url}' alt='{$story->galleria->first()->description}'>";


  9. Hi guys, I need help.
    how do I translate Next Page?

    	if($page->next->id) {echo "<div class='float-right'><a class='button' href='{$page->next->url}'> Next Page </a></div>";}

    I usually use this:

    <?php $lang = $user->language->name; if($lang == 'default') {echo "Next Page";} else {echo "Pagina successiva";} ?>


    <?php echo __("Next Page"); ?>


  • Create New...