You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.
Question 1 - Is it possible to disable a category to stop it displaying on the mobile menu?
Question 2 - Is it possible to stop the category description showing in mobile view?
Many thanks
Offline
Question 1 - Is it possible to disable a category to stop it displaying on the mobile menu?
Not without modding the software.
Question 2 - Is it possible to stop the category description showing in mobile view?
Put a blank space in the mobile category description and it will use that.
Offline
In the mean time, I have php enabled in my category descriptions. Could you provide a code snippet I could utilize in the description to determine if the current session is a mobile one. I'm thinking I could utilize it in an if/else expression to display a more appropriate description for the mobile view.
Offline
The category descriptions by default don't use PHP in them, so you're better off just adding a new field to the table in Raw DB Admin for the mobile description, then present that field in the mobile category display, rather than the regular description field.
Offline
Yeah, that shouldn't be too hard, but I'm still interested in learning about identifying the session as mobile using php, if you've got a minute to spare. There are probably a lot of other potential applications for such knowledge, and besides, since I've enabled php in the descriptions, why not use it?
Offline
Correct me if I wrong as I don't use the mobile view, but isn't there a separate Category display that is only used for mobile sessions by default??
Location: System Dashboard > Store > Store Displays > Category Displays > Mobile
You could remove the print $catdesc; line to remove the description altogether, or you could add a new column in the category table and reassign the value of $catdesc in the Mobile only display
Offline
Yeah, zanart, that's the easy way. I'd like know how to do it by identifying the session as a mobile session using php and then providing alternate content using an if/else expression.
Offline
Try this
$this->globals('core.mobile_display');
Offline
How do i disable the mobile viewing mode?
Offline
thanks.
Offline
Hello I tried deleting "print $catdesc;" from the mobile category display, but the description is still visible. Am I missing any additional steps?
Offline
I wanted to remove the category description from the mobile view. So I deleted "print $catdesc;" from the mobile category view, but I'm still able to see the description in mobile view. Any suggestions?
Offline
Yes I'm editing the mobile category display that you mentioned. Thanks.
Offline
Hello:
Yes I'm viewing the site in mobile view on my desktop and cellphone. Here's my code below. You will notice that I'm commented out the "print $catdesc;" line of code. Also I have mobile support enabled. Here's one of the pages of the site I'm working on - http://hahntactical.com/index.php?app=e … el-Defense
<?php
// +--
// | Get variables we need to draw this display.
// +--
$eol = $this->globals('core.eol');
$catdisp = $this->globals('ecom.cat_catdisp');
// +--
// | Check the images.
// +--
$images = $this->check_images(array('category' => array('root' => 'PUBLIC', 'dir' => 'media/ecom/cat', 'list' => $catdisp['catimg'])));
$images = array();
// +--
// | Create the category name and link.
// +--
$catname = $this->xhtml_encode($catdisp['name']);
$catlink = $this->link_namespace('ecom','catshow',array('ref'=>$catdisp['id']),$catdisp['seourl']);
// +--
// | Handle the description based on whether it has
// | XHTML tags in it or not.
// +--
$desc_has_tags = $this->has_tags($catdisp['description']);
if ($desc_has_tags) {
$catdesc = $catdisp['description'];
} else {
$catdesc = '<p>' . $this->xhtml_encode($catdisp['description']) . '</p>';
} // End of if statement.
// +--
// | Create the image tag.
// +--
$imgtag = '';
$imgwidth = 0;
if (!(empty($images['category']))) {
$imglist = $this->make_list($images['category']);
$imgname = $imglist[0];
$imgwidth = $this->globals('core_settings.ecom.imgsizecat');
$imgurl = 'media/ecom/cat/' . $imgname;
$imgwidth = floor($imgwidth * .50);
$imgtag = '<img src="' . $imgurl . '" ';
if ($imgwidth) {$imgtag .= 'width="' . $imgwidth . '" ';}
$imgtag .= 'alt="' . $catname . '" />';
} // End of if statement.
// +--
// | Print the display.
// +--
print '<table class="invisible"><tr><td class="invisible" style="';
if (!(empty($imgtag))) {print 'width: ' . $imgwidth . 'px; ';}
print 'padding: 0px 10px 10px 0px;">' . $eol;
if (!(empty($imgtag))) {
print '<a href="' . $catlink . '" title="' . $catname . '">' . $imgtag . '</a>' . $eol;
print '</td><td class="invisible" style="padding: 0px 10px 10px 0px;">' . $eol;
} // End of if statement.
print '<div class="catlistname">' . $eol;
print '<p><a href="' . $catlink . '" title="' . $catname . '"><strong>' . $catname . '</strong></a></p>' . $eol;
print '</div>' . $eol;
print '<div class="catlistdesc">' . $eol;
// print $catdesc;
print '</div>' . $eol;
print '</td></tr></table>' . $eol;
?>
Last edited by btwebmedia (08-05-2015 09:37:44)
Offline
You're editing the category listing display, which can be seen here:
http://hahntactical.com/index.php?app=e … Gas-Blocks
What you really want to edit is {private}/apps/ecom/ECOM/includes/catshow.php and remove the description from there for the portion of the display that's applicable to mobile.
Offline
Nick:
Which section of the code is for mobile display? I've commented out each description section individually and it removed the description from the mobile and desktop view. Thanks.
Offline