Answer the question
In order to leave comments, you need to log in
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>
Answer the question
In order to leave comments, you need to log in
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);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question