Jump to content

alexpi

Members
  • Posts

    28
  • Joined

  • Last visited

Everything posted by alexpi

  1. The repeater is called 'music' and the repeater fields 'song'.
  2. I have a repeater with mp3s, and I am using the following code to get the path to the mp3. foreach ($settings->music as $song) { echo "<audio src='$song->url'></audio>"; } but the path returned looks like this: /processwire/repeaters/for-field-157/for-page-1355/1396614455-2945-1/ I am not getting the file ending in .mp3 What am I doing wrong?
  3. Another thing that popped up..! Is it possible to get the page that a form action originated from, in a file outside PW's directories that has PW boostrapped in?
  4. I had the repeater name 'availability' written as 'availabilty' ..! I can't believe I lost so much time for this! Thanks nik!
  5. Hello I have the following code: $houses = $pages->get('/houses/')->children('limit=6'); foreach ($houses as $house) { echo "<li>"; foreach ($house->repeater as $repeater_item) { echo $repeater_item->repeater_field; } echo "$house->title"; echo "<a href='{$house->url}'>"; echo "<h2>{$house->title}</h2>"; echo "<img src='{$house->house_thumbnail->url}' />"; echo "</a>"; echo "</li>"; } The problem is that I can't output the nested foreach(). I get a 'Invalid argument supplied for foreach()' error. Do I have a syntax error?
  6. Bootstrapping PW works perfectly in my situation, thank you very much!
  7. Yes, the js is on a .php file. If I put a relative link I get a 403 Forbidden error. I can put the form processing .php file outside PW's directories, but it would be nice to use a PW template. In it, I wanted to have the various validation messages as user editable fields (for multilingual use reasons). So, if I understand correctly, it is not possible to have a PW template (that contains only php) to be called by an ajax request. Also, thank you all for your time, I am a web designer and my php knowledge is limited, so my questions/explanations may not be very clear!
  8. The url in the JS looks correct but does nothing. I tried the same thing with a validation.php file outside PW's folders and it works. When using: <form action='<?php echo $process->url ?>' method='post' id="contact_form"> the proccesing happens in the $process page (with a redirect), but combined with: $.ajax({ type : 'POST', url : '<?php echo $pages->get("/process/")->url ?>', // the url where we want to POST data : formData, dataType : 'json' }); nothing happens.
  9. Something I don't understand: In an ajax url parameter like in the code I sent, is it valid to echo a PW page url that contains the php validation code?
  10. Hello all, I am having trouble with the following: I have created a template with contact form validation code (./site/templates/contact.php). I am using the action attribute of my form to point to this template, and the validation works, redirecting to this contact template which shows the relevant messages. Since I am displaying the contact form in a modal kind of thing, I want the validation messages to appear inside this modal without the page refresh and redirection. I am not very familiar with ajax, and I can't achieve showing the contents of contact.php inside this modal. I am trying to do something like this: $('#contact_form').submit(function(e) { $.ajax({ type: "POST", url: "<?php echo $pages->get('/contact/')->url ?>", }); e.preventDefault(); }) but this doesn't work. Any ideas?
  11. If I make a page template as SteveB suggested, a construct like the below for getting the form with javascipt, will work? contact_form.submit(function() { $.post( "../site/templates/contact.php" ); }); I just want to show the validation that happens on contact.php in the current page.
  12. Firefox 28 is out and it suports flex-wrap!

  13. So mad at the client that demands stealing stock photos.. !@#$#$^&

  14. Sorry, solved. The mod_rewite was not enabled on the server.
  15. Hello, I developed my first PW site locally, everything run fine. Now I uploaded the files to the server (digitalocean), and every link goes to the home page. The .htaccess file works, I did the trick with the gibberish an top. I am not sure I understand the rewritebase settings, I tried various suggestions from the forums but I can't find a solution. Any ideas will be greatly appreciated since my client has gone mad..!
  16. Old stereo sound demo record(!) http://t.co/5oTW2oyhTa

×
×
  • Create New...