Jump to content

V7dev

Members
  • Posts

    14
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

V7dev's Achievements

Jr. Member

Jr. Member (3/6)

6

Reputation

  1. $items = $pages->find("template=event_day, event_schedule.speakers={$page->id}"); foreach($items as $item) { foreach($item->event_schedule as $repeater_item) { echo $repeater_item->event_title . '<br>'; } } It will echo out all the repeaters for that page, even though the speaker is only in one of them? What's the point of the first portion ($items) if you have to make another exception to see if the speaker is in the second foreach loop?Apologies for perhaps not seeing the forest from the trees!
  2. So that's what I was missing, thanks so much!
  3. I can't find anything specific in my searches, so I figured I would ask for some guidance! So I have a repeater field that I'm trying to search for outside a page. Here's my structure: Home Events (events template) Event (event template) Part One (event_day template) Repeater (named event_schedule) Event Start Date (event_start_date) etc... Part Two etc... Speakers (speakers template) So from the speakers template I'm trying to access the repeater with the following: $pages->find("template=event_day, event_schedule.speakers={$page->id}"); How do I access the actual fields inside the repeater, for example, the above dumps the following, which is correct, just can't access the event_start_date field? Let me know if there's more info needed. Thank you!
  4. Great news! Looking forward to it; just got fired from my job, so now have loads of time to play with it when it gets released. Thanks Kongondo!
  5. SWEET! Thank you for your hard work. I've been waiting for this! Cheers and happy new year to all!
  6. I'm excited to buy this! I was on vacation (first time in a very long long time) and missed the sign up opportunity to test the alpha. I guess I'll catch it on the production release!
  7. I for one am excited to see the release of this; waiting patiently.
  8. Well, for future users, I'm using it on ProcessWire 3.0.98
  9. @gmclelland I overlooked the version numbers, thank you!
  10. @gmclelland - That's odd, I just installed a fresh copy of TE Factory and TE Twig with the latest Twig Extensions and I get an internal server error; I disable the Twig Extensions, the site works fine - not sure how I could have messed up such a simple procedure, but I wouldn't put it past me!
  11. After some effort and endless searching for articles to lead me in the right direction, I'm stumped. I'm using Twig and have the following installed: ProcessWire 3.0.98 Template Engine Factory 1.1.3 Template Engine Twig 1.1.0 In ready.php, I've added the following code (which works wonderful without Twig) $wire->addHookProperty('Page::summarize', function($event) { $fieldName = $event->arguments(0); if(!$fieldName) throw new WireException("No field provided"); // get max length or use 300 as default if none provided $maxLength = (int) $event->arguments(1); if(!$maxLength) $maxLength = 300; $page = $event->object; $value = $page->get($fieldName); if(!strlen($value)) { // requested value is blank, nothing more to do $event->return = ''; return; } // get beginning of value, without any HTML in it (if any) $value = mb_substr(strip_tags($value), 0, $maxLength); // if output formatting on, make sure value is entity encoded if($page->of()) $value = $event->sanitizer->entities1($value); if(strlen($value) >= $maxLength) { // limit length of returned value between words // by truncating to the last space character $value = substr($value, 0, strrpos($value, ' ')); // append an ellipsis to indicate there is more $value .= '…'; } $event->return = $value; }); In my news.php template file, I have the following: <?php namespace ProcessWire; $results = $page->children("template=news, limit=10, sort=-created"); $view->set("results",$results); And in news.html.twig I use something like this: {{ summarize('result.body', 500) }} Exception: Unknown "summarize" function. (in twig\site\assets\cache\FileCompiler\site\modules\TemplateEngineTwig\TemplateEngineTwig.module line 94) So far Processwire is awesome, I'm loving it!
  12. This is not working for me! I'm using the following: Template Engine Factory 1.1.3 Template Engine Twig 1.1.0 I get this error: User Error Exception: An exception has been thrown during the compilation of a template ("Object of class Twig_Source could not be converted to string") in {}. (in C:\MAMP\htdocs\twig\site\assets\cache\FileCompiler\site\modules\TemplateEngineTwig\TemplateEngineTwig.module line 94) Since I'm new to PW, I'm afraid I can't be much help!
×
×
  • Create New...