Jump to content

Nico Knoll

PW-Moderators
  • Posts

    1,835
  • Joined

  • Last visited

  • Days Won

    21

Community Answers

  1. Nico Knoll's post in Overwrite option in language_files field not working was marked as the answer   
    Solved.
  2. Nico Knoll's post in How to use Json generated from Pages Web Service module was marked as the answer   
    If your hoster allows it you can even use something like:
    <?php // fetch the json displayed on the service page $dataJson = file_get_contents('http://url.com/service-page/'); // transform it into a php array $data = json_decode(dataJson, true); ?> If this shouldn't work you can use file_get_contents_curl (not default PHP function but you can find it here: http://stackoverflow.com/a/8543512/4044167) instead of file_get_contents()
  3. Nico Knoll's post in changing output of summary of children in a custom foot.inc was marked as the answer   
    Solved
  4. Nico Knoll's post in Uncaught exception 'Wire404Exception' with message 'Unknown page' was marked as the answer   
  5. Nico Knoll's post in URL Segments never work. What gives? was marked as the answer   
    I think you didn't understand the concept of urlSegements. What you want is something like this:
    <?php $splitted = explode('/', $page->url); echo $splitted[2]; ?>
  6. Nico Knoll's post in Add code before ProcessPageList::execute was marked as the answer   
    Found it.
    it was JSON related. Working code:
    if($this->input->get->render != 'JSON') $event->return = $event->return.'n';
  7. Nico Knoll's post in Assigning PHP file to JQuery Ajax POST Request Results in 404 Page Not Found was marked as the answer   
    I think that it is not possible to directly access php files in the "templates" directory (because if everyone could do it it would be a big insecurity).
    Of course you can include them via PHP because this get's rendered before the page is returned to the user. But jQuery/Javascript acts more like a real user. And for them everything (except images, javascript files, stylesheets, etc.) in /site/ and in /wire/ is locked.
    What you have to do:
    Create a template in the backend called e.g. "subscribe". Then create a page using this template e.g. named "subscribe", too. You now can access this page via http://localhost:8080/home/sovonex/Programs/rubystack-2.0.0-12/apps/processwire/htdocs/subscribe/ or something similar. That's the page you should point your post request on.
  8. Nico Knoll's post in Imageextra Field Not Displaying was marked as the answer   
    You have to put it in the loop of course:
    <?php // get the images (if your image field is called "images") $images = $page->images; foreach($images as $image) { echo $image->credits; }
  9. Nico Knoll's post in Output From Repeater Field was marked as the answer   
    Then you need two loops inside:
    <?php foreach($page->nuoma as $field) { echo '<div class="small-12 columns large-6 columns bobkat-nuoma">'; foreach($field->big_img as $big_img) { echo '<a class="fancybox" rel="gallery1" href="'.$big_img->url.'">'; } foreach($field->small_img as $small_img) { echo '<img src="' .$small_img->url. '" alt=""></a>'; } echo '<h2>'.$field->bobkat_name .'</h2>'; echo $field->body; echo '<span>'.$field->price.'</span>'; echo '</div>'; } ?>
  10. Nico Knoll's post in Integrity Constraint Violation When Adding Child Page [Solved] was marked as the answer   
    Solved.
  11. Nico Knoll's post in Session Login Problems In Ie With Chromeframe Plugin Installed was marked as the answer   
    Just wanted to mark this topic as answered because you found a solution yourself
  12. Nico Knoll's post in Cannot Edit Content was marked as the answer   
    It's like Ivan said: Looks like a TinyMCE problem.
    Do you tried different Browsers? Which OS are you running (looks like windows 2000)? Have you tried to use another computer? 
  13. Nico Knoll's post in Website without homepage was marked as the answer   
    <?php
    // home template
    $session->redirect($pages->get('/')->children->first->url);
    // or even easier because it is already the "homepage"
    $session->redirect($page->children->first->url);
    ?>

  14. Nico Knoll's post in Weird characters with datefield and umlauts was marked as the answer   
    Why do you use utf8_encode? Should be working without it. Or try htmlentities()
    Edit:
    Only for you a special service:

    The code of this:
    <html> <head> <meta charset="utf-8"> <title></title> </head> <body> <?php setlocale(LC_ALL, "de_DE.UTF-8"); echo 'Using utf8_encode:<br>'; $date = utf8_encode(strftime('%d. %B %Y', 1395929985)); echo $date; echo '<br><br>Without utf8_encode:<br>'; $date = strftime('%d. %B %Y', 1395929985); echo $date; echo '<br><br>Without utf8_encode and with htmlentities():<br>'; $date = htmlentities(strftime('%d. %B %Y', 1395929985)); echo $date; ?> </body> </html> Edit 2:
    Here is the resulting source code:
    <html> <head> <meta charset="utf-8"> <title></title> </head> <body> Using utf8_encode:<br>27. März 2014<br><br>Without utf8_encode:<br>27. März 2014<br><br>Without utf8_encode and with htmlentities():<br>27. März 2014 </body> </html>
  15. Nico Knoll's post in Add custom main variable was marked as the answer   
    Got it - thanks to this lovely site: http://www.flamingruby.com/blog/using-hooks-to-alter-default-behavior-of-processwire/
×
×
  • Create New...