Jump to content

JayGee

Members
  • Posts

    247
  • Joined

  • Last visited

Everything posted by JayGee

  1. Pretty much as per the topic subject - trying to figure out how to toggle a repeater on/off using the API. Have tried setting the page status which indeed seems to hide the item but this doesn't reflect the toggle on the page editor so when you next save the page they come back on.
  2. 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!
  3. 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.
  4. 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?
  5. Nope, gives the same error: Fatal Error: Uncaught Error: Class 'Wire404Exception' not found in...
  6. 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.
  7. 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.
  8. Sorry for keeping you in suspense... but crazily I can confirm this works! Thanks for your help ?
  9. { 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?
  10. 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!
  11. Fully didn’t know about this method - really useful thanks.
  12. Perfect thanks - so simple!... I had tried basically every combo of conditionals and was beginning to think it wouldn't work!
  13. 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.
  14. 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.
  15. 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?
  16. Hi all, we've started experiencing an odd problem where this extension has stopped auto-injecting the meta tags into some sites. The manual tag insertion still works. I can't work out the common denominator - has anyone else experienced this?
  17. Thanks to everyone who was helping me the other night. A little update on what I ended up doing with my helper module so far.... For the site settings, I ended up just making a configurable module with only one field containing a load of defaults stored as a simple JSON array. I thought this would be far easier for my specific purpose as it means that it's easily customisable with new data on a site-by-site basis without having to update the module interface or add new fields. I've hooked the $page object to access this data on the front end, so I can now do <?=$page->siteSettings['company_name'];?> etc in my templates which is cool. I've also set some dependencies in the config for the modules we regularly use. I have also used a hook to inject an overlay 'edit mode' icon that displays on the front end whenever an editor is logged into the site, as we've found some people don't realise when they're logged in and can use the front-end editing on their site. The little cog icon also links back to the PW dashboard. Really starting to get the hang of how the PW modules work now, so will be adding in lots more useful stuff we tend to use for every project in due course. ?
  18. Just came across this thread - for those who were wondering, we switched from ServerPilot to RunCloud + Linode for many PW projects and find it to be a great setup. Their support is great too, they’re in the Far East but always respond very quickly, not that we’ve had many issues. Very favourable pricing too compared to ServerPilot and way more features.
  19. Thanks ? PW is also helping my coding get better - I'm mainly frontend, but it makes a great framework to safely grow my skillset and also have to rely on other members of my team less ? I'll check out Kickstart - looks awesome. Yes - I've loved the template and dev work created so far with PW so having fun so far just experimenting to see what's possible with modules too.
  20. Yes to date I’ve been using a combo of pages and my own include files within the templates folder which works ok, just experimenting with the options ? My only hang up with profiles is how do you update them once installed. Whereas a module is easily updated across multiple sites. If I’m right, you can use a module to add pages and fields? If so maybe I need to switch my strategy for the module and do this instead of config fields.
  21. Ok thanks that makes sense why it doesn’t work. I do normally store this stuff in a standard page, but was using it as an exercise to dip my toe into modules as haven’t touched that element of PW yet. I just thought it might be cool to be able to install the module into each project without having to set up the fields etc.
  22. I'm teaching myself about PW module development by creating a simple module to hold frequently used settings for web design projects. I' ve set up a module with a config file to define a form with my settings fields. @ryan's tutorial here https://processwire.com/blog/posts/new-module-configuration-options/ says you can use "any Inputfield module name" - but image field gives me an error is an image field possible? "Error: Uncaught Error: Call to a member function path() on string in /home/testproject/public_html/wire/modules/Inputfield/InputfieldFile/InputfieldFile.module:913" Example array so far below - am I missing some confiuration values? array( 'name' => 'logo', 'label' => 'Logo', 'type' => 'file', 'value' => '', 'maxFiles' => 1, ),
  23. I'm still fairly new here having switched to using ProcessWire for pretty much every project (hence the frequent questions ? ) from Concrete5. Concrete5 has had Gutenberg-esque block-based front-end editing for nearly 10 years longer than Wordpress. Although a finished site using C5 can look great for a site editor/frontend-only user with various drag-drop layout tools, we were finding c5 development had become very convoluted and was starting to make simple website projects unnecessarily complicated. C5's core weighs in at a hefty filesize too. This is why we started researching for alternatives and landed happily at ProcessWire. I already find WP development unnecessarily convoluted, especially compared to the simplicity of ProcessWire. And with Gutenberg, I can only foresee the same sort of headaches ahead for the WP community that we were finding with C5 - namely conflicts between blocks and the core and frontend UI and your design style and functionality being dictated to by the CMS in order to work in the Gutenberg features. Discovering ProcessWire has been a revelation for us - the clean API and design agnostic approach are making everything from simple website projects to complex web apps a breeze, with the added bonus of super simple frontend editing that not only wows client's used to site builder platforms but requires basically zero onboarding too. I would urge anyone thinking of building out Gutenberg inspired modules for ProcessWire to consider the above comments to ensure that what makes ProcessWire special is retained.
  24. I agree - or just assuming if you are dragging over a page that it needs highlighting/opening.
×
×
  • Create New...