Jump to content

elabx

Members
  • Posts

    1,303
  • Joined

  • Last visited

  • Days Won

    16

Everything posted by elabx

  1. Just curious, what are you using from ProcessWire that is useful for your project?
  2. Check to have pagination enabled in the template where your are rendering the pager. https://processwire.com/docs/front-end/markup-pager-nav/
  3. If you are going to retrieve them using find() you will have to use check access, another possibility I can think of tight now is: $pages->find('template=series')->explode('products'); But I guess not as practical because it returns an array of WireArrays.
  4. Repeaters are pages placed under the admin which users of role "guest" cannot access due to the way access control works. It's a bit confusing because you don't think of repeater elements as pages per se, but since they actually are that, the same rules as for the rest of the pages apply, they are kind of "admin pages" Hope I made myself clear!
  5. Namespace issue?? Try adding namespace ProcessWire at the very top
  6. You can go into the parent page of the branch you wish to sort, and on the Children tab, you should see the sorting setting.
  7. So I basically meant like I felt it needs a bit more of a well thought structure to make it more maintainable for the future (and I think it had some missing parts? can't remember). I have had to give maintenance to other projects *cough* Recurme *cough* and although that one was particularly complex, I learned my lesson that I definitely don't want to release MVP's that turn into a pain to maintain later just for the sake of getting it out there, I might be just wrong of course. (joshua always insisted I was too conservative in this aspect haha) I agree some of the features could be taken off, like the editor and widgets. I also remember some bits were missing to make it fully functional at the point we envisioned, I think a bit of stuff with repeaters/repeater matrix, don't remember now honestly but it indeed works for the most part! We really feel it shows a lot of the power ProcessWire "hides"!
  8. How is your inputfield's formatted value configured? try setting it to be formatted as a single item.
  9. Try calling wire('pages') instead of $pages.
  10. Did you try adding a pagination variable to the ajax call to alter the selector that gets the content?
  11. Could you share some code? This is a good guess. You need to keep track of your pagination somewhere and pass it to the selector like "text%=$q, start=$currentPage, limit=10"
  12. What I've done is write a php script that I run from the command line to avoid memory/execution timeout issues. I also always use PHP League's CSV library which iterates the CSV without loading it all into memory.
  13. For what I see it appears to be loading the ogv or webm versions and they seem to be encoded like that, try removing the other files and leave mp4.
  14. I THINK, you'd probably need to hook here. Does the subfield dot notation does not work?
  15. There is a setting in the Input tab, where you can set the year range!
  16. This is one of the most common solutions, but as in everything with PW, it's your call how you do it! What you could do with your approach is place that php script outside of the sites directory which is protected by apache from being accessed directly for security reasons. So on your ajax request, the url is just /archive-list-render.php?q=etc Now, on you archive-list-render.php, load the PW API: <?php //This is the index.php in the web root directory, sibling to site, wire, etc. include("./index.php"); $q = $sanitizer->text($input->get('q')) $foundPages = $pages->find("somfield=$q"); //imaginary doSomethingWithPages method.. $response = doSomethingWithPages($foundPages); echo $response; Another approach for simple cases is using the same page where the ajax requests originates from, and detect if it's an ajax call otherwise render the site. This can get tricky depending on appending or prepending files into the template. (Very well exemplified on Ryan's post bellow) <?php if($config->ajax){ //ajax processing/render stuff } else{ //normal render stuff } Ryan's post:
  17. I know you asked for a configuration but, maybe hook here? <?php $wire->addHookAfter('ProcessPageAdd::getAllowedTemplates', function($e){ $templates = $e->return; $specialTemplate = wire('template')->get('specialOne'); $parent = $pages->get(wire('input')->get->parent_id); if($parent->template != "sub"){ unset($specialTemplate->id, $templates); $e->return = $templates; } });
  18. Reading more on your project I think this is the right way to do it, RockFinder and RockGrid are very oriented in display the data in one shot using the browser for what I understand. You shouldn't really have that much issues using the built in pagination. I have a project where I paginate about 2 million pages and works (not blazing fast) but it does work at a reasonable speed. As @horst suggests, ProCache makes a whole world of difference too.
  19. Definitely take a look at RockFinder3 along Rock2Tabulator.
  20. Set the form's select field's name to "tag[]" so the inputs are put in an array. Then $input->get->tag should return an array. I'm still not very sure in your code where you are doing the search for tags but you seem to be very close ? As for the selectize, "on load" values: https://github.com/selectize/selectize.js/issues/236#issuecomment-73763003
  21. On your first if statement you are checking for a URL segment, not a GET variable. Should be like this for GET variables: if($input->get->tag){ // find with tag } else{ //find all } To select one or more tags you basically need to submit a form with the tag selection using a select field with multiple attribute enabled. Or if you need something more fancy, check selectize: https://codepen.io/i_cant_rap/pen/qNdXyj
  22. Are you sure the $input->get variable is set? Is this code executing on form submission? Otherwise, it won't work because the $input->get->tag variable won't be filled. Second on this loop: foreach($found as $image){ ... } $image is not an image object, it's a page object, $found is an array (more precisely, a PageArray) of pages. Check again this code: foreach($found as $p){ $imagesWithTag = $p->images->findTag($tag); foreach($imagesWithTag as $image){ //this is now possible $image->size(100,100); } }
  23. The image field have a builtin tag field, activate it on the field config. Well you could approach this by setting a form with a select input with the possible categories, then on the backend: <?php //form submits to domain.com/search/?tag=sometag $tag = $input->get->text('tag'); //All pages with image field and certain tag $found = $pages->find("images.tags~=$tag"); foreach($found as $p){ $imagesWithTag = $p->images->findTag($tag); //do your stuff }
  24. Is this meant to work on the frontend templates or on the processwire admin?
×
×
  • Create New...