Jump to content

Tyssen

Members
  • Posts

    323
  • Joined

  • Last visited

Contact Methods

  • Website URL
    https://www.tyssendesign.com.au/

Profile Information

  • Gender
    Male
  • Location
    Brisbane, Australia

Recent Profile Visitors

5,225 profile views

Tyssen's Achievements

Sr. Member

Sr. Member (5/6)

51

Reputation

2

Community Answers

  1. This is how I did it: $mb = $modules->get('MarkupMenuBuilder'); $items = $mb->getMenuItems('Main', 2); foreach ($items as $item) : if ($item->isCurrent) : $currentID = $item->id; $parentID = $item->parentID; endif; endforeach; $subItems = $items->find("parentID=$parentID"); foreach ($subItems as $subItem) $output .= '<a href="'.$subItem->url.'">'.$subItem->title.'</a>';
  2. I haven't checked pages with output that the others use, but one page that uses the Srcset Image Textformatter should take something like <img src="image.jpg"> in a CKEditor field and transform it to: <img src="image.jpg" srcset="image_320.jpg 320w, image_480.jpg 480w"> based on settings you enter into the module for the size variants. The output is just the normal non-srcset version of the image.
  3. I have some text formatters applied to CKEditor fields – Profields Auto Links, YouTube video embed, and Srcset Image Textformatter. The modified output's not working with the Twig set up. Is there something else other than setting autoescape to false that needs to be added to done?
  4. If you've created a menu like this: Parent 1 - Child 1.1 - Child 1.2 Parent 2 - Child 2.1 - Child 2.2 and you're on page Child 1.1, is there a way to just get the siblings of the submenu, i.e. Child 1.1, Child 1.2? And every time you change to a page under a different parent, it shows only the child menu items?
  5. Ignore me, I'm an idiot. I had caching turned on for the template I was testing. 🥴 I have come across another problem though. I have a ProFields table field with a text and two checkbox fields. I'm looping through the rows like this: <tr> <th scope="row">{{ row.field_field }}</th> <td> {{ row.field_match }} </td> <td> {{ row.field_training }} </td> </tr> field_field renders OK, but with the checkbox fields in the template, I get "field_training|match does not exist or is not callable in this context". But if I add {{ page.field_status.first.field_training }} outside my loop, I get the correct output.
  6. Ah, I guess because responsive mode sends a different user agent. TBH, it's a config setting I'm not sure I've ever actually stopped and read properly. But good to know how to fix it. 👍
  7. Hi Moritz, I was following your Using Twig with ProcessWire article today to set up a site for using Twig and have come across a strange problem. When I first started, I quickly created some templates and added a few words in them to see if they were rendering correctly. Then I began working on the site properly. Everything was going fine until I tried to test a page in responsive view. Suddenly, everything I'd been adding to my twig templates had disappeared and I was being shown the small amount of dummy text I'd started with, like a cached version of the very first page rendered. I found that switching to responsive mode had logged me out of PW and it wasn't until I logged back in that everything I'd been working on displayed again. The being logged out when switching to responsive mode is weird enough, but a separate issue, (setting $config->sessionFingerprint to false fixes it) but do you know what might be preventing my pages displaying correctly unless I'm logged in?
  8. Does anyone else get this? Testing a page on the front end in either Chrome or Firefox and if I enable responsive view, I get logged out of the control panel. :?
  9. Apologies if this has been asked before (I searched but didn't find anything), but most of the pages of my site, I want the meta title format to be Page Name – Site Name. But for the home page, I want it to be Site Name – some text. I don't see a way to do that.
  10. This relates specifically to a problem I'm having with the Template Engine Twig module by Wanze, but I feel like it's probably a more general problem that could occur with any module installed with Composer. Feel free to move it though. The full error message I'm getting on both front and backend is If I move the vendor folder above webroot, the composer error goes away but when I try to access a page on the front end, I (unsurprisingly) get: I've tried adding {# FileCompiler=0 #} to the end of the only twig template I have at the moment (which just has plain text in it). But I'm getting the composer error on both front and back end so I wouldn't think that would help anyway. I've also tried composer dump-autoload. So why is the vendor folder getting copied to the FileCompiler folder? And is there anything I can do to stop that happening? Or stop the class name clashes?
  11. I'd like to be able to use both TextformatterImageInterceptor and Srcset Image Textformatter on the same CKEditor field. If I have Srcset Image Textformatter first in the list of formatters on the field, it adjusts the <img> tag as expected, but the markup from TextformatterImageInterceptor doesn't get output. If I have them the other way around, the markup for TextformatterImageInterceptor gets output, but Srcset Image Textformatter throws errors relating to the settings that you can turn off/on with checkboxes in the module's settings, generate HiDPI and LQPI images and width/height attributes. If I turn those three settings off the <img> tags get output but the src and srcset attributes are blank. Is this just a problem with these two modules not playing nicely together or can't you have two text formatters that alter image markup on the same field?
  12. @nbcommunication Great thanks. I wasn't sure whether there was going to be something straightforward like that or not. 👍
  13. @nbcommunication Yes, it's OK for me now. Another question though: you say that the module doesn't require OAuth for authentication but if I try and set up the module on my local version of the site, which isn't accessible outside my local network, I still get the same error. So at the moment, I only have an authorised account on the production version of the site (the same domain as I entered into the OAuth settings). How do I get my local version of the site authorised so I can work on template changes in my local environment?
×
×
  • Create New...