Jump to content

Guy Incognito

Members
  • Content Count

    69
  • Joined

  • Last visited

Community Reputation

34 Excellent

About Guy Incognito

  • Rank
    Full Member

Profile Information

  • Location
    Kent, UK

Recent Profile Visitors

547 profile views
  1. Ok - good call on the namespacing. Can confirm the following combo of using wire404Exception() instead of PageNotFoundException() and namespacing works as follow: throw new \ProcessWire\wire404Exception(); Thanks @wbmnfktr and @BitPoet - got there in there end!
  2. Yes, you're probably right. I do usually use Master for most projects, just working on something that allows for a little more experimentation. I'll try it on another install and see if it is the dev version causing this. Thanks for your assistance (again!) @ryan - don't know if you can think of anything off the top of your head in the latest dev that might cause the issues above? If I can confirm it later in another install I log it on github.
  3. Interesting - yes am running the latest Dev version for this project as want to play with the new cookies api 😂 - shouldn't be an issue should it? Unless something has been changed/deprecated?
  4. Nope, gives the same error: Fatal Error: Uncaught Error: Class 'Wire404Exception' not found in...
  5. You're my guru today! Lol! 😂 Yes have seen this guide and have used segments loads of times. I know the script it working and breaking at the right places because if I drop the throw new PageNotFoundException(); call and just echo out a message instead it works fine. It's just the 404 call that seems to error. Doesn't seem to be able to find the class. Here's the snippet if it helps: //URL Routing for category pages and tags if($currentTemplate == 'category') { ################################################### ## Routing only required for category and tag pages ################################################### //Segment 1 == category/sector $currentCat = $sanitizer->text($input->urlSegment1); //Segment 2 == content tag e.g. marketing $currentTag = $sanitizer->text($input->urlSegment2); //Check requested category exists (in hidden categories structure) //404 if not, otherwise continue rendering page $catPage = $pages->get('/categories/')->children("name=$currentCat,include=hidden,limit=1"); $catPage = $catPage[0]; if(!$catPage->id) { throw new PageNotFoundException(); } } Probably doing something stupid.
  6. I'm using URL segments to pull some dynamic content into a page. The template uses the URL segment variable to check the content exists in another part of the site tree, if not I'm trying to throw a 404. Looking at other threads on here I think the below should do the job. throw new PageNotFoundException(); But I'm getting the following error: Fatal Error: Uncaught Error: Class 'PageNotFoundException' not found in... Is anyone able to shed any light on how I'm using this wrong? The code is currently in an include which seemed to have previously triggered some debate, but I get the same error even if I move it to the top of the parent page. I've also created a plain 404 template that doesn't include any other template elements just to rule out a code loop.
  7. Sorry for keeping you in suspense... but crazily I can confirm this works! Thanks for your help 😄
  8. { name: 'Left Aligned Photo', element: 'img', attributes: { 'class': 'float-md-left img-fluid' } }, { name: 'Right Aligned Photo', element: 'img', attributes: { 'class': 'float-md-right img-fluid' } }, { name: 'Centered Photo', element: 'img', attributes: { 'class': 'd-block img-fluid' } }, This alternative set of Bootstrap classes works fine - can't figure out what the common denominator is of the ones that don't work. It also doesn't seem to like more than 2 classes, not sure if there's a limit to the length of the attribute strings?
  9. Hi all, Having a strange problem with my CKeditor custom styles. Trying to add standard bootstrap classes to the image alignment options. But for some reason if I add multiple classes to the centred image option it disappears from the editor drop down. But with only one class it works. So this works: { name: 'Left Aligned Photo', element: 'img', attributes: { 'class': 'float-md-left img-fluid' } }, { name: 'Right Aligned Photo', element: 'img', attributes: { 'class': 'float-md-right img-fluid' } }, { name: 'Centered Photo', element: 'img', attributes: { 'class': 'img-fluid' } }, But this doesn't: { name: 'Left Aligned Photo', element: 'img', attributes: { 'class': 'float-md-left img-fluid' } }, { name: 'Right Aligned Photo', element: 'img', attributes: { 'class': 'float-md-right img-fluid' } }, { name: 'Centered Photo', element: 'img', attributes: { 'class': 'w-100 img-fluid' } }, Note the slight difference to the last line. I've tried escaping the hyphens in case it was that but doesn't help. Any ideas.... #puzzled!
  10. Fully didn’t know about this method - really useful thanks.
  11. Perfect thanks - so simple!... I had tried basically every combo of conditionals and was beginning to think it wouldn't work!
  12. Pretty much as the title - does anyone have a snazzy way to make a field that doesn't yet have any content front-end editable? Currently, the field cannot be double-clicked if empty but I would like to give users the ability to add missing content to a few specific fields.
  13. ha - great work on this - love the PW community! 😄 I've tried dropping your branch of the module into one of the affected sites but it doesn't seem to have fixed it 😕. Bit puzzled, as I'm almost certain things were working fine on all these sites previously.
  14. I'm guessing the main repo as we usually install via the CMS module installer. Does this sound like something that has already been addressed then?
×
×
  • Create New...