Jump to content

Soma

Moderators
  • Posts

    6,808
  • Joined

  • Last visited

  • Days Won

    159

Everything posted by Soma

  1. It's also possible to add a language pack to the default language, then have english as a secondary.
  2. Huh, why don't you also use MarkupSimpleNavigation with a little smile You can also include hidden pages if you add the selector "include=hidden". If that helps.
  3. Yeah it's a bug, thanks for finding it. Should be fixed in the last commit. Let me know if it works for you too.
  4. copied from the wire/modules/Fieldtype/FieldtypeComments/Comment.php /** * Status for Comment identified as spam * */ const statusSpam = -2; /** * Status for Comment pending review * */ const statusPending = 0; /** * Status for Comment that's been approved * */ const statusApproved = 1;
  5. .... and show us a screen shot of the module' config screen...
  6. Then your comments field is named different. Double check if the comments field is named same as what is set in the module configuration screen. I just installed and works well diogo. Nice work here. Could be improved to maybe even approve them directly on the admin page.
  7. I'd guess your pages are hidden or unpublished (not likely)... I would try making it $p = wire('pages')->find("$field.status=0, include=all");
  8. You can't simply add plugins to TinyMCE without touching the core yet. Though I did add additional options for third-party plugin, but Ryan still needs to implement this. A pull request is there.
  9. What did you modify if I might ask?
  10. That's what can be done with this module pretty easily. if($page->template == "home"){ $options = array( 'max_levels' => 2, 'show_root' => true ); echo $treeMenu->render($options); } https://github.com/somatonic/MarkupSimpleNavigation/wiki/MarkupSimpleNavigation-Documentation
  11. Sorry to disrupt you discussion. Why not simply use https://github.com/somatonic/MarkupSimpleNavigation ?
  12. I just commited a fix to this module causing some issues with a not well formed span tag. I noticed when I got problems with it adding other markup using hooks to inputfields. I've seen some people using this module so I thought I'd make a note .
  13. I quickly looked into it and created an additional hook for what you might after. There's my other already created ones you can also test and comment it if not needed. It's a snippet I just posted here https://gist.github.com/2878361 Uncomment unwanted hooks int he init() method of the module. The third hook... $this->addHookAfter("InputfieldPageListSelect::render", $this, "findRelated"); does look for any pages that has the current edited page selected in a page select field. You can specify what field you want to attach it in the function findRelated(): $field_filter = "select_architect"; Let me know if it works for you.
  14. This is possible with a simple module that hooks us in after the page "save", then retrieve the page object so you can check for it's template. You can find an example module in your site/modules/HelloWorld.module and look at the hooks and the example2() function. There you also see other examples of hooks. If you're into PW's API it's quite simple as it's the same as if you would code template code, just a different context and maybe more advanced. I don't think there's also a "onfirst" save event that could be hooked. So what you want to have, is a check for if the two pages are already created under the page and omit the creation of the two children pages.
  15. Actually I'm recently working on a module that lists links to selected pages on a page field when on edit page after saving. Doing something else would be quite easy with one of the above methods. I'll have to pick it up see what I can share.
  16. Just rewrote my previous post multiple times... lol. Got little confused.
  17. Just went through this old thread and noticed that there's no link or note here that there is a module for this already. I created the PageEditSoftLock module for this particular problem, with a little help of Ryan to get easy starting. I got it installed in all our PW projects and it won't lock the page completely (still editable) but throw a fat red message and a js alert. It workes very well and has been a saver already a couple times preventing two people editing the same page. It has been released here: http://processwire.c...edit-soft-lock/
  18. Not sure if I understand right. Edit: If page field is limited to one page max you could also do this if($page->related->related === $page){ // related page has this page also referenced } else { // it's not } Edit2: corrected a previous example if multiple page field with better example if(count($page->related)){ foreach($page->related as $rel){ // check recursively if one of the related pages has this page in it's related pages if($rel->related->has($page)){ echo "<li>$rel->title</li>";// related page has this page also referenced } else { // it's not } } }
  19. This "bug" has already been reported by me in the repeater thread, though nobody seems to recognized or understand it. Thx for bringing this up
  20. Thanks! Tested and it works. Pagination also works. Yeah that makes sense looking at how you did it.
  21. Have you tried in deeper levels too? I can't get it to work with anything deeper than 1st level. like /en/template/page1/[s1]/[s2] I can't solve it right now, too tired. Edit: I think found that the "$parent = $page" for temporary saving if page is not found is causing the issue. My bad, was my fault coding it this way.
  22. mcmorry, the code I started for urlSegments remapping is completely wrong logik. Hope you get it. I figured that you simply need to add a counter everytime a page is found, to then, after the foreach, unset them by this count. Also I found that with this method you'd better remove urlSegments if the page requested was resolved without any segments. Or it will still have urlSegments from the language root page... Let me know if I can help in anyway.
  23. Made a little update to this module. I strongly encourage to update with the latest version. - unfortunately it stoped working in the latest PW since script/css version (..script.js?v=100) in the admin were introduced (1,5 months?). Since I have to manually str_replace the script tag into the header right after jquery core js, it failed because the string is now different :/. Changed it to use replace on another location/part of the code which will hopefully stay there. - added the admin root path to the script url, so it now also works on PW installed in a subdir. - added script versioning appended to file name ..?v=101.
  24. Thanks Ryan. Yes reindex. I implemented a unset function in the WireInput to test this, and I get unexpected behavior if the page is a subpage which both use urlSegments. Not sure whats causing it , or if its the default behavior or not, I need to make some more tests. Maybe it's my code in the module causing it. basic-page (urlSegments enabled) Parent (basic-page) Child (basic-page) if on Child it will include it in segments. /parent/child/segment1/ it will be segment1 = child segment2 = segment1
  25. I just tried to extend the WireInput, but no luck, as I don't understand it completely. Yeah it could also be a method added to page. PS: Yes you can in the config.php. $config->maxUrlSegments = 4
×
×
  • Create New...