Jump to content

a-ok

Members
  • Posts

    812
  • Joined

  • Last visited

Everything posted by a-ok

  1. Sorry to bring this old thread up but felt it was better than posting a new one? Maybe not. Anyway... I'm having a similar issue when it comes to searching a textarea field in a repeaterMatrix. $fieldsToSearch = 'name|title|text|textA|textarea|projectsCategories.title|projectsClients.title|aboutPressCategories.title|aboutPressClients.title'; $templatesToSearch = 'projectsSingle|shopSingle|typeSingle|typeCustomSingle|typeCustomSingleB|aboutPressSingle|repeater_modulesA'; $results = $pages->find("$fieldsToSearch%=$searchQuery, template=$templatesToSearch, sort=sort, check_access=0"); This is all working but it doesn't seem to include the repeaterMatrix field `modulesA` in the search as when I search for a word that is within the `repeater_modulesA` template within the field `textarea` it doesn't return the page. If it did I would then need to check the returned item's template and return the `getForPage()` to link to the page it's on. Any thoughts on why it's not returning anything?
  2. Is there a selector operator, or similar, that matches spelling mistakes? I know there is MySQL soundex() function for comparing phonetically https://dev.mysql.com/doc/refman/5.7/en/string-functions.html#function_soundex I am in need of something for a search page. Any thoughts? EDIT I just found this post: https://processwire.com/talk/topic/7938-sounds-like-soundex-operator/ but wondered if there was an update on this?
  3. @Mike Rockett Sorry in advance if this is a bit of a stupid question but if I've set up a Jumplink with the source `chance-to-dance[/]` and on Facebook when the link is shared they prepend it with `.co.uk/chance-to-dance?fbclid=IwAR2b4gQ1Nixtk_w2qVyfxD7WYZIgp8kHtP46qgfTCDKiuozXw4TKxx4CLyw` and now it 404s – how do I set the source to include this sort of thing?
  4. I'm sorry it's taken me ages to get back to this! Thanks so much @Robin S – I went with the first option but I'm unsure whether the third option is the best. Any preference from your end?
  5. Thanks so much, @Robin S ? Can I ask what you mean by the quoted text? Are you saying that if it's updated regularly then it'll need to use a cache-busting query string? Thanks @joer80 also! This is also a great idea!
  6. Pretty sure this is a daft question but thought I’d ask anyway! Is it possible to include data from PW into a .css file? I have a client adding some webfonts via the admin but don’t want them to be added as <style></style> tags and rather within a separate .css file? I basically want to make finding the webfonts a little harder! Any thoughts?
  7. I'm struggling working out how to set the Import/Export fieldsets to the top. Anyone got any idea?
  8. Aiming to do this this weekend. I had another question. Is it possible to configure whether the inputfields for Import and Export are added to the bottom or the top of the PageTable? It currently does this: $inputfields->add($fieldset); return $event->return .= $inputfields->render(); Which simply concats it to the end, but I wonder if there's an alternative? If the PageTable gets long having to scroll to bottom for the Import/Export isn't fun so maybe a configurable option?
  9. Sorry to bring this back up but I'm still having issues. I looked at the module at how it's grabbing the feed and tested it in a Tracy console and it returned false... $http = new WireHttp(); $xmlData = $http->get("https://insidemodernism.co.uk/feed/"); $rss = simplexml_load_string($xmlData); bdb($rss); Any further thoughts?
  10. @adrian I really appreciate a reply from the main man himself. Your solution sounds good given the situation. I ended up adding a margin top to both the fieldsets in the end, which maybe breaks some of the visual style of the expanded fields, and added margin bottom to the import/export buttons. I also changed the first row names to labels for the export. This is silly stuff; the main thing is the module, which works great and really thankful for the contribution. So thanks! ????
  11. I'm needing to add a class `uk-grid-margin` to a `ul.Inputfields` in the admin for @adrian's TableCsvImportExport module https://github.com/adrianbj/TableCsvImportExport/blob/master/TableCsvImportExport.module.php I thought adding `$fieldset->addClass('foobar', 'Inputfields');` would work but it doesn't. I've tried adding this directly to the `$inputfields = new InputfieldWrapper();` also. Any thought if this is possible? See screenshots as a helper.
  12. Ah okay. In my /ajax/ I am doing some server side stuff (adding the form data to a ProTable as we discussed) so this is why I was initially confused.
  13. I did think this. Need to try again shortly. I’m basically posting form data to a page /ajax/ which is returning wireSendFile() if it meets the right requirements. Would it work in this respect? I’m assuming so?
  14. Thanks ? I'm trying to use it but getting some odd errors/returns. Been testing it directly in TracyDebugger's console and it doesn't download anything. Code has been failing for me all over the place today though; lockdown meltdown.
  15. I'm looking to try to use the Processwire API to download the file: $pressDownload = $pages->get(1078)->pressDownload->filename(); wireSendFile($pressDownload, array('forceDownload' => true, 'exit' => false)); Is this possible or do I need to use the PHP method as demonstrated by @MoritzLost?
  16. @MoritzLost Thank you! I really appreciate your help and advice here. This all sounds good. I'll begin!
  17. I'm a fan of FormBuilder, but it's a bit overkill for what I need to do. I'm looking to have a simple email and password form set on a page; the password would be tied to a field in the CMS. It would just be a plain text field. Upon submission a file would automatically download (file located on the same page where the plain text password is set) and then the email address and timestamp would be sent to an entries list (similar to FormBuilder's). My question is... how possible is this without FormBuilder? If I was to create an 'entries' list of the submitted data on a page in the CMS; what's the best field to hook into to allow for this? Repeater seems a bit over the top? PageTable? Exporting? Or would you just use the FormBuilder? Or is there a way to have a custom form but send the data to a form within FormBuilder? Any advice would be great.
  18. Turns out getNext() works on the pageField whereas next isn’t contextually aware (so it gets the next item in the parent rather than in the pageField)
  19. I'm attempting to set up a 'NEXT PROJECT' link which is based on which category a project is in; so depending if the user accesses the project directly, or from the category page, the 'NEXT PROJECT' link should be based on either the next project in general OR the next project in that category. Projects are all entered under one tree and categories on another then I'm using a pageField to connect them. My question. Is there a way to get the next item (or first if the current item is last) from the current project's position in the pageField? I can get the pageField from the category page (which has all the projects) but I'm struggling to work out how I can find the project's position in that pageField then return either the next or first project in the list. Any thoughts? I tried searching the pageField for the current project but then all that does it return the project as a page and not within the pageField. Thanks in advance.
  20. Would you just add at the bottom, or create a new section '5B' or something so it keeps everything tidy or avoid this so you know what is yours/PWs standard?
  21. Thanks very much for the help everyone. Hopefully this'll help others too so much appreciated. This is what I ended up with (went with @Robin S's solution in the end). MUCH appreciated help @BitPoet ? // Add annotations as anchor options within text $wire->addHookBefore('ProcessPageEditLink::execute', function(HookEvent $event) { $page = wire('pages')->get(wire('input')->get('id')); if ($page->template->name !== 'projectsSingle') return; $input = $event->wire('input'); $anchors = $input->get->anchors ? : []; $annotations = array(); foreach ($page->textAnnotations as $key => $annotation) { $annotationClean = 'annotation-' . wire('sanitizer')->pageName($annotation->id); $annotations[$annotationClean] = $annotation->text; } $anchors = array_merge($anchors, array_keys($annotations)); $input->get->anchors = $anchors; // $event->wire()->addHookBefore('InputfieldSelect::render', function(HookEvent $event) use ($annotations) { $inputfield = $event->object; if ($inputfield->name !== 'link_page_anchor') return; $options = $inputfield->options; $inputfield->options = []; foreach ($options as $option) { $anchorName = ltrim($option, '#'); if (isset($annotations[$anchorName])) {; $inputfield->addOption($option, $annotations[$anchorName]); } else { $inputfield->addOption($option); } } }); });
  22. I want to add disabling of hot-linking for webfonts to the .htaccess file but I kinda don't want to 'mess' with the one that comes with PW. What would you suggest? Does anyone else do specific .htaccess additions without adjusting the original PW version? Or am I just being silly? RewriteEngine On # RewriteCond %{HTTP_REFERER} !^http(.?)://(.+\.)?yourdomain\.com/ [NC] # RewriteRule .*\.(woff|ttf|eot|svg|php)$ - [F] AddType application/vnd.ms-fontobject .eot AddType application/x-font-woff .woff AddType font/ttf .ttf AddType image/svg+xml .svg AddType text/css .css <FilesMatch "\.(woff|ttf|svg|eot|css)$"> <IfModule mod_headers.c> Header set Access-Control-Allow-Origin "*" </IfModule> </FilesMatch>
×
×
  • Create New...