skinnybloke Posted November 25, 2013 Share Posted November 25, 2013 Hi - I'm trying to use this code within cms.tpl to display a list of all my active CMS pages. {foreach from=CMS::getCMSPages(null,null,true) item=cmspages} <li> <a href="{$link->getCMSLink($cmspages.id_cms, $cmspages.link_rewrite)|escape:'htmlall':'UTF-8'}">{$cmspages.meta_title|escape:'htmlall':'UTF-8'}</a> </li> {/foreach} The links are forming correctly but the meta_title's are not displaying - like this: <li> <a href="http://www.domain.co.uk/content/1-deliveries-returns"></a></li> I am using v1.5.5.0 Help??? Link to comment Share on other sites More sharing options...
vekia Posted November 25, 2013 Share Posted November 25, 2013 drop $cmspages variable contents, i suppose that you've got array with all lagnuages instead of only one language {$cmspages|var_dump} Link to comment Share on other sites More sharing options...
skinnybloke Posted November 25, 2013 Author Share Posted November 25, 2013 Hi - assuming you mean this - it gives me exactly the same result {foreach from=CMS::getCMSPages() item=cmspages} Link to comment Share on other sites More sharing options...
vekia Posted November 26, 2013 Share Posted November 26, 2013 inside foreach loop use this variable: {$cmspages|var_dump} you will see all available fields to use. After that, can you show results please? Link to comment Share on other sites More sharing options...
skinnybloke Posted November 27, 2013 Author Share Posted November 27, 2013 This is what I get: array(4) { ["id_cms"]=> string(1) "4" ["id_cms_category"]=> string(1) "1" ["position"]=> string(1) "0" ["active"]=> string(1) "1" } array(4) { ["id_cms"]=> string(2) "18" ["id_cms_category"]=> string(1) "1" ["position"]=> string(1) "1" ["active"]=> string(1) "1" array(4) { ["id_cms"]=> string(2) "19" ["id_cms_category"]=> string(1) "1" ["position"]=> string(1) "2" ["active"]=> string(1) "1" } Link to comment Share on other sites More sharing options...
vekia Posted November 27, 2013 Share Posted November 27, 2013 it looks like static function that you use returns empty (or wrong) values, you used this: {foreach from=CMS::getCMSPages() item=cmspages} ? or {foreach from=CMS::getCMSPages(null,null,true) item=cmspages} ? Link to comment Share on other sites More sharing options...
skinnybloke Posted November 28, 2013 Author Share Posted November 28, 2013 Ok - got it working using {foreach from=CMS::getCMSPages(2,1,true) item=cmspages} Thanks for your time on this. Link to comment Share on other sites More sharing options...
vekia Posted November 28, 2013 Share Posted November 28, 2013 thank you for confirmation i marked this topic as [solved] with regards, Milos Link to comment Share on other sites More sharing options...
Assramm (cz) Posted November 8, 2016 Share Posted November 8, 2016 {foreach from=CMS::getCMSPages(1,1,true) item=cmspages} <li> <a href="{$link->getCMSLink($cmspages.id_cms, $cmspages.link_rewrite)|escape:'htmlall':'UTF-8'}">{$cmspages.meta_title|escape:'htmlall':'UTF-8'}</a> </li> {/foreach} Hello all, please, can you help me upgrade code up for multi-language store? (after switching between languages, names of articles are still in language id 1, links too) I tried to replace language id by ({$id_lang}) to fill this ID automaticly, but it is not working:/ (Im not PHP skilled) ... Seccond thing is, please is possible show small part of content to? I have PS v1.6. Thank you very much, Jiri. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now