Jump to content

Pixrael

Members
  • Posts

    395
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Pixrael

  1. Hi guys! What do you think about something like this? Because I use this option regularly in the Windows File Explorer breadcrumb and it's very useful. The drop-down menu can display only published/visible child pages. I've tried to find how to do it as a module, but I'm not a coder with enough skills for that ... or I don't know if I can use hooks to do that ...
  2. check this too: https://www.fastcomet.com/ (https://www.fastcomet.com/processwire-hosting)
  3. I think you can do this with your own function with a str_replace inside and passing the field string and the values array like in this post from @Macrura https://processwire.com/talk/topic/12969-intermediate-template-structure-without-string-concatenation/?do=findComment&comment=117616 in your case the variable $tpl is filled with the content of your field instead of file_get_contents
  4. As I understand based on documentation should do the same <div id="foo" pw-prepend> = <div pw-prepend="foo">
  5. https://processwire.com/blog/posts/processwire-3.0.62-and-more-on-markup-regions/#actions-for-populating-regions
  6. you can try this: <body pw-append='html-body' class='bgimage'></body> and leave empty the DIV maybe should add only the class
  7. Ooooh my fault!! ..the original code (the first) works, the problem is that my child pages was unpublished and children() filter it.. you last code don't work.. but thanks a lot!
  8. I try it but in the Field setting page I get this error: ProcessField: Method Page::getForPage does not exist or is not callable in this context and in the Page edit i get this: InputfieldRepeaterMatrix: Repeater 'layouts_main' preload 'page_list': Method Page::getForPage does not exist or is not callable in this context
  9. I have a Page Reference Field and I need to select only the children pages of the current page where the field is edited. But the problem here is that the field is inside a Repeater, and the repeaters are actually another pages in the tree.. so where I can do easily using a custom code in ready.php like this: $wire->addHookAfter('InputfieldPage::getSelectablePages', function($event) { if($event->object->hasField == 'page_list') { $event->return = $event->arguments('page')->children; } }); this don't work If the field is inside a Repeater.. I need to get the related page to the current repeater page to get the children, but how to do it?
  10. ..or if you want realtime search results, maybe you can try this: https://www.algolia.com/product ( I'm not an affiliate or promo agent )
  11. I always use the Markup Region since it was included in PW .. thanks for your advice, thanks for everything guys, this community is really like a home with friends
  12. I agree with bernhard that this situation is perfect for an ajax solution, but in the parent page I use a javascript plugin that need the markup from the child pages is present in the html output at document ready, not in the dom
  13. abdus: This don't works, if we generated the url segment links with: "./$page->name" we never found that page with: $codeChildName = "code--{$input->urlSegment1}" $pages("name=$codeChildName") because the page with that name doesn't exist but looking at your proposal I found one solution: add a "keyword" to the generated links and then remove that "keyword" after get that url segment.. works perfect! this at the start of my template file: <?php namespace ProcessWire; $wildcard = "-list"; if($input->urlSegment2) throw new Wire404Exception(); if($input->urlSegment1) { $request = $input->urlSegment1; } if($request) { $name = str_replace($wildcard,"",$request); $name = $sanitizer->pageName($name); $codes_page = $pages->get("name=$name"); if(!$codes_page->id) throw new Wire404Exception(); } else { $codes_page = $page->child("include=all"); } ?> then when I generated the links in the template: <?php foreach($page->children("include=all") as $child) { ?> <a href="<?=$child->name.$wildcard?>"><?=$child->title?></a> <?php } ?> and that's all.. it's ok? remember that I'm a graphic designer trying to coding
  14. Abdus: the problem is that in the parent page I generate the links automatic from the name of the child pages, so the links always match the children names.. even if I add "code--" using the API because when I save the page, and later generate the parent page again the links will include "code--".. the only solution is to use a field other than the name ... ID is the best option because is url friendly.. Abdus: Thanks for your contributions to this forum, you are the best teacher for newbies like me, every post of yours seems a tutorial. It's easier to learn new things in them than with the PW documentation.
  15. ... Ooooh. I forgot it.. I'm in Florida (Waiting for the big hurricane uff) ... but is ok, maybe I don't have other solution than the IDs.. and I don't want to my editors to put the information in another place on the page tree when they should be under codes node... So, the last shoot.. the scenario is: Codes (template file) -- Wall Mount (template without file) -- Light Commercial (same as above) Initially Codes render its content (header, body, etc) plus the information of the first child (repeaters with body, pictures, etc) Codes also have a list of links that was generated from its children name as url segments, to load the same Codes page, but with the content from the new selected child .. uff seems more easier to see than to explain ! EDIT: this post should be before the previous from abdus, I delay in publishing it
  16. my path will change from: domain.com/support/codes/wall-mount-mini-split domain.com/support/codes/light-commercial-split to domain.com/support/codes/1087 domain.com/support/codes/1101
  17. abdus: I think your solution don't resolve my problem, I'm still have the match between both urls (segment and existing page), this option only allow me to auto generate the children names, this is not my case. bernhard: this is a correct solution, in the first instance I not use it because the SEO.. maybe I need to use it.. :-( Another solution should be put the "child pages" under another parent (empty template) only for hold it and to avoid conflicts Thanks guys for your time!
  18. I found why :-( https://processwire.com/docs/tutorials/how-to-use-url-segments/page2 "You can use URL segments on any page where your template settings allow, regardless of whether it has children or not. Should there be a child page that has the same name as a URL segment that the parent page's template is looking for, the pages in the tree always have precedence. Meaning, URL segments only apply if the requested URL did not resolve to an actual page. As a result, you should avoid using URL segments where you think the page names and URL segments could collide"
  19. I have a parent page (with template file) with several child pages (without template file) that are hidden and unpublished, I use them only to store information. The parent page have the url segments enabled. When I catch the segment in the template file, works as expected for any word, but if the url segment match the property "name" of any child page, PW launch a 404 Page Not Found.. I try all combination of "hidden" and "Publish" for the child pages. The idea is to render the data from the parent page plus the data of a child page, and get this data using an url segment (links generated dynamically) with the same name that this hidden page have.. I don't like having a template file for these child pages that only execute the render of the parent page with the information .. I want the previous solution if it possible I was able to explain well? ...What happen here?
  20. Yes, I know, but what I need is to insert the images into CKEditor, it looks like I'm finally going to have to do a hanna code for that. Thanks anyway
  21. why webp still is a invalid file extension?? No make sense for me if I only need to use the url to the file in my pages, I'm not processing the image data.. only print the path
  22. It works, but applies the classes to all inputfields, including the form and buttons. Is there any way to ask the type of input (Ex. InputfieldText) before applying the classes? I check the API Reference for inputfield but nothing..
  23. Good job! Maybe you could use bold in the links of the footer, because is not very readable. I like this style!
  24. I like the second solution, I will implement it later. Thank you!
  25. Since I haven't received answers, I add the code directly in the module (I know is bad but I need to finish) Line 264: $inputfield->attr('class','form-control'); It would be great if this option was in the configuration as well as the current option for the Send button
×
×
  • Create New...