Recently Browsing 0 members
No registered users viewing this page.
I've got this code to fetch all pages:
/** @var PageArray $pages */ $pages = $this ->wire('pages') ->find(sprintf( 'has_parent!=2,id!=2|7,status<%s', Page::statusTrash )); With this I fetch all pages except admin, but that includes the 404 page as well. Is there a way to exclude pages like the 404 page from the result? Or maybe loop through the result set to check for the pages response code (without curl that is)?
I want to avoid filtering the 404 page by ID if possible.
At page editor level I need to place a piece of code which is unique to that page. This is the code:
<healcode-widget data-type="class_lists" data-widget-partner="mb" data-widget-id="xxxxxxxx" data-widget-version="0.1"></healcode-widget> This code pulls in data from a third-party site. The Body Field won't accept this code. I could place this in the template file but for that I'd have to crate a separate template file for each page. I'd rather use a common "basic_page" template file for most pages. Also, I would like to give the client the ability to change/edit code when necessary if it is at page editor level. Is there any way to achieve this? Thanks.
today I've tried the following:
Use .htaccess to rewrite the url conditionally if an image file was not found.
Rewrite target was http://www.this-is-the-live-system.com/site/assets/files/$1
I guess that would work out great. Unfortunately Processwire checks to see if the file exists and outputs an error message in the Page Editor.
An option to disable this check would be great. (Similar to $config->debugIf = '::1'; or something)
It would be great being able to just use the live database locally without broken images all over the place.
I guess this might be a simple good enough solution for most use cases.
I am using AJAX on a site I am building, specifically PJAX, and I have built all this locally and it has all been working great with no problems. Upon pushing this from local to remote the AJAX is failing to retrieve my pages, and thus falling back to the normal page loading.
I have had a look at the Network tab in Google devtools to find out more and it looks like the request goes through but the PJAX url call (for example: http://www.juleslister.co.uk/projects/photography?_pjax=%23pjax) is returning as a 301 error. I have a screenshot of the Network issue here: http://i.imgur.com/oC2ZPce.png