L
L
Leonid Gorshkov2018-08-15 11:53:03
MODX
Leonid Gorshkov, 2018-08-15 11:53:03

How to add parameters to specific links in PdoMenu GET?

Good afternoon,
How to add parameters to certain links in pdomenu?
For example, if a link to a resource with id=10 appears in the menu, then add the get
TPL parameter to this link:

<li>
  <a href="">
      <span class="text-middle"></span>
  </a>
</li>

SNIPPET:

Doesn't work
please help

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Leonid Gorshkov, 2018-08-15
@Synacs-U

It was:
It became:
connectivity - tv parameter (id of the same resource in another language)
Everything worked. (Resource 9 and 10 is a snippet redirect to the same page in another language.
If anyone is interested:

<?php
/**
* Version modx: 2.6.5 - pl
 * Name snippet: 're.language'
 * Description: Ищет эту же страницу другого языка по tv параметру.
 */

/** @var Не работает
$connectivity = $modx->runSnippet('pdoResources', array(
        'parents' => '1,2',
    'tpl' => '@INLINE ',
    'includeTVs' => 'connectivity',
    'where' => array(
            'connectivity' => (int)$_GET['link']
    )
));
 */

// А это работает
$connectivity = $modx->getObject('modResource',$_GET['link']);
?>
    <script type="text/javascript">
    window.location.href = '<?php echo $connectivity->get('uri'); ?>';
    </script>
<?php
unset($connectivity);

= domain site.ru
$connectivity->get('uri') = local path ru/categories/ to location en/category

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question