-
Posts
4,043 -
Joined
-
Last visited
-
Days Won
67
Everything posted by Pete
-
Ah, except I have two issues that I suspect are more general Selector issues. If I'm searching for the partial word "test" but the actual word is "testing" for example, it won't return a result. I thought it might be a length limitation, but I even tried "testin" without the G and it doesn't work no matter which selector I try. The other issue is postcodes. I have a post code (zip code) in the map marker field that goes something like "LA22 X99". Typing in either LA22 or X99 returns nothing Is it possible they're too short? I seem to remember something about mySQL defaults limiting short word searches so this one might not be a bug
-
Any pointers on creating a mobile version of a site?
Pete replied to martinluff's topic in API & Templates
Yep - that's what he means, the subdomain would be empty. Basically the mobile stylesheet would be called for all requests to m.domain.com instead. I suppose a .htaccess redirect could do it and point to domain.com?style=mobile to initially set the mobile stylesheet, then just store the stylesheet choice in a session variable. It's likely that you could do something fancy enough that you could check that the original request was to m.domain.com and then pull the mobile stylesheet - that would remove the rather ugly ?style=mobile I suggested above. -
Seperate news for each language - some problems...
Pete replied to doolak's topic in Multi-Language Support
I think you would just remove '' from the end of title= But title can never be empty can it? -
Perfect - works for me So is that function basically useful for any module that implements its own tables if you want such a field to be searchable?
-
The one thing to bear in mind with using the version from the admin is something ryan mentioned ages ago in another thread - it might be better to use your own download in case the admin version ever changes. For example the current version is FancyBox v1 and there is a v2 version of Fancybox - whilst I can't imagine ryan changing it yet as the current version works fine, it could break your front-end work if it were to change. It's one of those things that probably won't happen or if it does it might not affect you, but still worth bearing in mind.
-
That's why I wanted to work this one out - I've got a lot of repetition in some templates on one site so this will streamline things nicely!
-
It seems to work for me, but only with the ! at the front, which actually makes more sense when you read it: "If not page matches template template1 or template2" makes more sense than "If page matches template not template1 or template2" The second one sounds like WillyC
-
I know, it's a whole extra character to type, taking up space in the database. Some people have no consideration
-
Try my last edit to my previous post
-
I just tried this, which works for ONE template, but the docs suggest it should work with a selector: if ($page->is('template!=template1')) { Found that on this page: http://processwire.com/api/variables/page/ I need to read the full docs sometime - I've still not done that yet and there is a LOT in there But still, that doesn't do what you're attempting! In fact, according to that page, $page->find will search children, grandchildren etc but not the current page. Here's the answer: if (!$page->matches('template=template1|template2')) { Try that one
-
It does sound like you should be able to do this from reading the API pages on Selectors, but I can't get it to work and it certainly would be neater: if ($page->find('template!=template1|template2') { // Do your thing }
-
There's nothing wrong with your final option, except my personal preference is && instead of "and" or "AND".
-
And I've probably lost even more with the Fawlty Towers reference there, but trust me it's funny (unless you're Manuel).
-
Added and committed that line - thanks. Yep - no idea what the 404 issue is as I compared the strpos and it should just work as far as I can tell.
-
Hi ryan Just tried to integrate the MapMarker address field with search and it won't let me. Am I doing something wrong? My selector is as follows: $matches = $pages->find("map_marker.address%=$q, limit=50"); I think I might just be being thick
-
It basically takes the load off in terms of your images, CSS and JS (from memory) and serves these from the server closest to the person making the page request - they generally have a lot of servers all around the world. Last time I tried Cloudflare I had some issues with it and ProcessWire - I probably could have fixed them but time was against me on that project and I haven't tried again yet, so there may be some testing required to get it to work. EDIT: Joss beat me to it. I need to write less
-
I think he just meas he prefers to put the noses in.
-
This has now been bumped to 1.0.6 as I missed a change from Soma. Not sure if it will fix your issue though!
-
Should work fine from this point forward: and and EDIT: And that other one where he's undecided is now:
-
North of the Mersey? Well I'm in Chester and I'm Northwest, so not sure whether there is some overlap. Also I think Cumbria is classes as Northwest too, soooo... Not sure where I'm going with this
-
@Joss: Yes you can - a few of the modules in the directory add fields already during installation and it would be trivial for them to add pages at the same time. However this would fall more under the realm of a site profile I think since if it is to do with new sites a site profile will also set up your page structure, templates etc. Take a look at this: http://processwire.com/talk/topic/530-profile-export-module-also-upgrade-pw-20-to-21/
-
It's on my list of things to do at some point
-
Running a Daily Newspaper website with Process Wire.
Pete replied to Crssp's topic in Getting Started
Well the first bit depends on how you set up your templates and fields in ProcessWire, then you can easily do something like this to get the last 7 issues and output a simple title for each of them with a link: <?php foreach ($pages->get('/issues/')->children('sort=-date, limit=7) as $issue) { echo "<a href='$issue->url'>$issue->title</a><br />"; } ?> As several of us have said, everything's really easy once it's in ProcesWire - it's getting it there that will be the big hurdle. As you can see above, I've assumed we have everything under a page called "issues", then sorted the child pages by date descending and limited the results to 7, looped through them and output the issue title and link. I realise this isn't the structure you have, but it's really easy to build any site structure you want in ProcessWire. The second bit I quoted from that particular post of yours was more so I could ask why you would do that? ProcessWire is perfect for building this kind of site so I don't understand why you would make it work alongside something else when this is what it's designed to do? -
Yup - the 404 page is in the site tree as Willy says, so you could just change set a template for that page and do some code in there to keep it simple