0
Welcome Guest! Login
0 items Join Now

Problem with custom particle and URLs in Twig

  • Problem with custom particle and URLs in Twig

    Posted 5 years 1 hour ago
    • Hi folks

      I'm building a custom Gantry template based on Helium. I've "imported" Notio's search particle to it and everything is working fine except for one single thing: as my site is a multilanguage one, when the search form is sent it should get "&lang=LANG_TAG" added to the URL, so the search page is loaded in the user's current language. Well, I've noticed that the URL form action URL is being wrongly built, as what I can see in my browser is
      http://mydomain.com/index.php?option=com_search&lang=es

      I've tried hardcoding it into MYTEMPLATE/custom/particles/search.html.twig this way
      {% if gantry.platform.name == "joomla" %}
                      <form action="{{ joomla.route('index.php?option=com_search&ItemID=123&lang=es' }}" method="post">

      but it gets '&' replaced by '&amp;' once and again.

      Is there any workaround or alternative way to get the action url so it get's the parameters correctly parsed with '&' instead of '&amp;'?

      Thanks in advance!
    • MrT's Avatar
    • MrT
    • Preeminent Rocketeer
    • Posts: 101084
    • Thanks: 13481
    • Web Designer/Developer

    Re: Problem with custom particle and URLs in Twig

    Posted 5 years 1 hour ago
    • &amp; is perfectly fine in the url ? it does exactly the same as & (since That is what it is).

      Please would you post your URL, superuser id and pswd in the secure tab of your post and I'll have a look for you.

      Please post your FTP logon, password and FTP URL in the secure area of your post.


      Regards, Mark.
    • Please search forums before posting. Please make sure your post includes the version of the CMS you are using and a link to the problem. Annotations on screenshots can also be helpful to explain problems/goals. Please use the "secure" tab for confidential information.
  • Re: Problem with custom particle and URLs in Twig

    Posted 4 years 11 months ago
    • Hi Mark

      Thanks for your quick reply. Unfortunately, the site is under development in my local machine at this moment, so I can't share it at this moment. I've narrowed the issue a little bit more: I've found that as you pointed there's no problem in using &amp; in the URL in general... except for Itemid. I've checked my urls using & and &amp; for all the parameters, and the result is the same except for ItemId. When I use &Itemid, the url is correctly routed, but when I use &amp;Itemid, this parameter is ignored.

      Also there seems to be an issue with com_search. As far as I know, when you create a menu item pointing to the "main" option of a component, it acts as a "fallback", so whenever that component is called with no specific Itemid associated, it's that "fallback" item you created the one that is called, applying all it's specific settings. Well, apparently this is not happening with com_search, as I created such an item to get some extra settings applied after a search was performed using my search particle, but without an Itemid specified in the form's "action" url, it applies a "raw" com_search instance, not the one I have configured.

      So this points more to a Joomla issue than a Gantry issue. But maybe I'm missing something here which is Gantry related, so if you could just take a look at a test site and confirm this is not related with how Gantry is sending those search requests to com_search that would help a lot.

      Thanks again!
    • MrT's Avatar
    • MrT
    • Preeminent Rocketeer
    • Posts: 101084
    • Thanks: 13481
    • Web Designer/Developer

    Re: Problem with custom particle and URLs in Twig

    Posted 4 years 11 months ago
    • I'll happily look for you if you get your test site online. If I created a test site there's no guarantee that I have the set-up as you do, so I need to see your site.

      Regards, Mark.
    • Please search forums before posting. Please make sure your post includes the version of the CMS you are using and a link to the problem. Annotations on screenshots can also be helpful to explain problems/goals. Please use the "secure" tab for confidential information.

Time to create page: 0.047 seconds