tha_phu Posted October 25, 2013 Share Posted October 25, 2013 (edited) I've searched in this forum for a while now but didn't find any conclusion to my problem. For easier understanding here a link to my shop: artwave.lacerta.uberspace.de/en/ In the CMS i added a sub cms-category named "social" and added 2 cms pages "social stream" and "videos" to that category. Then i added the supcategory to the blocktopmenu. The problem is, when you click on "social" directly you are directed to a category page with just this content: --------------------------- SOCIAL List of pages in Social: Social stream Videos ----------------------------- First of all, how can I change the content of that page ? Is it possible to change the of "social" ? And is it possible to rename just the title shown in the menu without chanigng the name of the cms category ? What I wanted to do is, to change the title displayed in the menu from "social" to "artwave" and link to the index page without changing the cms-category name? Thanks for your help! Edited October 27, 2013 by vekia (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted October 25, 2013 Share Posted October 25, 2013 SOCIAL is an category, you cant edit it. if you want to change name of this page without changing category name, you have to modify blocktopmenu.php file it will be a bit hard if you don't know basics in php, anyway, you have to modify this: case 'CMS_CAT': $category = new CMSCategory((int)$id, (int)$id_lang); if (count($category)) { $this->_menu .= '<li><a href="'.Tools::HtmlEntitiesUTF8($category->getLink()).'">'.$category->name.'</a>'; $this->getCMSMenuItems($category->id); $this->_menu .= '</li>'.PHP_EOL; } break; add there if condition to check category id, if id== id of SOCIAL - instead of $category->name use own name 1 Link to comment Share on other sites More sharing options...
stottycabanas Posted October 26, 2013 Share Posted October 26, 2013 tha_phu, one alternative might be to set 'Social' as a CMS Page, not a CMS category. Then you can include the links to the other CMS pages within it, and also edit the content to your requirements. The only downside is that you wouldn't get the other CMS pages appearing as a dropdown when you hover on Social in the horizontal menu. Another idea. I don't know much about php really, but looking at Vekia's code snippet above, I wonder if you could just remove href="'.Tools::HtmlEntitiesUTF8($category->getLink()).'" so that if you have a CMS category in the top menu, it doesn't link to anywhere. You'd therefore have to select the other CMS pages from the dropdown. I don't know if that's feasible, though, perhaps just try it in a test shop. Cheers, Dave 1 Link to comment Share on other sites More sharing options...
tha_phu Posted October 26, 2013 Author Share Posted October 26, 2013 Thanks a lot for your suggestions, vekia & scotty cabanas! @vekia: I tried to modify the code as you described but it does not work.... what am I doing wrong? case 'CMS_CAT': $category = new CMSCategory((int)$id, (int)$id_lang); if ($id == 2) { $this->_menu .= '<li><a href="'.artwave.lacerta.uberspace.de.'">'.Artwave.'</a>'; $this->getCMSMenuItems($category->id); $this->_menu .= '</li>'.PHP_EOL; } if (count($category)) { $this->_menu .= '<li><a href="'.htmlentities($category->getLink()).'">'.$category->name.'</a>'; $this->getCMSMenuItems($category->id); $this->_menu .= '</li>'.PHP_EOL; } break; Link to comment Share on other sites More sharing options...
vekia Posted October 26, 2013 Share Posted October 26, 2013 after changes you have to clear shop cache, or just open module configuration page and hit save button (module cache will be regenerated) 1 Link to comment Share on other sites More sharing options...
tha_phu Posted October 26, 2013 Author Share Posted October 26, 2013 Thanks a lot for the hint with the cache! I got it nearly working the way i want it to. Thank you very much so far! I've got just one little Problem. The link is wrong, when you click on Artwave - you are staying on the page you are. But it should be a link to artwave.lacerta.uberspace.de How do I do that ? case 'CMS_CAT': $category = new CMSCategory((int)$id, (int)$id_lang); if ($id == 2) { $this->_menu .= '<li><a href="'."".'">'.Artwave.'</a>'; $this->getCMSMenuItems($category->id); $this->_menu .= '</li>'.PHP_EOL; } if (count($category)) { if ($id == 2) { } else { $this->_menu .= '<li><a href="'.htmlentities($category->getLink()).'">'.$category->name.'</a>'; $this->getCMSMenuItems($category->id); $this->_menu .= '</li>'.PHP_EOL; } } break; Link to comment Share on other sites More sharing options...
vekia Posted October 26, 2013 Share Posted October 26, 2013 instead of: $this->_menu .= '<li><a href="'."".'">'.Artwave.'</a>'; use: $this->_menu .= '<li><a href="'."http://artwave.lacerta.uberspace.de".'">'.Artwave.'</a>'; 2 Link to comment Share on other sites More sharing options...
tha_phu Posted October 27, 2013 Author Share Posted October 27, 2013 Thank you so much! Now it works just fine! Link to comment Share on other sites More sharing options...
vekia Posted October 27, 2013 Share Posted October 27, 2013 you're welcome im so glad that i could help you a little in this case thank you for confirmation that it works now it's time to mark this thread as [solved] btw. Welcome on board! Link to comment Share on other sites More sharing options...
tha_phu Posted October 27, 2013 Author Share Posted October 27, 2013 Thanks for the warm welcome and marking the thread as [solved]. I like it here so far Link to comment Share on other sites More sharing options...
Recommended Posts