Jump to content


  • Posts

  • Joined

  • Last visited

Posts posted by kkalgidim

  1. echo title;  Output -> Murat Övünç Konseri

    After i save page title become like this on admin panel -> Murat Övünç Konseri


    Here the code i save page

    					$p = new Page(); // create a new page 
    					$p->template = 'home'; // choose template 
    					$p->parent = wire('pages')->get('/posts/'); // choose parent page 
    					$p->name = $wire->sanitizer->text($baslik[1]); 
    					$p->title = $wire->sanitizer->text($baslik[1]);  
    					$p->save(); // save the page

    Its multilanguage profile template

    ı attached the admin panel output

    what should i do?



  2. I am getting error when i try to install it from admin panel module install section.

    Compile Error: Arrays are not allowed in class constants (line 58 of /home/alanyaduyuru/domains/alanyaduyuru.com/public_html/site/modules/InstagramBasicDisplayApi/InstagramBasicDisplayApi.module)

    line 58 refers to

        const mediaTypes = [
            'carouselAlbum' => 'CAROUSEL_ALBUM',
            'image' => 'IMAGE',
            'video' => 'VIDEO',

    Is it related with instagram update or just related with me?

    I am using fresh installed multilanguage profile if its matter.



  3. @kongondoI am using opencart one of my project and i am waiting for padloper 2 to transfer it. 

    important things for me is

    -international multi language and currency system.(detecting customer language and redirect him to that language) (also adding shipping and custom prices according to location of customer)

    - integration with local store barcode software. (when product sold in real store stock must be populated on online store)


  4. Hi,

    i found solution and i would like to post it here. Maybe it helps someone.

    i removed 

    echo $searchresults->toJSON();

    i used the code below instead of toJSON function

    $myPages = $pages->find('template=clinic|doctor|treatment|location|resource');
    $data =$myPages->explode(['title', 'url']);
    echo wireEncodeJSON($data);

    now it shows the current language results

    You have to set the


    cache: false,


    if you dont set cache false it still show the cached language result even you change the language.


    • Thanks 1
  5. Hi, here is my question

      - Clinics
      - Doctors


    doctor.php template -> reference_clinic (page reference field)

    when i create new doctor i select the related clinic from reference_clinic field. Works fine!

    What i want is  when i select related clinic on doctor template at the same time clinic template -> reference_doctor updated


    if i create a doctor i want to select a clinic.

    if i create a clinic i want to select doctor.

    Help please

  6. 2 hours ago, 3fingers said:

    Does this works?

    if($config->ajax) {
    	$language = $languages->getLanguage();
        $searchresults = $pages->find("has_parent!=2, $language");
        header("Content-type: application/json"); // Set header to JSON
        echo $searchresults->toJSON(); // Output the results as JSON via the toJSON function
    } else { ...


    no 😞

    i also tried



     $currentLanguage = $user->language;

    $searchresults = $pages->find("has_parent!=2, $currentlanguage");


    but its not working. i think find function does not accept variable parameter. 

    maybe if i know the value of the laguage param it can be something like that


    $searchresults = $pages->find("has_parent!=2, langparam={$currentlanguage}");


  7. Hi,

    i am using multi language system

    i have ajax search system (live search)

    When i enter the word into search box it find the related topics but also show the other langugae titles.

    How can i made it for current language?

    Here is the code that i use


    // Check if ajax request
    if($config->ajax) {

        $searchresults = $pages->find("has_parent!=2"); // Find all published pages and save as $results
        header("Content-type: application/json"); // Set header to JSON
        echo $searchresults->toJSON(); // Output the results as JSON via the toJSON function

    } else {

    result attached as image


  8. 							<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
    								<?php foreach($pages->get("/treatments/")->children as $t) {
    									$count = $pages->count("template=clinic, cliniclocation=$page->id, treatmentprice.clinictreatments=$t->id");
    									if ($count!=0){
    									echo "<a class='dropdown-item' href='$page->url$t->name'>$t->title ($count)</a>";}
    								} ?>


    Hi you see code above.

    Its a multi language web site.

    When i change the language instead of default language,  url section ( t->name  ) not  change!

    for ex: 

    default language english


    select turkish language


    it must be 



    if i use


    instead of


    translation works fine but not as url. as usual it echoes title

    it look like 

    http://www.domain.com/tr/konumlar/turkey/Dis Implati


    if i use $t->url

    it echo konumlar/turkey/dis-implati

     so if i get last segment of url it will works fine.


    What can i do for that?


  9. Hi,

    I am trying to implement a search section for a project

    Can any body tell me about this search method of the site . Link below


    I think its called morping search

    It cover screen and filter results by characters you type.

    It lookslike live search i think. Is there any module for processwire? I found Ajax search module by @Soma 

    If anybody show me a way about this i will be appricate.


  10. Hi again,

    This time i am trying to implement a faq section for treatments.

    Every treatment has its own question Answer section.


    • Dental Implant
    • Hair Transplant


    • Sample Question 1 
    • Sample Question 2

    faq template has question and answer fields

    I can use page reference field for Faq but on the Treatment template when i hit new Faq button it only creates new question.

    So i should go back to question under FAQ category  and edit it then fill answer field. 


    What  i want is  when i click on new faq button. i should fill question and answer fileds to gether ?

    Or any other way to do this instead of page refrence?


  11. Thanks for your help @elabx and @bernhard

    Here is my solution just with location template and sublocation page reference field


                                            if ($page->sublocation->eq(0)){ /* IF PAGE IS COUNTRY*/
                                                foreach($page->sublocation as $s) {
                                                    echo "<li><a href='$s->url'><i class='icon_documents_alt'></i>$s->title</a></li>";/*ECHO ALL SUBLOCATIONS ON THAT COUNTRY*/
                                            else {    /* IF PAGE IS CITY OR ANY LOCATION IN A COUNTRY */
                                                $relatedCountry = $pages->get("template=location, sublocation={$page->id}"); /*GET THE RELATED COUNTRY*/
                                                $relatedCountry->sublocation->remove($page); /*REMOVE CURRENT CITY FROM LIST*/
                                                    echo "<li><a href='$relatedCountry->url'><i class='icon_documents_alt'></i>$relatedCountry->title</a></li>"; /* ECHO RELATED COUNTRY*/
                                                foreach($relatedCountry->sublocation as $x) {
                                                    echo "<li><a href='$x->url'><i class='icon_documents_alt'></i>$x->title</a></li>"; /*ECHO ALL SUBLOCATIONS OF THAT COUNTRY EXCEPT CURRENT CITY*/


    May be it helps someone else. 

    • Like 1
  12. Hi,

    On my web site i am using only location for countries and also cities or states

    • Locations
      • Turkey
      • Mexico
      • USA
      • Istanbul
      • Ankara
      • Newyork
      • Chicago

    I am using page refence field as "sublocation"

    For ex: Istanbul located in Turkey

    I edit Turkey and add Istanbul as "sublocation"

    when i call code below i see all the related cities with Turkey


    foreach($page->sublocation as $s) {
      echo "<li><a href='$s->url'>$s->name</a></li>";
     } ?>


    What i want is if i am on city page how can i call Turkey (parent of city) and other related cities (siblings of city) ?

    If  i am on Istanbul Page i want a section called Istanbul related locations.  Turkey, Ankara will be listed on it.


  13. Thanks for reply @dragan

    it will be one-to-many relationship

    there is 2 template file location.php and list.php

     xxx.com/location/turkey/  uses location.php template

    when i enter xxx.com/location/turkey/clinics i want to use list.php template 

    because list will be new designed page. not the part of location template design. how can i achive this?

    So there is 2 question.

    1. how can i assign list template with xxx.com/location/turkey/clinics

    2. same code works on list.php template?







  14. Hi,

    I m confused on how to filter results using url segment. It must be very easy question but i can not figure it out. 

    Here is my admin tree


    • Clinics
      • Clinic1
      • Clinic2
    • Treatments
      • Dental Implant
      • Hair Transplant
    • Locations
      • Turkey
      • Mexico
      • Germany


    I am using location template, treatment template, clinic template

    My question is

    How can i create a link on location template to show the clinics on that location.

    For ex: on the www.xxx.com/locations/turkey  url i have a button called clinics. When i click on that button i want to goto www.xxx.xom/locations/turkey/clinics and it will show the clinics located on Turkey.

    I hope my explanation clear. 

  • Create New...