• Content Count

  • Joined

  • Last visited

Everything posted by nfil

  1. Great news. Thanks Kongondo!
  2. nfil

    This is my Tree View: == Home == List ----- blog-post (has two page reference fields "categories" and "categories_a") ----- blog-post 1 == categories (List categories and latest blog-post title *) ----- category ----- my other category == categories-a ----- category-a ----- my other category a $categories = $page->children; foreach($categories as $category) { $posts = $pages->find("template=blog-post, categories=$category, limit=1, sort=-date"); foreach($posts as $post) { echo $category->title; echo $post->title; } } * Want to show the latest post for each category in the categories page. Not sure what I am doing wrong to retrieve latest posts. I changed it to this and its working now! $posts = $pages->find("template=blog-post, categories_select=$category, limit=1, sort=-date"); foreach($posts as $post) { $fimg = $post->featured_image; $thumb = $fimg->width(200); echo "<h4>Latest entry</h4>"; echo "<img width='200' src='$thumb->url' alt='$post->title'/>"; echo "<p>$post->title</p>"; }
  3. nfil

    this is a good introduction to markup regions! I found it very useful:
  4. nfil

    After a few tests, I added a new category to the blog post. I created 2 templates for the new category: categories_a.php <?php namespace ProcessWire; ?> <div class='uk-child-width-1-2@s uk-child-width-1-3@m uk-grid-match uk-margin-large-bottom' pw-append='content' uk-grid> <?php foreach(page()->children as $category_a): ?> <a class='uk-link-reset' href='<?=$category_a->url?>'> <div class='uk-card uk-card-default uk-card-hover uk-card-body'> <h3 class='uk-card-title uk-margin-remove'><?=$category_a->title?></h3> <span class='uk-text-muted'><?=$category_a->numPosts(true)?></span> </div> </a> <?php endforeach; ?> </div> <aside id='sidebar'> <?=ukNav(pages()->get('/blog/')->children('limit=3'), [ 'header' => 'Recent posts' ])?> </aside> category_a.php <?php namespace ProcessWire; ?> <div id='content'> <?php echo ukHeading1(page()->title, 'divider'); $posts = pages()->get('/blog/')->children("categories_a=$page, limit=10"); echo ukBlogPosts($posts); ?> </div> <aside id='sidebar'> <?php $categories_a = page()->parent->children(); echo ukNav($categories_a); ?> </aside> _main.php (Add new category to the navbar) <?=ukNavbarNav($home->and($home->children), [ 'dropdown' => [ 'basic-page', 'categories', 'categories_a' ] ])?> ready.php added a new hook for the categories_a category_a templates. Thats it. Thanks for the great Uikit theme.
  5. nfil

    Did anyone try to add another template for different "categories". I added the "categories_a" and "category_a" is the child template. This new category is also a "page reference" field. If anyone did a similar test, what did you change in "_uikit.php" and other files "ready.php".
  6. Hello. I installed pWire 2.6.16 and after giving permission for the editor role to delete pages, also his role has access to edit the template but the trash icon won't show next to the page. It will only display the trash icon for super users. Thanks for the help.
  7. nfil

    Hello. I have 3 templates: category sub-category partner I can output the template "partner" from a sub-category! But if there arent't 3 partners in that sub-catgory I want to get the others from the parent category template. Thank you $morep = $page->parent->children("template=partner, id!=$page->id, limit=3, sort=random"); foreach($morep as $a) { $firstimage = $a->images->first(); $thumb = $firstimage->size(400, 200); echo "<li class='item'> <div class='img_box'> <a href='$a->url' title='$a->title'> <img src='$thumb->url' alt='$a->title' width="400" height="200"> </a> </div> <div class='featured_title_postcustom'> <div class='caption_inner'> <a href='$a->url'><h4>$a->title</h4></a> <div class='post_date {$a->parent->parent->style_color}'><em> <a href='$a->url' title='$a->title'> {$a->parent->parent->title} {$a->parent->title} </a></em></div> </div> </div> </li>"; } -- My sitemap Pages Templates -- Category -sub-category -partner Category -sub-category -partner
  8. nfil

    Congrats! Really creative! Love the animations.
  9. That is a super idea Kongondo! I hope you find the time to do it. Padloper is great, but like Ryan, is taking time to develop the new PW themes. If there were premium modules, a default theme, a customer area, that would probably boost padlopers sales.
  10. nfil

    Congrats! but the main nav bar looks a bit weird in Safari.
  11. If you want to translate those fields try to put this: /wire/modules/Process/ProcessPageList/ProcessPageListRender.php in the </> Enter file to translate
  12. nfil

    hello and congrats. I was testing this module and get a syntax error on line 40 (path to templates )of the MarkupPlyrMediaPlayer.module keep up the good work.
  13. thanks kixe and adrian! While creating the site, as a superuser I always use this module, Congrats Adrian!! that one looks great too and makes sense for the editor role and batch delete. I haven't tried the cronjobEmptyTrash module, always try to keep the modules to a minimum but I will certainly have a look at that one too. thanks!
  14. Yes it makes sense! A client that wants a quick way to delete pages asked if this would be possible but sometimes a wrong click and no access to trash can cause panic. I was also thinking about lister or listerPro to batch delete the pages and thanks for the hook suggestion. Thanks for all the answers.
  15. For the pdf-invoice you could try this great module from wanze:
  16. nfil

    Hi Ryan, yes the Setup > Fields > Add New fields. Can only see the required name field message and a blank screen underneath it. Tested it on multiple browsers. I have these modules installed, yet I had multi language enabled before, but not at the moment. Map Markup (Google Maps) 1.0.1 Markup Simple Navigation 1.3.3 Markup Sitemap XML 1.0.9 Import Pages from CSV 1.0.4 HiddenAdminPages 1.0.0 Clean Empty Page File Dirs 0.0.3 Batcher 1.0.4 Pages2Pdf 1.1.1 Forms TinyMCE (updated) I will do some more tests this weekend. Thanks. p.s. I also tested the upgrade module and no errors there too, all the modules were updated and compatible.
  17. nfil

    hi. After upgrading from 2.4.5 to 2.5.3 or .4 I cannot create new fields I always see the msg Field 'name' is required No input fields just the message. reverting the folder wire to 2.4.5 I am able to create the new fields in the backend. Tested with php 5.4.13 and 5.5.0 and checked the few modules installed batcher etc, and they seem to be compatible and the latest version was installed, no info in the error log too.
  18. nfil

    Hello wanze. I have a datetime field in my page with the Date/Time Output Format Code j/n/y PW outputs the formatted date, yet Pages2Pdf will not render the j/n/y format. Have you tried creating a pdf with a datetime field? Or am I doing something wrong. Thanks. update: I get different results, this was probably due to PW dev 2.4.5 I tested your module with PW 2.5 and seems to be fine.
  19. nfil

    Hello wanze in the second example I was writing it on a tablet and some code was lost. It's a over complicated snippet by a newbie like me to check if a field is empty than render another, also checking if both of these fields are higher or equal to 500000 // image for output $visalogo = $pages->get("/")->logo_eurovisa; // if visavalue_b field is not populated it will show visavalue_a $visavalue_a = $page->price_a; $visavalue_b = $page->price_b; // value is populated and greater than if(empty($visavalue_b)) { $va = $visavalue_a>=500000; if ($va) echo "<img src=\"{$visalogo->url}\" width=\"300\" height=\"176\" />"; } $vb = $visavalue_b>=500000; if ($vb) { echo "<img src=\"{$visalogo->url}\" width=\"300\" height=\"176\" />"; }
  20. nfil

    It should be something like this, count is for numberOfimagesChildren etc but I'm a newbie. // image for output $visalogo = $pages->get("/")->logo_eurovisa; // if visavalue_b field is not populated it will show visavalue_a $visavalue_a = $page->price_a; $visavalue_b = $page->price_b; // value is populated and greater than if(empty($visavalue_b)) { $va = $visavalue_a>=500000; if ($va) echo ""; } $vb = $visavalue_b>=500000; if ($vb) { echo ""; }Sorry for being a bit off topic.
  21. nfil

    I've this image that is printed to the pdf if the value of the field is filled in the backend and its above 500000 but there are two variables, if one is not populated it will go to the next condition and print the value. How do I go about this one? Thanks. // image for output $visalogo = $pages->get("/")->logo_eurovisa; // if visavalue_b field is not populated it will show visavalue_a $visavalue_a = $page->price_a; $visavalue_b = $page->price_b; $count = "count()>1"; // $visavalue_b is populated now check if it is greater than 500000 if ($visavalue_b->($count)>=500000) { echo "<img src=\"{$visalogo->url}\" width=\"300\" height=\"176\" />"; } else { if ($visavalue_a>=500000); { echo "<img src=\"{$visalogo->url}\" width=\"300\" height=\"176\" />"; } }
  22. nfil

    After resting a bit and reading this carefully. it's all here: Thanks Adrian
  23. hi there! I started with the basic PW template and now I have this site tree, it has the categories (apartments, houses etc...) then I have pages that will work as option for the articles, these options are presented in the article as a select input field type. For example objective field name is called option_objective in my article template. root Properties (articles-list-all) - Apartments (articles-parent) -- apartment one (article) -- apartment two - Houses -- house one -- house two Objective (options-template) - Sell - Rent Type of deal (options-template) - Commercial property - Private property Other options (options-template) - other option one ----------------------------------- Page name (template name) To filter and render the results similar to skyscraper's site profile I looked at how selectors work and also at the skycrapper and Macrura's from the speaker's shop example. I can generate the options to select input fields in the frontend but I can't generate the results page. The following is a part of what I have at the moment. I have this part to generate one of the article's option in the search_form.php <option value=''>Any</option> <?php foreach($pages->get("/objective/")->children("id!=1594") as $objective) { $selected = $objective->id == $input->whitelist->objective ? " selected='selected' " : ''; echo "<option$selected value='{$objective->id}'>{$objective->title}</option>"; } Part of the search_results.php $matches = $pages->find("template=article, title|body|objective~=$q, limit=20"); $count = count($matches); echo $out; Thanks in advance for the help.
  24. nfil

    Hello adrian. I'am learning php but I know the .= operator will concatenate the selector variable. lots of tangled code erased---