Jump to content

kongondo

PW-Moderators
  • Posts

    7,480
  • Joined

  • Last visited

  • Days Won

    146

Everything posted by kongondo

  1. Or...if sport is the tag page itself (i.e. it is an item in the page reference field)...then something like this... $sportsPages = $pages->find("tags_page_field=$page");// @note: add a limit if lots of tags and paginate
  2. Maybe start here (regarding headers already sent error) https://stackoverflow.com/questions/8028957/how-to-fix-headers-already-sent-error-in-php
  3. Welcome to the forums @hezmann. Not to overwhelm you with reading, but since you'll be doing employing 'taxonomy', (we generally call them categories and tags here), this might be worth a read:
  4. ProcessWire will not allow you to POST to or call a script (PHP and such) directly if that script is located in one of its protected folders. Hence, the 403 (forbidden). Your options: Throw your script into a template file and post to a page using that template Throw your script into a module and post to that module's page (if backend; otherwise, will still get a 403) include/require once the script in some template file but post to a page using that template (e.g. posting to self as per @psy's suggestion) Etc... Ajax stuff:
  5. You mean JSON? Or Serialized array? Here are a couple of posts (not all may be directly relevant in your case, though).
  6. Hard to tell without seeing the script. Are you sure the script is being loaded at all? Your options (some of which you have tried) Call it in a template file (include or require once). Create a page using the template and POST to that page or if it is a form on the page, POST to self Create a module based on the script. Call the module Create a module whose purpose is to call the script (include or require once) Trying to access the script directly from protected ProcessWire folders will not work, e.g. /site/templates/myscript.php. Could it be a namespace issue? Have you tried to Debug? Tracy?
  7. What @DaveP said...For example: /var/www/html/site /var/www/html/wire /var/www/html/favicon.ico /var/www/html/.htaccess
  8. See this (webroot or rel=icon methods) https://stackoverflow.com/questions/11893478/add-favicon-to-website
  9. Welcome to the forums @Schwab Have a read here about WireArrays. A multi page field returns a PageArray (which is derived from a WireArray). http://processwire.com/api/ref/page-array/ http://processwire.com/api/ref/page-array/add/ http://processwire.com/api/ref/wire-array/ http://processwire.com/api/ref/wire-array/add/ Examples // examples $someOtherPage = $pages->get(1234); $page->your_page_field = $someOtherPage;// @note: not sure it works in all contexts $page->your_page_field->add($someOtherPage); $page->your_page_field->add(1234); // Add multiple pages $page->your_page_field->add($pages->find("template=basic-page"));
  10. As we await your code... $t = $templates->get(45);// don't hardcode; get '45' value from the selector string if($t->name == 'event') { // stuff } // OR $t = $templates->get('event'); if($t->id == 45) { // stuff }
  11. I haven't studied the code but wondering if uploading to a non-web-accessible system directory might help? E.g.
  12. This was my initial thought (in the now edited post) but then I read this from the Hooks docs:
  13. I've never tried it...but I don't see why not it shouldn't work in something like RuntimeMarkup field.
  14. Yes... $noAjax https://github.com/processwire/processwire/blob/57b297fd1d828961b20ef29782012f75957d6886/wire/modules/Inputfield/InputfieldFile/InputfieldFile.module#L17 https://github.com/processwire/processwire/blob/57b297fd1d828961b20ef29782012f75957d6886/wire/modules/Inputfield/InputfieldFile/InputfieldFile.module#L17
  15. Oops. Sorry, I removed my post just as you were responding to it. I noticed you were hooking into saveReady so my response didn't make sense. Ignore me. You'll get better answers .
  16. Images and Files do not have unique identifiers as such. Did you generate the gallery yourself? If yes, then you can assign 'UIDs' yourself. Here are some alternatives: All images have a sort order. You can use that, although, if the order changes, that might distort previous likes count. You can use image names as the UIDs...i.e. the my image_0x260_.jpg Similar to sort, when outputting your images, use a counter $i; $i++; and use that with ProcessWire eq(n) to get the image you want One page for each image. The page ID is the UID. Sorry, I am in a hurry, can't explain further...
  17. What @DaveP said. There are many advantages to that, including changing the image name or the image itself without having to rewrite your code again.. Anyway, if you want to access it like you've mention...other than using raw PHP, you can also do it this way. $config->paths->assets . 'default_wallpaper.png';// if in assets folder $config->paths->templates . 'somefolder/default_wallpaper.png';// if in 'somefolder' in templates folder http://processwire.com/api/variables/config/ Note though, you will not have the $image->methods() doing it like this. But, you can call imageSizer() method directly on your default_wallpaper.png
  18. @Lyndaa, Moderator note I have removed the link from your post. We do not allow links to third parties for first posters. This is to discourage spam (including subtle advertising). In fact, I don't see how your post is related to ProcessWire at all. I will revisit this and remove your post altogether unless you can otherwise show how it is related to ProcessWire.
  19. Change it in your php.ini...if you have access to system files on your server. If not, there are other ways.
  20. @bernhard. I'll move this topic to module development since the other thread will be the support forum for this module. If you wish, we can lock this topic so that all enquiries/comments etc, are directed to the modules main support forum
  21. Something like this? (Exended FieldtypeFile)
  22. @Robin S Excellent, thanks. I will have a look. Do you know if I'll have access to the $field at this point? I.e. the Fieldtype the Inputfield belongs to.
×
×
  • Create New...