Jump to content

a-ok

Members
  • Posts

    812
  • Joined

  • Last visited

Everything posted by a-ok

  1. I decided to mark this as unsolved as adding this caused a few loading issues on the CMS on the pages dashboard (see screenshot) – any other thoughts?
  2. I worked it out. Go to /site/templates/admin.php and add in (above the controller.php require) <?php $config->styles->add($config->urls->templates . "favicon.ico?t=" . time()); ?>
  3. Hi folks, Quick one. Is it possible to add a favicon to the admin/CMS area? Without messing with anything core? Thanks, R
  4. Hi folks, Not sure if there is a 'bug reports' list, but I was giving a tutorial/guide on the CMS for a client today and I came across two issues... 1. When inserting an image or link into a ckeditor field, I received some issues with it displaying any content. At the time I couldn't debug it to check if it was loading in the content via the Network tab in Chrome DevTools, but checking now it seems to be working okay. Different network now. Wasn't sure if it was worth bringing up? I tend to get a few buggy issues with this modal. 2. Also the modal has some slight CSS issues (see attached) with the vertical line. I managed to get rid of it by turning off the position: relative on .ui-dialog .ui-dialog-content and the height:auto on html.modal, body.modal but that seems weird so I wouldn't look too much into it... just a shout out. I am using PW 2.5.3 and Chrome 39.0.2171.95 – I am also on a retina MBP. Thanks and apologies if this is a bit tedious! R
  5. Any news on this @ryan?
  6. I'm experiencing the same issue @Soma was in relation to having to press Preview twice to see the changes. I've noticed this only doesn't work on a live server... on my localhost it works without any issues at all. Hope this helps.
  7. Hi @adrian, Many thanks for the reply, and the encouragement! Yep, linking directly to the submission.php file works, but only if I remove the htaccess rules I did so as a test to make sure that worked... but of course changed back. I do get a forbidden error if I add the rules back in. Okay, below is my submission.php file... you can see generally what it is doing. Taking the $_POST data, storing them, then passing them into a few email templates, sending those on, and then echo'ing out an order summary (order-summary.php) page. <?php require_once 'ecommerce/swiftmailer/lib/swift_required.php'; require_once 'ecommerce/twig/lib/Twig/Autoloader.php'; Twig_Autoloader::register(); $loader = new Twig_Loader_Filesystem('./'); $twig = new Twig_Environment($loader, array( 'cache' => 'cache/', )); $twig->clearCacheFiles(); $data['firstname'] = $_POST['firstname']; $data['lastname'] = $_POST['lastname']; $data['email'] = $_POST['email']; $data['telephone'] = $_POST['telephone']; $data['street0'] = $_POST['street0']; $data['street1'] = $_POST['street1']; $data['street2'] = $_POST['street2']; $data['city'] = $_POST['city']; $data['state'] = $_POST['state']; $data['zip'] = $_POST['zip']; $data['countrycode'] = $_POST['countrycode']; if (isset($_POST['shipping'])) { $data['shipping'] = $_POST['shipping']; $data['shipping_firstname'] = $_POST['shipping_firstname']; $data['shipping_lastname'] = $_POST['shipping_lastname']; $data['shipping_email'] = $_POST['shipping_email']; $data['shipping_telephone'] = $_POST['shipping_telephone']; $data['shipping_street0'] = $_POST['shipping_street0']; $data['shipping_street1'] = $_POST['shipping_street1']; $data['shipping_street2'] = $_POST['shipping_street2']; $data['shipping_city'] = $_POST['shipping_city']; $data['shipping_state'] = $_POST['shipping_state']; $data['shipping_zip'] = $_POST['shipping_zip']; $data['shipping_countrycode'] = $_POST['shipping_countrycode']; } //Check the prices againts you DD $products = (array) json_decode($_POST['cart']); // Check this against your DB and get the correct discount $discount = $_POST['discount']; $discount_amount = $discount == 'TEST123' ? 50 : 0; // Check the shipping price $shipping_price = 0; foreach ($products as $value) { if (property_exists($value, 'size')) { if ($value->size > $shipping_price) { $shipping_price = $value->size; } } } switch($shipping_price) { case 1: $shipping_price = 5; break; case 2: $shipping_price = 10; break; case 3: $shipping_price = 15; break; }; $total = 0; foreach ($products as $product) { $total += $product->price; } $total -= $discount_amount; $total += $shipping_price; $body = $twig->render('order-email.php', array( 'data' => $data, 'products' => $products, 'discount_amount' => $discount_amount, 'shipping_price' => $shipping_price, 'total' => $total )); $summary = $twig->render('order-summary.php', array( 'data' => $data, 'products' => $products, 'discount_amount' => $discount_amount, 'shipping_price' => $shipping_price, 'total' => $total )); // Show confirmation/summary template echo $summary; //$transport = Swift_MailTransport::newInstance(); $transport = Swift_SmtpTransport::newInstance('tls://smtp.gmail.com', 465) ->setUsername('rich.g.cook@gmail.com') ->setPassword('_______'); // Removed for example $mailer = Swift_Mailer::newInstance($transport); $seller_email = Swift_Message::newInstance() ->setSubject('Invoice - Admin') ->setFrom(array('rich@rdck.co' => 'Admin')) // To change ->setTo(array('rich.g.cook@gmail.com' => 'You')) // To change ->setBody($body, 'text/html'); $customer_email = Swift_Message::newInstance() ->setSubject('Invoice - Customer') ->setFrom(array('rich@rdck.co' => 'Admin')) // To change ->setTo(array($_POST['email'] => 'Customer')) ->setBody($body, 'text/html'); $mailer->send($seller_email); $mailer->send($customer_email);
  8. Hi folks, Okay this is a bit of an odd one to explain so if you need to email please do at rich.g.cook(at)gmail.com and I'll happily pay a fee for any solutions if needed. I'm building a simple cart/checkout setup and on submission at the checkout the form action, on a static test, was submission.php and on this .php file it got the $_POST data from the form, parsed it using twig, and items and pushed it using swift mail to the seller and the buyer. This all works fine statically, but the issue is now it's on a CMS the $_POST data isn't getting saved across so upon submission all the fields (first name, address etc) are just returning blank. If I hard link the form submission to the templates folder to submission.php then it works but in the URL you have the weird .php whereas if I add it as a page and template in the CMS it drops the .php which is nicer but it doesn't seem to save any of the data this way. I know this is a bit confusing, but hopefully I've made some sense and you guys could help. Thanks, R
  9. That's great, @DaveP. Thank you. The first example didn't work and threw back some PHP errors, but the second definitely works. That's really appreciated!
  10. Hi folks, I am trying to query (find) pages who have a certain page as a parent, but then filter this result so it only returns the pages listed. I know you can do the following for one: $pages->find('parent=/widgets/')->filter(1020); But how do you do it for many? I thought the below would've worked... $pages->find('parent=/widgets/')->filter(1020|1069|1070|1071|1072|1073|1074|1075|1076)->getRandom(); Thanks, R
  11. Worked it out... <?php $tag = $page->name; ?> <?php $matches = $pages->find("tags=$tag"); ?> <?php foreach ($matches as $match) : ?>
  12. @Jan Thanks for that... makes sense! Unfortunately this doesn't seem to solve the issue as <?php if ( $tag = $sanitizer->pageName($input->urlSegment1) ) : ?> doesn't seem to be returning anything on /tags/green-energy for example...
  13. @renobird Hi, sorry... quick thing... if I originally used: <?php if ( $tag = $sanitizer->selectorValue($input->urlSegment1) ) : ?> <?php $matches = $pages->find("tags*=$tag"); ?> How would I use urlSegment1 for this new setup you suggested? I thought this might've worked... <?php if ( $tag = $sanitizer->pageName($input->urlSegment1) ) : ?> <?php $matches = $pages->find('/tags/$tag/'); ?> Many thanks...
  14. @renobird Ah right yes, I get you. I started writing a reply... but then I suddenly got it. Okay great... I will try this. Most appreciated!
  15. Oh, and my 'tags' aren't pages... it's just a text field
  16. Hi @renobird, thanks for the help and sorry for the slow response. I don't quite think I understand... essentially I'm wondering if you can search by tag if the 'tag' is more than one word. So, if it's one word, http://www.domain.com/tags/green, for example, works... but if it's two or more, I'm not sure how to word it http://www.domain.com/tags/green-energy or http://www.domain.com/tags/green+energy etc. I think I kind of understand, but couldn't find the 'allow new pages to be created from this field' checkbox. Thanks in advance.
  17. If I am implementing a 'free tagging field', which is explained by @ryan here > https://processwire.com/talk/topic/71-categorizingtagging-content/ is there any way to do this for more than one word (for example if a tag I entered is 'green energy') So, I have a tag.php template which uses something like: <?php if ( $tag = $sanitizer->selectorValue($input->urlSegment1) ) : ?> <?php $matches = $pages->find("tags*=$tag"); ?> <?php foreach ($matches as $match) : ?> <?php endforeach; ?> <?php endif; ?> This allows me, using url segments, to do: /tags/green and the results with a tag 'green', would come up. But how would I do it for something like 'green energy', so /tags/green+energy or /tags/green-energy... Currently my free tagging field is just a text field, but I could make this into a repeater, for example, if it helps this situation. Thanks in advance
  18. Changed it for this domain, to normal CGI, not FastCGI and haven't had it happen yet. Gone through most of the site. This might've solved it. I will read up on those forum posts, thanks for sharing. Appreciated!
  19. Ohhh... I am on Media Temple too. I will try this and get back. Many thanks!
  20. So, I just tried it and it worked fine and loaded everything. Then navigated to a few other pages in the admin and BOOM nothing... here's what the Network panel said I'm wondering if it's something to do with my .htaccess or config? Would this affect the admin area randomly?
  21. The latest... 2.5. So sometimes it loads <head></head> content, sometimes nothing at all, which explains the JS errors... as nothing is there.
  22. This is in the admin... so not modified any of this. Front end works with no problems. Works 100% on localhost.
  23. It looks like it's not getting anything in the `<head>` at all...
  24. Hi folks, I have a bit of an odd question, but I'm assuming it's related to something I have/haven't changed upon moving my local build to a live server. Everything, locally, works 100% and I have encountered no problems at all, but sometimes, when logging into the admin, the stylesheets/js will break and I'll get a broken page (see image below) – sometimes it happens, sometimes not and the page it happens on varies as well. The thing is, once it's happened, I can't return to the unbroken site until I save over the config.php file. Or, after a few refreshes it returns back. Odd, right? Looking in the error console on devtools, it states: Uncaught ReferenceError: $ is not defined sheffieldculture.co.uk.s141188.gridserver.com/:205 Uncaught ReferenceError: initPageEditForm is not defined This makes me think that the jQuery is failing to load... Any thoughts/similar issues?
  25. Thanks to both for your help and answers... wish I could mark both as the solved post Cheers guys!
×
×
  • Create New...