Jump to content

daniel.s

Members
  • Posts

    27
  • Joined

  • Last visited

Everything posted by daniel.s

  1. Is it possible to connect the GoogleClientAPI to Google Analytics? The current module for analytics is quite hard to automate which this API could help do.
  2. I recently found Concierge which supports both chat and video sharing capabilites. As of right now it's totally free! https://live.gotoassist.com/
  3. The Solution above worked well but wont work if i want more control over the template. I got a custom list of pages to work within this module: <?php $p = $this->modules->get('ProcessPageList'); // kongondo's code goes here $p->set('id', 1166); // setting the parent page $pageTree = new InputfieldMarkup; // the placeholder $pageTree->value = $p->execute(); // fill the InputfieldMarkup form field... echo $pageTree->render(); //or return if in a function... ?> But is there any way to do this for ProcessPageEdit for a specific page? (In my case a settings page)
  4. How do i use a regular page as an admin page, in this case a settings page with a template who has no file attached to it. My problem is that the module requires a php file to output data, all i want is to have my /settings/ page in the top menu of the admin, no custom markup whatsoever. I have used this tag from here: if($page->template=="admin" && $page->name=="settings") $input->get->id = $pages->get("/settings/")->id; The problem with this is that it will automatically use the "ProcessPageEdit" Icon. My question follows: How do i get my /settings/ page to the top meny using this Module?
  5. Thanks! The documentation for Klarna seems to be good. If the connection is possible i will definitely use this for projects in the future!
  6. Great! I'm building a system for menus for a restaurant website and don't know the how the customer wants the sub-categories for the menus (Starters, Main, Desserts). My thought was to let the repeater take care of the sub-categories and the table stand for the individual dishes. Is this a valid way of doing this?
  7. Is it possible to put ProFields: Table in a repeater field?
  8. Is there any possibility getting Klarna Checkout to work with this? https://developers.klarna.com/en/no+php/kco-v2/checkout How much work is it to implement?
  9. The script has been working really great for a year now but for some strange reason it's decided to stop working. Can't find any deprecated code used in the code and the shortened url's comes up in my goo.gl account but won't work in the $page->links field. Anyone have a clue what's wrong? Been scratching my head trying to figure this out for days now if($page->links) { $short = $page->links; } else { $shortUrl = $client->shorten($config->httpHost . $page->url); $page->of(false); $page->links = $shortUrl["id"]; // About here something's going wrong $page->save('links'); $short = $page->links; }
  10. Hello, I'm using a function to limit an entry to a predetermined number of characters. This is what it looks like: <?php // Excerpts a field to $limit length function excerpt($str, $limit = 400, $endstr = '…'){ $str = strip_tags($str); if(strlen($str) <= $limit) return $str; $out = substr($str, 0, $limit); $pos = strrpos($out, " "); if ($pos>0) { $out = substr($out, 0, $pos); } return $out .= $endstr; } ?> It works like a charm but sometimes i want to limit two different fields within the same function: <?php echo excerpt($result->summary. $result->body); ?> This works 'OK' but this way i can't get a space between the summary text and the body text. It's i minor issue but it looks kinda dull. For example: "Hello, this is the summary.And this is the body text." My PHP knowledge is low but my guess is that the problem arises with the "strip_tags" function. Is there any way around this? Thanks for help /Daniel
  11. Hello! I'm having some trouble with the plugin. I've used Ryan's basic-form.php.txt file as a boilerplate and get the success message and all but it's seems i'm not receiving any mail to the linked email account. Tried 2 different accounts. It's for a launched site and it would be unfortunate if sent mails got lost. Is there an easy way to save the form as a child page to the parent like with this code: $form->parent = $page; // optional, saves form as page I'm really stuck, been trying all night to get this to work. Help would be highly appreciated Edit: Solved it through changing from mail to wireMail and installing the Swift Mailer module. mail($emailTo, $subject, $message, "From: $form[email]"); To wireMail($emailTo, $form[email], $subject, $message); Thanks!
  12. I'm having a problem with the special characters "åäö" turning up strange when the content is emailed. Is there anyway to support Swedish letters when using the mailing function?
  13. Wow! Thanks everyone. I'll try implementing this in a few hours.
  14. <?php require_once('Googl.class.php'); $googl = new Googl('YOUR_API_KEY'); if (!$page->shortUrl) { page->$shortUrl = $googl->shorten('http://www.google.com/'); } ?> How can i do the if statement if the field isn't populated already? is !$page->shortUrl or how can it be done. And do i need to get something like $field->set($key, $value) ? Im not that great with PHP, thanks for all the help. /Daniel
  15. I noticed the script makes a new shortUrl for every visitor. I understand this is due the script is run every page load. How can i get a static short url for every page using the template instead of loading a new short url every page load?
  16. Hi, I'm trying to integrate google shorterner for use in social share buttons. I'm working with a goo.gl class to talk with the API but after this im kinda stuck. I want every page that uses given template to get a short url and then echo it to the social share buttons. I putted this code in the top of my template for testing but can't even get the test to work yet. cURL is enabled on the server. Is it possible to do something like this or should i hook the function to some Processwire API call that triggers when the page is created? Here's the code: <?php require_once('Googl.class.php'); $googl = new Googl('YOUR_API_KEY'); // Shorten URL $shortUrl = $googl->shorten('http://www.google.com/'); echo $shortUrl; ?> Anyone who can point me in the right direction? Thanks /Daniel EDIT: After some further digging and tests i found my API key to be invalid.
  17. I'm having a problem with Thumbnails if the field is empty. If it's empty it breaks the entire code after that point: <img src="<?php echo $page->parent->background_image->getThumb('background'); ?>" alt="<?php echo $page->parent->background_image->description; ?>"> Do i need to input an "If" statement for every instance or is it just broken?
  18. Hi, I have a client in need of both Twitter and LinkedIn automatic social updaters. There is an existing module for Twitter but not one for LinkedIn. Anyone here who can do this sort of thing, and how much would it cost? It'll be no problem taking it Open Source to the Modules Directory after too. Twitter Module: http://modules.processwire.com/modules/social-twitter-update/ Thanks!
  19. Got it working with a variation of your code: if($input->urlSegment1) { $name = $sanitizer->pageName($input->urlSegment1); // remember to sanitize $results = $pages->find("parent=$page, limit=10, category=$name, sort=-date"); } Thanks for all the help Ryan! I really appreciate it. Processwire is truly amazing. The more i learn about it and work in it the more i'm bummed about not finding it sooner!
  20. I only use the one template for this (news.php) Dont know if it's the right way, or even possible to do this: Want the template news to work for "mysite.com/news" but also for "mysite.com/news/category". So the if statement sais if i have a urlsegment (category), take the category name and get all children to "news" with a field called "category" that matches the url segment. If there's no urlsegment it gets all the children. My goal is to have a flat news list without categories as parents but still be able to tag or categorize them through a field. Is there a better way? Thanks!
  21. Hello! I've hit a wall with UrlSegments. I've created a select field in the children pages with http://modules.processwire.com/modules/fieldtype-select/ named "category" with 3 options; news, pressreleases, articles. I read through this topic and tried to somewhat duplicate the process: http://processwire.com/talk/topic/4716-returning-articles-with-the-same-article-date-category-and-tags/?hl=filtering#entry46196 when i try going to the page ex. my.page.com/news/articles with "articles" as the key for the "category" field i get this message: Error: Exception: Unknown column 'field_category.name' in 'on clause' (in /Applications/MAMP/htdocs/processwire/wire/core/Database.php line 118) Here's my code: <section class="newsList last"> <?php if ($input->urlSegment1) { $results = $pages->find("parent=$page, limit=10, category.name=$input->urlSegment1, sort=-date"); } else { $results = $pages->find("parent=$page, limit=10, sort=-date"); } $pagination = $results->renderPager(); foreach($results as $news) { ?> <article> <h2><a href="<?php echo $news->url; ?>"><?php echo $news->get("headline|title"); ?></a></h2> <small> <time> <?php $datefield = $news->get("date|created"); echo date("F, Y", $datefield); ?> </time> </small> <p><?php echo $news->summary; ?> <?php echo wordLimiter($news->summary. $news->body); ?></p> <p><a href="<?php echo $news->url; ?>">Read more ››</a></p> </article> <?php } ?> <?php echo $pagination; ?> </section> What am i doing wrong? Read through all related topic but can't seem to find the problem
  22. That pretty much sums it up! Just what i needed. Thanks
  23. Hi Everyone, I'm working on my first big Processwire site and stumbled upon my first "what to do here" moment. My client wants a Downloads page that is synchronized with the News section of the site. The file should be uploaded once onto the site (maybe the downloads section) and then be accessible from the news section. Is the best way to somehow get all documents uploaded from a news to go to some central storage that shows up in the downloads page or should it be uploaded to the downloads page and linked to the news through page-to-page connection? Sorry if i'm vague, kinda bad explaining things. Thanks!
  24. One thing you could do is to only do 3 pages: -Thoughts -Quotes -Links Inside these pages you could have a repeater field with the needed fields. Then it's just a matter of hooking up the fields where you need them. $quotes = $pages->get("/quotes/"); foreach($quotes->quotes as $quote) echo "<h3>{$quote->textarea}</h3><small>{$quote->author}</small>"; Im completely new and more of a designer than a programmer so don't know if the code works or if it's a solution for your needs but it's what i would have done.
  25. Thanks for reply! I've decided to make a small project to test it out before i start with the big one. I'm pretty sure i'll use Processwire but i have to outsource the Linkedin part to someone in the future.
×
×
  • Create New...