Jump to content

DaveP

Members
  • Posts

    868
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by DaveP

  1. Nice and clean. Also gives me some photography inspiration.
  2. No joy from the UK either. Unless one already subscribes to a VPN service and can therefore manifest a US IP, in which case, nice site.
  3. Does your page file do any other echoes, or does it prepare output for another file to actually do the echoing? It might be the file appended automatically to each template through the PW template configuration. Quite often this is the case but not necessarily.
  4. There are always multiple ways to achieve your aims in PW. What I tend to do for content shared across multiple pages is add a tab to the Home page in the admin using a new 'Fieldset in Tab'. Take a look in the demo admin at fieldset_meta. This way you can add all sorts of shared content and have it grouped together, images, site name, phone number, anything really. If things still aren't apparent after looking at the demo, come back here and ask some more.
  5. I tend to wrap more mark-up around than @fliwire, more like @MateThemes' original... <div id="offcanvas-nav" uk-offcanvas="overlay: true"> <div class="uk-offcanvas-bar"> <button class="uk-offcanvas-close" type="button" uk-close></button> <?= ukNav($home->and($home->children),array('depth' => 2,'blockParents' => array($home),'accordion' => true)); ?> </div> </div> $home is declared at the outset thus... <?php /* Declare PW namespace */ namespace ProcessWire; /* Initialise some variables */ $home = $pages->get('/'); As is always with PW there are limitless ways to 'flay a feline'. (Although there are strong similarities.)
  6. This is great. A few years ago I worked briefly for a security company and one of my responsibilities standing in for the accountant when she was off, was billing for services (mainly door security - 'bouncers' here in the UK) and we used an online system very much like this. Some summary pages (monthly/yearly/all time totals etc) would be an obvious addition and tax liability calculations where appropriate perhaps. Of course, being built on top of PW, customisation should be straightforward on this kind of foundation.
  7. Probably not an optimal solution, but maybe you could create a 'dummy' user on the 'other' server at the time a genuine new user is created? Then there's a chance both servers will match, although race conditions etc...
  8. You would need to create a role, say 'frontend_user' or some such. (Can't use 'user' because $user is a thing already.) Then do something like if($user->hasRole('frontend_user')) { // show input form } See https://processwire.com/api/ref/user/has-role/ Then https://processwire.com/api/ref/pages/add/ or https://processwire.com/api/ref/pages/new/ should help. You don't need to worry about database IDs and such - PW's API deals with all that.
  9. I take back the 'twice' (apologies), but there are three double quotes (") in the selector quoted above.
  10. I don't know if you copy/pasted your code into your question, but three instances of a double quote on a line is rarely successful and you have that twice above.
  11. Nothing wrong with @bernhard's way of doing it, but another option might be to name templates like so- blog_standard blog_gallery blog_short_status and set up fields within those templates as appropriate to its purpose. Then in the parent page's setting (Family tab) set allowed children to those templates. As with practically everything in PW there are as many different ways to do things as there are users.
  12. Check out the Options Fieldtype.
  13. ...or see the docs https://processwire.com/docs/fields/dependencies/
  14. There's nothing to stop you having a (perhaps hidden) field 'index' on each month page representing the month's number, then your selector above would work (or very nearly work). If I was doing something like you are, I would probably have some code in _init.php or _ready.php or even at the top of a page template to programmatically create new 'year' and 'month' pages well in advance, creating and populating that 'index' field as well and probably leave them unpublished so that they can be quickly and easily published when required. I think that would work. Probably.
  15. A new tab isn't a new session - just like having PW frontend and backend open in different tabs - you stay logged into both, and any further tabs you might open. A new window might be (I haven't tested) but surely a user savvy enough to do that will be savvy enough to expect adverse consequences (I would have thought anyway...).
  16. I think one way of doing what you're looking for would be to do two finds - one for products and one for other pages and then merge them, because you need to override the 'organic' results somewhat, so you'll need to impose some kind of artificiality otherwise you'll just get what you're getting now.. Say you want 10 results, get 6 products and 4 info pages (or 7 & 3 or whatever) and then rank that combined 10 by relevancy. Another way would be to just always show say 3 products at the top, kind of like Google ads at the top of SERPS, but you wouldn't need to identify them as ads. Yet another way, on wide enough screens, might be to have a column for each.
  17. Yep, but, PW gives you methods for working with WireArrays - https://processwire.com/api/ref/functions/wire-array/. This way you can use ->first() or any of the usual methods. You'll need to refactor your code a bit but it might well be worth it.
  18. Busted link to UKRI in footer. It's a bit weird, but there's a leading slash in the href - <a class=partner-link href=/https://www.ukri.org/> Other than that ? great-looking site and outstanding performance. (I'd like to see anyone achieve those scores with WordPress.)
  19. Just off the top of my head you might be able to get round that by having a hidden field automatically populated with a kind of concatenated version of any multi word values - maybe Alice_One and Alice_Two. That way it might be possible to treat them as single word (kind of).
  20. FWIW there is another option - Find/Replace Textformatter module. I have been using it for just this kind if thing recently and found it really useful.
  21. Based on nothing but gut feeling, the second. That's the way I did it last time I was importing JSON from somewhere, mainly because I was glad to be able to stop thinking about the horrible JSON object and concentrate on nice PW fields. If you were going to be really careful, some benchmarking might be in order, but I suspect there wouldn't be much in it, just what you're more comfortable dealing with.
  22. I think some of your class declarations are invalid. (On mobile so copy/paste awkward.) The 'hover:xxxx' is CSS but not valid as a class name. Firefox is obvs more easy-going than others. Hope this makes sense.
×
×
  • Create New...