I have added some links in top. i want get query param from url and append in to every links in top dynamically
like my links are = test1
, test2
, test3
My mail url is = https://apcd.com
When some one use = https://abcd.com?id=123
When any one click on any link in top normally it will open like = https://abcd.com/test1
but i need https://abcd.com/test1?id=123
I am able to add like this but user changed https://abcd.com?id=1234
immediately not effecting in to that links when i flush cache that time only it effecting any idea to resolve this issue
I have create one phmtl file
<?php $blockObject= $block->getLayout()->createBlock('Pawan\Customerids\Block\Index');
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$storeManager = $objectManager->get('\Magento\Store\Model\StoreManagerInterface');
$id = $blockObject->getRequest()->getParam('id');
$storeurl=$storeManager->getStore()->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_WEB);
$storeurl = rtrim($storeurl, '/');
?>
<li class="nav item ui-menu-item" role="presentation">
<a href="<?php echo $storeurl.'/home'.$id; ?>" id="ui-id-3" class="ui-corner-all" tabindex="-1" role="menuitem">home</a>
</li>
<li class="nav item ui-menu-item" role="presentation">
<a href="<?php echo $storeurl.'/our-experts'.$id; ?>" id="ui-id-4" class="ui-corner-all" tabindex="-1" role="menuitem">OUR EXPERTS</a>
</li>
<li class="nav item ui-menu-item" role="presentation">
<a href="<?php echo $storeurl.'/about-us'.$id; ?>" id="ui-id-5" class="ui-corner-all" tabindex="-1" role="menuitem">ABOUT US</a>
</li>
<li class="nav item ui-menu-item" role="presentation">
<a href="<?php echo $storeurl.'/contact'.$id; ?>" id="ui-id-6" class="ui-corner-all" tabindex="-1" role="menuitem">SUPPORT</a>
</li>
<li class="nav item ui-menu-item" role="presentation">
<a href="<?php echo $storeurl.'/faq-s'.$id; ?>" id="ui-id-7" class="ui-corner-all" tabindex="-1" role="menuitem">FAQS</a>
</li>
I called this file default_head_blocks.xml it i showing fine