Jump to content

grigorisk

Members
  • Posts

    15
  • Joined

  • Last visited

Posts posted by grigorisk

  1. On 9/8/2016 at 1:32 PM, dab said:

    Yes, change lines 165 & 166 in MarkupLoadRSS.module to to

    
    'stripTags' => false,             // Strip any markup tags that appear in the feed? (default: true)
    'encodeEntities' => false,         // Whether to automatically decode and re-encode the entities for all fields (default: true)

    Works a treat :-)!

    It does not work for images in my site

    any suggestions? 

  2. hi!
    i'm trying to get the label of my field that i use in two templates with different name.
    so i'm trying to get the label through the template.
    so my code is
    echo $templates->get("home")->fieldgroup->get("text")->label;
    

    but it gives me the general field label not that i'm using for the home template

     
    any idea?
  3. thanks @gebeer

    p.s.

    if anyone wants to do something like that
    you have to add the gebeer code (without function in my case)
    and just put this in find selector:
    $articles = $pages->find("date>=$first, date<$last, parent=[name=blog], sort=date");
    • Like 1
  4. hi!
    i have a question about find page
    when i try to find a page with a value in an input field i take the right results but if i try to make the same with an input date field it not work as i want

    i have two variables so my search is like this:

     

                    if($articlecat!="" && $searchdate!=""){
    		  $articles = $pages->find("date%=$searchdate, articleCat%=$articlecat, parent=[name=blog]");
    		  
    		}elseif($articlecat=="" && $searchdate!="") {
    		  $articles = $pages->find("date%=$searchdate, parent=[name=blog]");
    		  
    		}elseif ($articlecat!="" && $searchdate==""){
    		  $articles = $pages->find("articleCat%=$articlecat, parent=[name=blog]");
    		  
    		}else {
    		  $articles = $pages->find("parent=[name=blog]");
    		  
    		}
    

    this working great for tag field (articleCat) but it's not working for date field (date)

    the string in $date has this format: January-2016 and in my pages has this format: 12-January-2016
    so i want to take all the pages that has January-2016 on their date field

    can you help me?

  5. hi!
    i'm trying to create a child for my page in form submit via ajax but i have this error

    "Fatal error: Class 'Page' not found in /home/chaniataxi/public_html/site/templates/insertReservations.php on line 4"

    the code in insertReservations.php is
     

    $p = new Page(); // create new page object // <--line 4
    $p->template = 'insertReservations'; // set template
    $p->parent = wire('pages')->get('/my-reservations/'); // set the parent
    $p->name = $name."-".$sname.'reservation'; // give it a name used in the url for the page
    $p->title = 'Νέα κράτηση στο όνομα'.$name." ".$sname; // set page title (not neccessary but recommended)
     
    // added by Ryan: save page in preparation for adding files (#1)
    $p->save();
     
    same with soma's code

    i create a template for insertReservations.php with name insertReservations

    my processwire version is 2.6.1

    did anyone know why i have that error?
  6. Hi!
    i have a question about page language url

    i have a site with 2 language, default and greek.

    so in my home i set empty the language field for my default language and el (/el/) for my second language.

    so if i want to navigate from my default lang page to other lang page i just put the /el/ after my domain.

    my problem is that i want to get the page language url (el/ , en/, de/...)
    but i can't find the right syntax of $user->language to get it

    i try $lang = $user->language->name; but i get the name of my lang,

    i try $lang = $user->language->id; but i get a number (the id of my lang),

    can anyone tell me if i can get the /el/ using the above syntax?

  7. i try both but nothing...

    my page tree is (i can't upload image so i'll describe it...)

    pricing (my parent page)

         heraklion (1st child)
                heraklion pricelist1(1st child of heraklion)
                 .
                 .
                 .

         Chania (2nd child)
               chania pricelist1(1st child of chania)
               chania pricelist2(2nd child of chania)
                 .

                 .
                 .
         .

         .
         .

    and i want to get all the children of the pricing page (heraklion, heraklion pricelist, chania, chania pricelist,....) if their checkbox is checked

  8. hi i want to post variables to a page via ajax to get result from my database depenting my post value
     
    so my ajax is:
     

    var clickval = clickelement.value;
    var dataval = "city=" + clickval;
    
    $.ajax({
    type: 'POST',
    url: "*MY PAGE SMART URL*", // e.g. http://my_domain/my_page....
    data: dataval,
    dataType: 'text', //or json, i try both
    complete: function(data, status){
    
    alert(data.responseText);
    
    }
    
    });
    

     
    and in php page: 

    $getcity = $input->post->city;
    echo "value = ".$getcity;
    

    just to show my post value...
     
    and my alert is "value = ".
    $getcity is empty and $input has no value inside and it seems like post is never be done, but i have no error in my console...
    can anyone help me?

×
×
  • Create New...