#1 Re: Developer Help » .htaccess rewrites interfering with video playback on iOS » August 13, 2014 1:53am

Yep, that's worked and the videos are now playing normally, thanks! big_smile

#2 Bug Reports » Grammar error in admin » August 13, 2014 1:52am

jono_hayward
Replies: 1

Yes, I know, I'm a grammar pedant. I've accepted this.

Anyway, when you've got a site set up with separate dev and live sites, the message letting you know you're on the dev site should read "CHANGES WILL NOT AFFECT LIVE SITE!". When used as a verb as it is here, you need to use "affect", as "effect" is the noun, eg "Changes will not have any effect on the live site".

smile

#3 Re: Developer Help » .htaccess rewrites interfering with video playback on iOS » August 12, 2014 7:31pm

Thanks for the response Tim!

I'm actually still encountering this issue. I'm not entirely sure what's triggered it this time as it was working perfectly for a while, but for now on my local development server, iOS refuses to open .mp4 videos located in /site/files/.

I've done some trial-and-error investigation by commenting out different sections of the /site/.htaccess file, and discovered that this section seems to be causing issues. If it's commented out, videos play fine, but if it's left in there iOS just shows a play icon with a line through it indicating the file can't be opened:

  # html, txt, css, js, json, xml, htc:
  <IfModule filter_module>
   FilterDeclare   COMPRESS
   FilterProvider  COMPRESS  DEFLATE resp=Content-Type /text/(html|css|javascript|plain|x(ml|-component))/
   FilterProvider  COMPRESS  DEFLATE resp=Content-Type /application/(javascript|json|xml|x-javascript)/
   FilterChain	 COMPRESS
   FilterProtocol  COMPRESS  change=yes;byteranges=no
 </IfModule>

I don't know anywhere near enough about Apache module configuration to understand what that's doing, but my first guess was that it was interfering with the content-type response from the server. However, viewing the response headers with Curl indicates it's still being passed as video/mp4:

Jonos-Shiny-Macbook-Pro:~ jonathonhayward$ curl -I http://sacd.dev/site/files/dictionary/videos/1.mp4
HTTP/1.1 200 OK
Date: Wed, 13 Aug 2014 00:29:09 GMT
Server: Apache/2.2.26 (Unix) DAV/2 PHP/5.4.24 mod_ssl/2.2.26 OpenSSL/0.9.8y
Last-Modified: Tue, 12 Aug 2014 14:49:48 GMT
ETag: "1aa76e8-ac736-5006fc8747b00"
Accept-Ranges: bytes
Content-Length: 706358
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
X-Permitted-Cross-Domain-Policies: master-only
Content-Type: video/mp4

.

So I'm really not sure what's going on here.

Any thoughts?

#4 Developer Help » .htaccess rewrites interfering with video playback on iOS » July 31, 2014 7:26am

jono_hayward
Replies: 5

So I'm not sure if this should go into the bug report forum or not, but here goes.

I'm building a site at the moment on BigTree that employs self-hosted videos (with HTML5 <video> on the front-end). For a couple of days, I could not, no matter what I tried, make the videos play on iOS devices.

For reference, my videos were stored in /site/files/dictionary/videos/1.mp4. But on the front-end, I was referencing them simply via /files/dictionary/videos/1.mp4 because I know that normally the .htaccess rewrites will transparently send the file through correctly. And on desktop browsers, that's what was happening. But for some reason iOS browsers simply refused to play ball: they'd recognise that I was trying to look at a video file, and bring up the video playback UI, but would completely fail to load it.

Eventually, I discovered the problem: if I went into my unix terminal and tried to access the video file via curl, the output would be the BigTree 404 page template, not the video itself. I just thought that maybe curl somehow doesn't respect mod_rewrite, but it did get me thinking about what the iOS browsers were doing. So on my iPad I tried to access the file with the /site/ part of the URL included and - hey presto - it worked.

So this is a long-winded way of saying that BigTree's default .htaccess rewriting seems to interfere with certain operations on iOS browsers smile

#6 Developer Help » Query/suggestion: module content in the front-end admin bar » July 9, 2014 9:01pm

jono_hayward
Replies: 2

I love the admin bar, certainly makes it a lot quicker and easier for users to update their content in a dead-simple environment.

But something I noticed, and was very confused by, when I first tested out the demo site (specifically the tree pages) is that it's possible to have "pages" that are actually routed pages showing module content, but when you try to edit the page using the admin bar, you only get the resources attached to that page's template - most likely just a page_header variable. When I was testing out the demo, I didn't yet understand the module system so this was utterly confusing to me, I didn't get why some pages let me edit the content from the admin bar but some didn't.

Now that I understand modules, I understand why the content for a "module page" isn't available from the admin bar. But it occurs to me that my users will still be just as confused. I'm building a site that has modules for a staff directory and a news blog. I'd very much like to be able to have the users edit the content from both of those modules from the pages to which they apply.

(I'm assuming here that there isn't already a way to do this that I've just missed smile )

So what I'd suggest is this (keeping in mind that I'm largely unfamiliar with the PHP behind BigTree itself): create a method in the BigTreeModule class that can be called from within a routed module template that allows you to pass the module and ID of the content you want to edit to the Admin bar, and if that is specified, the "edit content" button shows the edit form from the appropriate module instead.

As BigTree is open source I'll gladly put in the effort to put together such functionality myself, but I'm just looking for an idea from people more familiar with things as to whether it's even feasible before I do so.

So does this sound good?

#7 Re: Developer Help » Accessing rendered templates from other pages » June 30, 2014 9:37am

Yep, that worked a treat, thanks!

I did run into a little bit of an issue with the $page_header from the last page loaded being inserted in place of the main page title, but I got around that by changing the key of the resources on the master template from $page_header to something different.

Thanks again!

#8 Developer Help » Accessing rendered templates from other pages » June 30, 2014 8:22am

jono_hayward
Replies: 3

So the portfolio site I'm building is one of those ones you see a lot these days where all of the content is displayed in large distinct sections all down the one single page - something like this site.

For ease of editing, I've set up the content in the backend using separate pages, some of which are tied to modules for things like case studies and portfolio items etc.

My problem is that while it's easy enough to spit out the content of each page by looping through the pages and using $cms->getPage(), that doesn't work for pages with different templates. I've set up templates to use for each type of content block, but I can't figure out how to render each of those templates and then provide that rendered content into the "master" template I'm using as the home page.

What I'd like to do is process the first part of the template rendering process (as described here), but only the first part, and then insert that into one of the content 'blocks' on the main page.

Is that possible? Am I barking up the wrong tree, and should I be looking into Callouts? I'm still a bit of a noob here and don't understand how the callouts system works so I may be missing something obvious.

I'd really appreciate any help or advice.

Thanks! smile

#9 Re: Developer Help » Field Options not saving » June 29, 2014 11:37pm

Makes sense. Thanks!

I'll get in touch with my web host.

#10 Re: Developer Help » Field Options not saving » June 29, 2014 9:49am

I guess I should note, whilst mentioning the modifications that I had to make to /site/.htaccess, that my server does have magic_quotes_gpc turned on, and being a shared environment I may not be able to get my host to turn them off lest it affect other sites - which is why I just commented out the line in the .htaccess that attempted to disable them. Could that be causing the issue?

#11 Developer Help » Field Options not saving » June 29, 2014 9:33am

jono_hayward
Replies: 3

Hi there,

I've been playing around with BigTree on my local development machine for a while and am absolutely loving it, have had no problems at all.

However I've just set up my first BT install on a real web host and have run into an option with module creation. I can set up my modules just fine through the Module Designer, but when I attempt to set field options for some of the fields in the module, they're simply not saving.

For instance, I set up a list field type, set it to required, and add a couple of static options for the list.
Screen%20Shot%202014-06-30%20at%2012.24.53%20am.png

However, once I click Save, I can open up the same Field Options dialog to find that the options I've specified have been cleared out and it's back to default:
Screen%20Shot%202014-06-30%20at%2012.25.10%20am.png.

I'm not getting any JS errors in the console. In the Network inspector, I can see a request is sent to /admin/ajax/developer/save-field-options with a response that would indicate it's parsed the list items I put in there:

$("#options_type").val("{\"list_type\":\"static\",\"allow-empty\":\"Yes\",\"list\":[{\"value\":\"Professional\",\"description\":\"Professional\"},{\"value\":\"Community\",\"description\":\"Community\"}],\"pop-table\":\"\"}");

So I'm a bit puzzled.
This is a pretty standard UNIX shared hosting environment.

The only other problem I've had setting up BigTree in this environment is that the server did not like the two php_flag directives at the end of /site/.htaccess - according to the error log, php_flag is invalid so it gave me a 500 error. After commenting those out (I'm sure short tags are enabled on this server), I was off and away with no problems.

Any ideas?

Cheers big_smile

Board footer

Powered by FluxBB

The Discussion Forum is not available on displays of this size.