Jump to content

Dharma

Members
  • Posts

    9
  • Joined

  • Last visited

About Dharma

  • Birthday 02/19/1982

Contact Methods

  • Website URL
    https://www.basili.co

Profile Information

  • Gender
    Male
  • Location
    Italy

Recent Profile Visitors

1,008 profile views

Dharma's Achievements

Jr. Member

Jr. Member (3/6)

0

Reputation

  1. Hello dear community I'm into the development of a new website that must serve different contents for different countries besides of languages. In a previous project I've already solved this task by creating a country selector and then set the chosen country in session (see https://www.univetsafety.com/en/countries/) Using the Repeater Matrix i've then created a new field with checkboxes for countries and for each repeater item the user is able to choose in which country the item should be shown. Everything good and fine, anyhow in this new project i'd love to get rid of session and use URLs to set current country – Eg: www.domain.tld/en/uk/page-slug (where en is the current language and uk is the current country) Of course i'll have several languages (en, it, de, fr, jp, …) and just want to keep them working as usual. I've tried different ways, but none seems to work: - url hooks - module which modifies language slug to use /en-uk/ Any ideas?
  2. I'm trying to attach the hook initTwig into the template (_init.php), but it doesn't work. wire()->addHookAfter("TemplateEngineTwig::initTwig", function(HookEvent $event) { $twig = $event->arguments('twig'); // Extend $twig with custom code }); By now, I'm able to hook it correctly only by hooking within a class (for example a class defined in a module), but sometimes it's useful to extend it directly from a template without the hassle of dealing with a module. Anyone experiencing the same issue? Thanks!
×
×
  • Create New...