Recently Browsing 0 members
No registered users viewing this page.
By Guy Incognito
Just wondering what software/approaches others take to the management of their code snippets.
Relatively new to PW and finding that its logical approach is making it far easier for me to reuse code in projects and encourages me to try and be more organised!
I've looked at few notes apps that piggyback of Gists - although I'm not sure if Gists is a good idea for private project work seeing as they're never totally private.
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.