Jump to content

Jason Huck

Members
  • Content Count

    127
  • Joined

  • Last visited

Everything posted by Jason Huck

  1. I'm getting a 404 response when I hit mydomain.com/sitemap.xml. The sitemap data is there, and there are no errors. I understand that the module works by hooking into the 404 page, but I also see in the module code that the header is explicitly being reset to 200. This is an issue because Google Webmaster Tools won't accept the sitemap due to the 404 header. Any suggestions on how to debug this? I assume no one else is having this issue, so it's probably something unique with my setup, rather than an issue with the module itself, though I am not doing anything in my code to override the HTTP response code, to the best of my knowledge.
  2. Thanks for the suggestions. I looked at the built-in field-level export/import (didn't even know that existed) as well as the Migrator module, but ultimately ended up syncing everything with Navicat. In this particular case there was very little data that differed on production that needed to be preserved, and most of that was self contained in its own tables (e.g., FormBuilder forms and entries), so it wasn't that difficult to isolate. I will keep these other options in mind for the future when circumstances might be different.
  3. I've got a large number of new field definitions and associated data in a development site, all of which needs to be deployed to a site that's already live in production. I know I can export/import the field data via CSV, but I'd also like to avoid the laborious process of manually recreating all of the field definitions. Looking at the database schema, it seems like I could do a structural sync (e.g., using a tool like Navicat) to add empty versions of all of the new per-field tables ("field_myfieldname"), then sync the data in the following tables: fieldgroups fieldgroups_fields fields fieldtype_options It looks like that would recreate the structure. I wouldn't sync the actual field data that way, as it looks like an easy way to get ID mismatches. I can test this on a copy of the database, but thought I'd get opinions here. Seem like a reasonable approach, or bad idea (because...)? Thanks, Jason
  4. A custom input field that accepted scientific/decimal notation and properly round-tripped it to the database would be pretty handy. It'd be nice to be able to input, e.g., "1*10^16" instead of "10000000000000000."
  5. +1. Clients don't know the difference between baseline and progressive JPEGs, they just upload whatever they've got and then call when it doesn't work.
  6. FYI, we have observed that if the source image is a progressive JPEG, crops created by this module will always start at 0,0 (the top left corner), regardless of the position specified by the user when creating the crop. Re-exporting the source images as regular, non-progressive JPEGs allows them to be cropped correctly.
  7. Does anyone happen to have a language pack for Danish? I don't see one in the Language Packs forum or the corresponding area in the docs/modules portion of this site. Sorry if I just missed it. Thanks, Jason
  8. Since ->render is just another string, overriding an individual field value like ->seo_image doesn't change it. The only options appear to be (a) generating the markup myself using all of the individual field values (thus not using ->render at all), or (b) operating directly on the value of ->render, e.g. via regex. Although (a) is the more flexible, future-proof option, at the moment I am using (b). If a future version of the module changes the markup, or I need more flexibility, I'll revisit it.
  9. Sorry for the cross-post, wasn't sure if my question was module-specific or more of a general api question. Sounds like the answer is "no", since ->render is pre-rendered. Thanks!
  10. Is it possible to reassign field values from within a template? Not save back to the database, just override in memory. I'm using the MarkupSEO module, and want to use its built-in ->render function, but I want to tweak some values first, e.g.: $page->seo->{"og:image"} = '/path/to/image.png'; $page->seo->render; Possible?
  11. I may have missed this, but is there any way to override a value at runtime, prior to calling ->render? I'd like to programmatically insert a page-specific value for og:image, something like: $page->seo->{"og:image"} = '/path/to/image'; $page->seo->render; Any way to do something like that? Thanks! Jason
  12. FWIW, I am seeing the same issue with throwing the exception. I suspect it has something to do with the fact that I'm using the "main.php" templating approach, as the first error I saw was from trying to redeclare a function that only appears at the top of main.php. Wrapping that in a function_exists() conditional results in a different error, at the point where I'm including the view for the current page: ob_start(); include('./views/'.$view.'/'.$view.'.inc'); // 404's error on this line now $layout = ob_get_clean(); ob_start(); include('./views/base/base.inc'); $template = ob_get_clean(); echo $template; Redirecting to the 404 page is (arguably) better than nothing, but ideally you'd just return a 404 status code directly on the originally requested URL.
  13. Yes, I was looking for a solution that would allow the user to vary the percentages on a case-by-case basis. Currently working around it with Hanna Code, but wanted to make sure I wasn't missing a "native" configuration option.
  14. Within CKEditor's default image properties dialog, you can set a percentage width on inline images and leave the height blank, which works better with responsive layouts. Within processwire's image manager (for CKEditor), it looks like you are limited to entering fixed pixel dimensions. Is there a config setting or module to change this behavior? It can be fixed manually by switching to source code view, but that's not very user-friendly. It can be overridden in CSS, but that's not as flexible. Thanks!
  15. I get back an empty array, even if I take out the conditional filtering. Is this something that has to be configured to collect data?
  16. Is there an easy way to get back the SQL query generated by a specific processwire selector? I have what appears to be a cartesian product and/or groupwise maximum bug in a selector, but I'm not sure how to confirm it. I'm querying for a set of pages with a specific template which are related to the current page. The returned pages include a URL field and a file field. The selector looks like this: $grades = $pages->find('template=grade,include=all,classification.title="'.$page->title.'",sort=series,sort=title'); "classification" is a page field. Series and title are text fields. I'm iterating through the results and outputting three text fields, a URL field, and a file (->url) field. On one of the nine pages using this query, it should only return one row, but it returns two. The text fields are identical for both rows. The URL and file fields are empty in the first row and populated in the second row. The other eight pages all work as expected with no duplication. Thanks, Jason
  17. For my purposes, it's close enough to be able to specify a different template file for each template. I point them all to main.php, which is empty. In config.php, I'm prepending an init.inc file that loads the correct view based on the value of $page->template. That may sound a bit circuitous, but it lets me have a structure like this (personal preference): /site/templates/ init.inc (all bootstrap code, prepended via config.php) main.php (empty) views/ base/ base.inc (global layout/markup, header, footer, nav, etc.) base.js base.less bio/ bio.inc bio.js bio.less location/ ...etc. for each view I'll probably stop prepending init.inc, and just move that code into main.php, since I still have to have one template file in the usual location anyway.
  18. Let's say I have a "template" called "bio." In the most basic processwire usage, there's a 1-1 relationship between templates and template files. If you want to view a page created using the "bio" template at its natural URL, you have to have a corresponding file at /site/templates/bio.php. If you create a "no-file" template for bios, in order to display a bio page, you have to include it from another template, use url segments, etc. -- in short, do the routing yourself. I want to use the normal routing mechanism (as if there were a bio.php file), but not have to physically create bio.php, because at this point it's just an empty placeholder.
×
×
  • Create New...