Jump to content

elabx

Members
  • Content Count

    718
  • Joined

  • Last visited

  • Days Won

    5

elabx last won the day on June 25

elabx had the most liked content!

Community Reputation

747 Excellent

About elabx

  • Rank
    Hero Member
  • Birthday 04/12/1988

Profile Information

  • Gender
    Male
  • Location
    Mexico City

Recent Profile Visitors

8,525 profile views
  1. Did you try adding a pagination variable to the ajax call to alter the selector that gets the content?
  2. 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"
  3. 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.
  4. 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.
  5. I THINK, you'd probably need to hook here. Does the subfield dot notation does not work?
  6. There is a setting in the Input tab, where you can set the year range!
  7. 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:
  8. 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; } });
  9. 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.
  10. Definitely take a look at RockFinder3 along Rock2Tabulator.
  11. 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
  12. 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
  13. 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); } }
  14. 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 }
  15. Is this meant to work on the frontend templates or on the processwire admin?
×
×
  • Create New...