Jump to content

Soma

Moderators
  • Posts

    6,798
  • Joined

  • Last visited

  • Days Won

    158

Everything posted by Soma

  1. I had this moment when I discovered pw. WorsePress what is zath?
  2. All the time actually
  3. NO it's stillll early You don't know how to look at js console?
  4. Thaz where inline commenting comes in handy. You do it for that reason. Countless times I watched complex code I wrote years ago and takes me some time to understand it. Like wow I did that? Same with paintings btw.
  5. Looks like the javascript file isn't included or isn't working. It requires jQuery core. Can you make sure the EmailObfuscator.js is included in either before </head> or </body>. There a module setting that allows you to enter those tags yourself. If yes, make sure it is included after jQuery core.
  6. Then it's working everything correctly. But one thing is strange and don't know if it's the mailto: in your link text. I would remove it. I'm looking at the gen code here in PW 2.3 latest dev. <a href="GOSPAM:hc.hcilru@ppilihp"><span style="unicode-bidi:bidi-override; direction: rtl;" class="email-obfuscator-unreverse">hc.hcilru@ppilihp</span></a> And on the page it's the correct decoded text via javascript. If I click it it opens email address in mail client correctly.
  7. You think there's no hope, but every coder struggles with it. So to say it's THE hardest part of coding.
  8. One thing would be including a functions.php in your templates. $footer_settings = "/settings/footer-settings/"; function getFooterTheme($p){ return wire("pages")->get($p)->block_footer_boxes_repeater->block_select->block_theme_select->block_class; } Then use it in templates with echo getFooterTheme($footer_settings); or function getFooterTheme($p){ return wire("pages")->get($p)->block_footer_boxes_repeater->block_select->block_theme_select; } and use it like this echo getFooterTheme($footer_settings)->block_class; I'm not sure what your needs are but if you see you're using a function or long call multiple times it makes sense to have a function or module that helps clean out your templates. I don't think the chained call is too much, but you also have long names. But as you say image what it would take in any other System to get to the data in a call like this.
  9. Lol How about having some helper function to get you the values more easy?
  10. Yeah I remember that there was something with the colorpicker, and I forgot it even you send me a personal message. But it's always better to stick as much as possible to some thread topic, as it could make it easier to search for them. So many great hidden infos get lost because it's in a unrelated thread. My head just exploded. Seriously
  11. Hey Joss, thanks for the report! I just commited an update that may fix your issue, even though I don't know what it is. I haven't tried with repeater until now, and I couldn't even open the page as It throws a fatal error. In the last implementation of the default value feature it seems it was not compatible with repeaters. ** 1.0.4 ** - fixed bug with use in repeater
  12. I love selfsupport About the Colorpicker, are you using the 3rd party module? How about reporting an issue in the Colorpicker module thread so the guy who does maintain it can fix it? http://processwire.com/talk/topic/865-colorpicker/
  13. You could also have a template "redirect" with only a title and a page field (single page) to select any page you want to go. Then in the code you should be able to write array('item_tpl' => '<a href="{redirect_page|url}">{title}</a>') So it would take the url of the referenced page in the page field if found, or if not it takes the url of the page itself. Assuming the page field is named "redirect_page". Haven't tried but should work. EDIT: This wasn't really working until added support for page field url in version 1.1.8.
  14. It's working fine here in all PW versions. It's not much there's that could conflict with anything in PW. Does the javascript get inserted correctly? Just to clarify, if you look in console you won't see the reversed email at all, you have to look at source code to see the reversed.
  15. I get the idea, but have hard time to see a good use case or the clear benefits. I think I get the point but hardly felt need to share templates between languages. Care to elaborate a little more with some real examples or resources where this comes into play?
  16. Theres also a max width height setting to use to resize larger uploaded images if they're bigger.
  17. Like this $out = sprintf($this->_("Created %d pages."), $count); for within modules.
  18. Ok I thought there maybe a way to construct PageArray's. You can't alter the children built in property I think as it is in fact a method to retrieve the children from the DB on runtime using selectors $page->children($selector), but you could add a custom value on runtime memory and make it another PageArray. Then add some children to it. Since you can't use "children" just have to name it different for example "mychildren" and it works. You can also then use all the PageArray methods on them as ususal. You will just have still the children() and parent(), siblings() etc available but they would be in the original context of where the page originally is and not in your pseudo PageArray. Here's a test script might useful for many others too. // note just simple test pseudo code // base array object $pa = new PageArray(); // get some pages to work with $category = $pages->get("/templates/"); $about = $pages->get("/about/"); $home = $pages->get("/"); // add new PageArray property "mychildren" $category->mychildren = new PageArray(); // add other pages in $category->mychildren->add($about); $category->mychildren->add($home); // you can sort them $category->mychildren->sort("-created"); // add the $category to the base array $pa->add($category); // output the nested PageArray using mychildren echo "<ul>"; foreach($pa as $p){ echo "<li><a href='$p->url'>$p->title</a>"; echo "<ul>"; foreach($p->mychildren as $child){ echo "<li><a href='$child->url'>$child->title</a></li>"; } echo "</ul>"; } echo "</li></ul>"; Gives a nested list: Templates About 2 Home
  19. Thanks for posting this. Just wanted to say that you don't need to include all core and install files. Just the template and module folder would suffice. Or if you want you can use Profile Exporter module to export the setup as an install.
  20. No, again you can't add children or have parents on a self created PageArray or WireArray. For the other thing I think there's some easy solution, just can't make any sense atm with those sub categories... however to get it to work I think you can simply check against all children of the category. if($children = $pages->find("template=offer,product_category={$category->children}")){ ...
  21. I wanted to add that both Page List Label modules copied my modules method resizeThumb(), which is only there to resize "FieldtypeCropImage" thumbnails (3rd party module) thus it's using another format for naming. Normal PW images get resized using normal $image->size(0,100) method. Edit: thumbnails created by FieldTypeCropImage also still doesn't get deleted when the image is removed from page so I didn't bother about their naming too there.
  22. You can't have "children" or "parents" in a Page or WireArray. It's a one dimensional thing. You could create your own 2 dimensional array storing the id's and then iterate that to create the navigation. You could create the navigation directly from the categories and list pages that belong to the current category. I'm not sure about your menu example, as I don't see where the products are and such, it's just the categories as is. So without really see all context and needs according to your code I would do it like this. $navcode = '<ul>'; foreach($categories as $category) { $navcode .= "<li>$category->title"; if($children = $pages->find("template=offer,product_category=$category")){ $navcode .= "<ul>"; foreach($children as $offer) { $class ($offer === $page) ? " class='active'" : ''; $navcode .= "<li$class><a href='$offer->url'>$offer->title</a></li>"; } $navcode .= "</ul>"; } $navcode .= "</li>"; } $navcode .= "</ul>"; $nav->set('navcode', $navcode);
  23. I don't see any abuse here. $config is a good way to do it, it's there for such things.
×
×
  • Create New...