Guest User

Untitled

a guest
Nov 13th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. public function CmsLink($id,$is_device = null) {
  2. $storeId = $this->_storeManager->getStore()->getId();
  3. $blockData = $this->_pageFactory->setStoreId($storeId)->load($id);
  4. $link = $this->_storeManager->getStore()->getBaseUrl().$blockData->getIdentifier();
  5. $html = "";
  6.  
  7.  
  8. $items_show = intval($this->getItemShow());
  9. if(intval($items_show) < $item)
  10. $read_more = ' readmore';
  11. else
  12. $read_more = '';
  13.  
  14. if($is_device == 'mobile') {
  15. $html ='<li><a href="'.$link.'"><span class="name'.$item.$read_more.'">'.$blockData->getTitle().'</span></a></li>';
  16.  
  17. } else {
  18. $html ='<div class="pt_menu nav-'.$item.$read_more.'" id="pt_cms">
  19. <div class="parentMenu"><a href="'.$link.'"><span>'.$blockData->getTitle().'</span></a></div>
  20. </div>';
  21. }
  22. return $html;
  23.  
  24. }
Add Comment
Please, Sign In to add comment