Jump to content

Maverick

Members
  • Posts

    30
  • Joined

  • Last visited

Posts posted by Maverick

  1. On 3/29/2020 at 2:18 PM, Maverick said:

    Hi guys, 

    Does anyone know how to add sorting tot the child selects? The first select can get sorting in the dynamic selects settings, for example sort=name and it works nice, but for some reason it doesn't work for the second and third selects.

    I have tried to manually drag and drop the items in the admin for the alphabetical order, I also tried to set all parents sort settings to sort=name but that doesn't move it either. In your example @kongondo you also see this behaviour (frontend dynamic selects example)

    Let's say I have Continent, Country, City selects. Under my country select I have USA, Mexico, Argentina. The country pages were added in this order, so 1 USA, 2 Mexico and 3 Argentina. Argentina is always as the last item in the dropdown select (on frontend). If I add Zimbabwe under Country parent, the Zimbabwe will be last in the dropdown select. So it seems that the child drop down selects are always being sorted by creation date? Can this be setup to work in alphabetical order?

    Hi guys, 

    Does anyone know if the latest version of Dynamic Selects has the possibility to sort the child selects on frontend? So you can sort the items based on name? 

  2. Hi guys, 

    Does anyone know how to add sorting tot the child selects? The first select can get sorting in the dynamic selects settings, for example sort=name and it works nice, but for some reason it doesn't work for the second and third selects.

    I have tried to manually drag and drop the items in the admin for the alphabetical order, I also tried to set all parents sort settings to sort=name but that doesn't move it either. In your example @kongondo you also see this behaviour (frontend dynamic selects example)

    Let's say I have Continent, Country, City selects. Under my country select I have USA, Mexico, Argentina. The country pages were added in this order, so 1 USA, 2 Mexico and 3 Argentina. Argentina is always as the last item in the dropdown select (on frontend). If I add Zimbabwe under Country parent, the Zimbabwe will be last in the dropdown select. So it seems that the child drop down selects are always being sorted by creation date? Can this be setup to work in alphabetical order?

  3. Can you help me out understanding the working of the extensions: 

    If I have a template basic_page_with_contact_form

    and in this template, I have a field personInCharge (type e-mail)

    Now I make few page's using the basic_page_with_contact_form template, for example page1 with e-mail test1@website.io and page2 with e-mail test2@website.io

    and I put different e-mail addresses in the field personInCharge

    Now I build a form with few fields for example name, age, town 

    In the settings (Actions) of the form I check Send e-mail to administrators and I fill it with:

    !personInCharge?email

    Then I embed the form in the basic_page_with_contact_form template

    Now if I go to page1 and fill in the form with name, age, town fields would the submit form be sent to test1@website.io ?

     

    I tried to set it up the following way (the result is that the e-mail submission is not sent), smpt settings are ok, this is on PW version 3.

     

     

     

  4. Hi guys, 

    Do you have the map marker module working in version 2.8 or version 3? In processwire admin, I can see the map, but then when I go to the page where the map should be showing, I'm getting an error: " MarkupGoogleMap Error: Please add the maps.google.com script in your document head. The map is not showing on the page. " 

    I have fresh processwire installation

    it seems that the module injects the google maps script before html tag, it seems to be causing the problem... I'm not sure how to solve this

     

    <script type='text/javascript' src='/site/modules/FieldtypeMapMarker/MarkupGoogleMap.js'></script><div id='mgmap1' class='MarkupGoogleMap' style='width: 100%; height: 300px;'></div><script type='text/javascript'>if(typeof google === 'undefined' || typeof google.maps === 'undefined') { alert('MarkupGoogleMap Error: Please add the maps.google.com script in your document head.'); } else { var mgmap1 = new MarkupGoogleMap(); mgmap1.setOption('zoom', 12); mgmap1.setOption('mapTypeId', google.maps.MapTypeId.HYBRID); mgmap1.init('mgmap1', 40.712776, -74.005974); mgmap1.addMarker(40.712776, -74.005974, '/en/about/', 'About', ''); }</script><!DOCTYPE html>
    <html lang="en">
    <head>

    when I paste the code inside <head> manually, then I can see the map on the page where it should be visible. 

     

    Any suggestions?

  5. Hi there,

    I was just testing the module out, very cool. I wonder, Is there any way to redirect the latest selection to it's page (on frontend using MarkupDynamicSelects)? For example you select continent, then country, then city and you click on "Go" button which redirects you to the city page you have selected. 

  6. Hi there,

    I'm looking for someone who could modify my current dropdown chain selection based on pages (parent (countries) -> child (country provinces) -> sub child (cities) ) or propose different approach.

    What I'm trying to do is display pages with cities description (including picture) based on selection country -> province -> cities

    About 50 countries, per country about 10/20 provinces and per province about 10/30 cities

    The only requirement for this is that it won't slow down the site. At the current moment the pages are loding quite long. If you are interested I'll send you the dev url

  7. Hi there guys, 

    I wonder if anyone had ever an issue like this with installation

    I was about to check something out quickly so I've set up a digitalocean with ubuntu 16 droplet and then connected it to servepilot where I made a database. 

    So far so good but when I try to install processwire I get this

    Test Database and Save Configuration

    •  Database connection successful to pw2
    •  Saved configuration to ./site/config.php
    •  SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default value for 'created'
    •  SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default value for 'created'
    •  SQLSTATE[42S02]: Base table or view not found: 1146 Table 'pw2.modules' doesn't exist
    •  SQLSTATE[42S02]: Base table or view not found: 1146 Table 'pw2.modules' doesn't exist
    •  SQLSTATE[42S02]: Base table or view not found: 1146 Table 'pw2.modules' doesn't exist
    •  SQLSTATE[42S02]: Base table or view not found: 1146 Table 'pw2.modules' doesn't exist
  8. Thanks for the suggestion

    Would this be something like this, just read about the markupcache in another thread:

    $cache = $modules->get("MarkupCache"); 
    
    if(!$data = $cache->get("france_options")) { foreach($pages->find("parent=/continent/europe/france/") as $france) { $data .= "<option value='{$france->url}' class='france'>{$france->title}</option>";} $cache->save($data);} echo $data;
    if(!$data = $cache->get("usa_options")) { foreach($pages->find("parent=/continent/north-america/usa/") as $usa) { $data .= "<option value='{$usa->url}' class='1usa'>{$usa->title}</option>";} $cache->save($data);} echo $data;

    and so on for every country...

    Yesterday I was trying to run this chained selection with 193 countries holding about 300 cities (without markupcache), the page was loading 7/8 seconds :)

    So far, I realize my approach is very much inefficient (php/processwire newbie)

    The last selection seem to be the biggest "bottleneck" since I echo all possible country options (cities) at once, so that explains the high load time I believe

    Not sure how it's possible to render the right cities at the right time (only the cities that are child of a specific parent who has been selected in the second selection step).

     

     

  9. Hi guys,

    I am trying to make a dependent selection for list of cities (dependent on country and continent. So first you select the continent, then country and the city which redirects you to the city page

    What I have in my processwire

    Mainsitename

    -------Continent

    ------------Europe

    ------------------France

    -------------------------Paris

    -------------------------Marseille

    ------------North America

    ------------------USA

    -------------------------New York

    -------------------------Boston

    ------------Asia

    ------------------Thailand

    -------------------------Bangkok

    -------------------------Hat Yai

     

    I used so far this ajax plugin to make it all "chained"

    http://www.appelsiini.net/projects/chained

    In the template where I have the selection menu this is the code I'm using:

    <div class="form-group" >
    
    <select class="form-control" id="continent" name="continent">
      <option value="">Continent</option>
     <option value="Europe">Europe</option>
    <option value="North America">North America</option>
    <option value="Asia">Asia</option>
    
    </select>
    <select class="form-control" id="country" name="country">
      <option value="">Country</option>
    <option value="France" class="Europe">France</option>
    <option value="USA" class="North America">USA</option>
    <option value="Thailand" class="Asia">Thailand</option>
    </select>
    <select class="form-control" id="city">
      <option value="">City</option>
     <?php 
     
    $root = $pages->get("/continent/europe/france/"); $children = $root->children(); foreach($children as $child) { echo "<option value='{$child->url}' class='france'>{$child->title}</option value>"; }; 
    $root = $pages->get("/continent/europe/usa/"); $children = $root->children(); foreach($children as $child) { echo "<option value='{$child->url}' class='usa'>{$child->title}</option value>"; };
    $root = $pages->get("/continent/europe/thailand/"); $children = $root->children(); foreach($children as $child) { echo "<option value='{$child->url}' class='thailand'>{$child->title}</option value>"; };
    
    ?>
    </select>
    </div>

    And it works all right, I can select the continent, then a country and then one of the available city of this country and it redirects me to the city page for example /continent/france/paris

    However, my concern is that if the lists gets bigger, this approach will make the site slow (not sure though), my question is, what would be a better approach to achieve this? or should this be ok?

     

  10. The lightbox effect which I use, is purely css, didn't want to use any javascript for this, but I guess this is the problem then? or can I still get it to work somehow?

    .lightbox {
    	position: fixed;
    	z-index: 999;
    	width: 100%;
    	height: 100%;
    	text-align: center;
    	top: 0;
    	left: 0;
    	background: rgba(0,0,0,0.6);
            display: none;
    }
    
    .lightbox img {
    
    	margin-top: 5%;
    }
    
    .lightbox:target {
    	outline: none;
    	display: block;
    }
    
  11. Hi there guys,

    I'm trying to make a little gallery using simplel css lightbox effect. I'm able to display a single image, but I can't figure out how to make a gallery out of it.

    What I've already done to get the single image working:

    Created a filed image_single and added it to the template, uploaded an image in the field

    and then in my tamplate it looks like this:

    <div class="col-md-4">
    <a href="#image_single">
    <img src="<?=$page->image_single->url ?>"  class="img-responsive center-block">
    </a>
    
    <!-- this is the lightbox part, hidden with css -->
    <a href="#image" class="lightbox" id="image_single">
    <img src="<?=$page->image_single->url ?>" class="img-responsive center-block">
    </a>
    </div>
    

    I'm using bootstrap as my css framework

    For the gallery I have tried creating Image_gallery field and adding it to the template and then in the template file I've tried this:

    <div class="col-md-4">
    <div class="row">
      <?php foreach($page->Image_gallery as $image) { ?>
    <div class="col-md-6">
    
      <a href="#image_gallery">
      <img src="<?=$image->url ?>"  class="img-responsive center-block">
    </a>
    <!-- this is the lightbox -->
    <a href="#gallery" class="lightbox" id="image_gallery">
      <img src="<?=$image->url ?>"  class="img-responsive center-block">
    </a>
    </div>
    
    <?php } ?>
    </div>
    </div>
    

    The result I'm getting is that I'm seeing all the pictures from Image_gallery field which is good, but it doesn't matter which image I click on, only the first image from the Image_gallery field shows up in the lightbox

  12. Hi there

    Thanks LostKobrakai

    how should $nav_2 be defined then?

    I might have described what I would like to achieve not corrently the first time btw ...

    I'm looking for a way to have all url like this: example.com/page1 example.com/page2 etc and still group page1 and page2 into About container in the navbar on the front-end (in a dropdown menu).

    In the current situation the urls are like this: example.com/about/page1

  13. Hey there guys,

    Current situation:

    The page structure looks like this:

    Home

    ->About

    ->->Page 1

    ->->Page 2

    ->Test

    This structure comes back in the navbar menu. I'm using bootstrap as css/js framework.

    "About" is the visible container for the dropdown menu of Page 1 and Page 2. I click on About and then I see Page 1 and Page 2 which is great.

    What I would like to have is this:

    Home

    ->About

    ->Page 1

    ->Page 2

    ->Test

    and still have "About" as the visible container for Page 1 and Page 2 in the navbar so it acts like it's parent (without being an actual parent).

    Is there any way in processwire to have such parent page without an actual page?

    To get the bootstrap navbar working with the processwire page structure I was following this tutorial http://wiki.processwire.com/index.php/Bootstrap_Navbar

  14. The reason why I would like to change it is learning something and also since I use pw I thought it would be more "secure" to have it integrated inside of pw. The script looks like this:

        $name = strip_tags(trim($_POST["name"]));
        $email = strip_tags(trim($_POST["email"]));
        $subject = strip_tags(trim($_POST["subject"]));
        $message = strip_tags(trim($_POST["message"]));
         
        if (empty($name)) {
            echo 'Enter name';
        }   
        elseif(empty($email)) {
            echo 'Enter email';
        }
        elseif(empty($subject)) {
            echo 'Enter subject';
        }
        elseif(empty($message)) {
            echo 'Enter message';
        } 
        else {
        
        require "PHPMailerAutoload.php";
            
        $mail = new PHPMailer();
        $mail->isSMTP();  
        $mail->SMTPAuth = true;
        $mail->SMTPSecure = "tls";
        $mail->Host = "host.host.net";
        $mail->Port = 587;
        $mail->Username = "username";
        $mail->Password = "password";
              
        $mail->From = $email;
        $mail->FromName = $name;
        $mail->Encoding = "base64";
        $mail->Timeout = 200;
        $mail->ContentType = "text/html";
        $mail->addAddress("email@email.com", "Name");
        $mail->Subject = "Mail subject";    
        $mail->Body = "test message";
       
        if($mail->Send()) {
            
            $automail = new PHPMailer();
            $automail->IsSMTP();
            $automail->SMTPAuth = true;
            $automail->SMTPSecure = "tls";
            $automail->Host = "host.host.net";
            $automail->Port = 587;
            $automail->Username = "username";
            $automail->Password = "password";
    
            $automail->From = "email@email.com";
            $automail->FromName = "Name";
            $automail->Encoding = "base64";
            $automail->Timeout = 200;
            $automail->ContentType = "text/html";
            $automail->AddAddress($email, $name);
            $automail->Subject = "Subject recieved";
            $automail->Body = "test message";
            
            if($automail->Send()){
                echo 'Sent';
            }
            else {   
                echo 'Something is wrong';
            }
        }
        }
    
  15. Hey there guys,

    So, I have a working contact form using phpmailer and smtp connection to receive the e-mails from website and sending autoreply to the person who sent the mail via contact form. Everything is working correctly, but I would like to integrate it with processwire more as now it's kind of too external.

    My setup is as follow:

    I have the contact form in html as template contact.php

    The actual php sending script + phpmailer files are in a folder in my root section

    I have this in the contact.php template

    <form method="post" action="/test55/php/contact-form.php" id="contact">
    

    to get the php sending script (which is outside processwire)

    in the contact-form.php I have this to get the phpmailer file

    require "/test55/php/PHPMailerAutoload.php";
    

    I am wondering how could I integrate it within processwire instead of keeping the files outside? I've noticed there are three smtp modules, two based on swiftmailer and one on phpmailer, so far I can't figure it out at all.

  16. Hey there,

    I've installed this module. It has created a new template simple_contact_form.php

    I've created a page and used simple_contact_form.php as its template

    So I see the contact form on the new page, but it doesn't seem to work (I've used my @gmail.com as emailTo)

    is there anything else I should do to make it work?

  17. Hey guys,

    I've experienced the same problem with svg, but I have simply added svg to the list of Valid File Extensions (under Details on the Field page). It works just perfectly fine. (I was not changing anything in my svg file, it has width and height defined already, but it didn't work until I've added the file extension)

  18. I understand that bootstrap is one of many options for gird. The blog profile itself is made with skeleton grid. With skeleton instead of col-md-3 it would be three columns (and I realize the grids are different), but it was just an example. From what I've noticed there is more documentation for bootstrap than any other grid system so I just went with your suggestion :)

    but I suppose I should not add 

    <div class="row">
    

    before line 21 in post.php, if I remove it it actually works with grid (either bootstrap or skeleton) without messing with the existing css like this

    .post {
    width: 25%;
        float: left;
        
    }
    
×
×
  • Create New...