Jump to content

Remove some CMS links in mobile site view


rialni

Recommended Posts

Hi,

 

In the mobile version of the site, I've managed to remove most of the links that I didn't want but there's one thing I just can't figure out.

 

In the list of CMS pages, it's not all of them I want to show up, since 2-3 of them look awful on the mobile, so they should only be available in the web version. Some of them I still want though, so I can't just remove the link to CMS pages.

 

Does anyone know how to do this type of sorting? 

 

 

 

site is philippejse(dot)dk

Link to comment
Share on other sites

Hi Krystian,

 

In the mobile site version there's no footer link etc. If you take a look at the site (philippejse(dot)dk) and change to mobile view, it's the menu point called 'Nyttig Information', third from bottom. When you click on that, you get to the full list of CMS pages on the site. Since two of these look awful, I wish to take them out, but keep the ones that are important, like "åbningstider" (opening hours).

 

The ones I wish to take out are the ones called: "Kataloger" and "Nyheder" - if I can't take them out I just need to find a way to make them look okay, as it's currently a mess to look at :(

 

Thanks for looking at this with me :)

Link to comment
Share on other sites

themes/default/mobile/categry-cms-tree-branch.tpl

 

there is a code like:
 

		{if isset($node.cms) && $node.cms|@count > 0}
			{foreach from=$node.cms item=cms name=cmsTreeBranch}
				<li><a href="{$cms.link|escape:'htmlall':'UTF-8'}" title="{$cms.meta_title|escape:'htmlall':'UTF-8'}" data-ajax="false">{$cms.meta_title|escape:'htmlall':'UTF-8'}</a></li>
			{/foreach}
		{/if}

replace code:
 

<li><a href="{$cms.link|escape:'htmlall':'UTF-8'}" title="{$cms.meta_title|escape:'htmlall':'UTF-8'}" data-ajax="false">{$cms.meta_title|escape:'htmlall':'UTF-8'}</a></li>

with:

{if $cms.id!=9 || $cms.id!=4}<li><a href="{$cms.link|escape:'htmlall':'UTF-8'}" title="{$cms.meta_title|escape:'htmlall':'UTF-8'}" data-ajax="false">{$cms.meta_title|escape:'htmlall':'UTF-8'}</a></li>{/if}
  • Like 1
Link to comment
Share on other sites

Thank you Vekia, but unfortunately it didn't do the trick. The list is still the same and when I do an F5 update, it says the page can't be shown. 

 

Here's my new code in category_cms_tree_branch.tpl:

 

{if isset($node.cms) && $node.cms|@count > 0}
{foreach from=$node.cms item=cms name=cmsTreeBranch}
{if $cms.id!=9 || $cms.id!=4}<li><a href="{$cms.link|escape:'htmlall':'UTF-8'}" title="{$cms.meta_title|escape:'htmlall':'UTF-8'}" data-ajax="false">{$cms.meta_title|escape:'htmlall':'UTF-8'}</a></li>{/if}

 

Link to comment
Share on other sites

The best way to do things like that is adding dynamic class to <li>, in this way:

{if isset($node.cms) && $node.cms|@count > 0}
            {foreach from=$node.cms item=cms name=cmsTreeBranch}
                <li class="cms_page_{$cms.id_cms}"><a href="{$cms.link|escape:'htmlall':'UTF-8'}" title="{$cms.meta_title|escape:'htmlall':'UTF-8'}" data-ajax="false">{$cms.meta_title|escape:'htmlall':'UTF-8'}</a></li>
            {/foreach}
        {/if}

Now you can hide your pages in CSS by adding for example:

.cms_page_20,
.cms_page_9 {
     display: none;
}

I think that vekia solution should also works but you need to use id_cms instead of id in loop.

Edited by Krystian Podemski (see edit history)
  • Like 1
Link to comment
Share on other sites

Thanks Krystian. I tried your solution also, but again with no luck. I don't understand what I'm doing wrong here :(

 

I replaced with the code you gave and hid the CMS-pages in question in global.css (mobile) like you suggested and then tried jpm-docs.css but none of the two work.

 

I'm starting to pull out my own hair  :wacko:

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...