Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

3 Neutral

About lele_ballack

  • Rank
    Jr. Member

Recent Profile Visitors

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

  1. I have a counter in my homepage that keeps track of different indicators. Some of them are manually inserted in the back end, while some other should be the results of different page count. For example, I have this variable that returns the number of articles: $articles = $pages->find("template=outcome")->count(); And I would like to insert it in the field 'Counting' that's rendered inside the counter in the homepage: <?php foreach ($page->Counter as $counter) { ?> <div class="col-xl-3 col-lg-3 col-md-6"> <div class="counter-wrapper single-counter mb-30"> <div class="counter-icon"> <i class="<?=$counter->Icon?>"></i> </div> <div class="counter-text"> <h3><span class="counter"><?=$counter->Counting?></span><span class="plus-icon">+ </span></h3> <p><?=$counter->Title?></p> </div> </div> </div> <?php } ?> How could I achieve it? How can I pass a variable through a field?
  2. Thanks a lot @Ivan Gretsky! You're right, it was way easier than I thought! It worked like a charm! 🙂
  3. There is something about a search form that I'm unable to solve. My search form has a text input that searches through fields of a specific template: // keyword input if(isset($input->get->q)) { $keyword = $sanitizer->text($input->get('q')); $selector .= "title|Abbreviazione|Sottotitolo|Titolo_Testo.Titolo|Titolo_Testo.Testo~%=$keyword, "; $input->whitelist("q", $keyword); } In this template, there fields are: title, Abbreviazione and Sottotitolo (text fields) and Titolo_Testo (repeater made of text fields Titolo and Testo). When I search any word, it returns the matching pages, but when I reset my form to (or search) an empty value, it only finds pages where the repeater Titolo_Testo is set and filled. How can I instruct it to search for repeaters only if they are set and get all pages results on an empty value search? Or else, is there a way to detect an empty search value as isset still returns true? I'm using PW 3.0.165. Thanks a lot!
  4. Thank you so much @Robin S! Your solution works really well!
  5. Hi everyone, I'm trying to build an index with all the fields' name that belong to a template, excluding those fields that are empty. <?php $i=0; foreach ($page->fields->find('limit=3') as $field) { ++$i;?> <li> <a class="list-item" href="#par-0<?php echo $i;?>" title="<?=$field->name?>"><?=$field->name?></a> </li> <?php } ?> Are there ways to do it in the selector? Thank you 🙂
  6. Thank you so much @kongondo! The tutorial link was pretty clear and this solution works like a charm!
  7. Hi everyone, I'm trying to create an article index using all the heading titles of an article, but haven't succeeded so far. I tried with: foreach ($page->text->h2 as $heading) But I get this: "Notice: Trying to get property 'h2' of non-object" What's the best way to get all the h2 tags inside the textarea? I'm using CKEditor to write the articles. Thank you!
  8. Thanks @kongondo for your quick reply! That worked really well and the warnings disappeared! Just noted that there is small bug though after implementing the new code: the comments counter appears now in the dashboard (title and icons only, without any real counting) even though I chose a blog installation with no comments.
  9. Hi @kongondo I've just installed your module (version 2.4.5 in PW 3.0.148). Upon installing I did select blog style 1 or 2, and in both cases I keep getting this warnings above the dashboard: "Warning: Illegal offset type in ..\site\modules\MarkupBlog\ProcessBlog.module on line 916" "Warning: Illegal offset type in ..\site\modules\MarkupBlog\ProcessBlog.module on line 917" that refer to these two lines: $posts->title => array('published' => $qn['blog-post'], 'unpublished' => $qn['unpublished'] ), $comments->title => array('approved' => $numApproved, 'pending' => $numPending, 'spam' => $numSpam ), How can I remove those warnings? Is there a quick way to fix it? Thanks.
  10. I'm using FieldtypeFontIconPicker (2.0.1) to select icons to insert in my page in PW (3.0.148). It works really well and found it really easy to output icons in the web pages. I'm unable though to see icons while building a page which makes searching for an icon a lot harder. It seems that I can only see the icon class as shown in the picture. Is there anything I can do to be able to select the icon directly? Thanks a lot for your help 😀
  11. Thanks for your feedback @jacmaes, I understand your point. Looking at your link though, one of the possibilities to include Iubenda is 'Direct text embedding' which renders the Iubenda page as embedded in your own page layout. Upon further searches, I realised that the only thing that was amiss from the script I was given is the class 'iub-body-embed' which launches the script automatically when opening the page (instead of rendering a button that opens a modal as you correctly pointed out). In order to be able to launch the script through PW, I had to install the module 'Inputfield ACE Extended' which allows to 'write' Javascript directly into the page. It might be a bit of a overkill, yet I think it looks easier to read when it's embedded in a page of its own, inside the website layout.
  12. I was given this script to be embedded in the body of a page in order to automatically launch and render the destination link when the page is opened. <a href="https://www.iubenda.com/privacy-policy/*****" class="iubenda-white no-brand iubenda-embed" title="Privacy Policy ">Privacy Policy</a> <script type="text/javascript">(function (w,d) {var loader = function () {var s = d.createElement("script"), tag = d.getElementsByTagName("script")[0]; s.src="https://cdn.iubenda.com/iubenda.js"; tag.parentNode.insertBefore(s,tag);}; if(w.addEventListener) {w.addEventListener("load", loader, false);} else if(w.attachEvent){w.attachEvent("onload", loader);} else{w.onload = loader;}})(window, document); </script> How do I include it in PW? I tried using the CKEditor but it just outputs the script without launching it. If I include it in my template in PHP, it renders as a button that once clicked opens a new tab outside of my website instead of having the script being embedded inside my page. Do you have any suggestion about how to make this work?
  13. Thank you @LuisM! I think I'll remove the CKEditor where possible and play with CSS to render the rest of the elements in the same way. I'll definitely keep the reminder for the next projects! 😀
  14. Thank you @teppo! I think you nailed it! If I look into the page source, it happens exactly what you predicted as there is <p> inside my original <p>: <p class="wow fadeInUp animated" data-wow-delay="1.3s"><p>Some text</p></p> I could use your solution replacing the original <p> into a <div>, but I'm wondering if there is another solution as I'm doing a quick job and using a template which means I'd have to change most of CSS around the whole website in this case. Any other way of fixing this?
  15. There is something I can't figure out about about text fields and their position in the HTML code. There is a field which is a multi-language text area with CKEditor called "a_01_text". <p class="wow fadeInUp animated" data-wow-delay="1.3s"><?=$page->a_01_text?></p> After filling the field with "Some text" through PW, the result in HTML code is totally different than what I expected as my text is actually outside of the designated <p>: <p class="wow fadeInUp animated" data-wow-delay="1.3s" style="visibility: visible; animation-delay: 1.3s; animation-name: fadeInUp;"></p> <p>Some text</p> I was getting crazy trying to understand why my CSS rule wouldn't work on this text, until I realised this. It happens only with textareas, not with simple texts. Can anyone please explain why this happens and how I can fix this?
  • Create New...