Your Cart is currently empty!
Product update
Coupon
add
Coupon code invalid! Please re-enter!
AJAX loader
You are here: HomeForum
Welcome, Guest

[SOLVED] MegaMenu - number of characters of the article title
(1 viewing) (1) Guest
Userguide, Report bugs, New Ideas...
  • Page:
  • 1
  • 2

TOPIC: [SOLVED] MegaMenu - number of characters of the article title

Re: MegaMenu - number of characters of the article title 10 years, 4 months ago #14526

  • rymy
  • OFFLINE
  • Single Product
  • Junior Boarder
  • Posts: 39
  • Karma: 0
I'm a little confused right now because:

-> Mega Content Type in "YT Menu Params for this Menu Item" of menu item "You and your family" is type Module .


I don't have menu item like: "You and your family". There is menu item like "Health" which is type "positions".

My "templates" folder contains "sj_news25" subfolder (if it's matter) so, path to "default.php" file in my case is:

your_site\templates\sj_news25\html\mod_articles_latest\default.php

but my default.php file contains:
<?php
/**
 * @version		$Id: default.php 20196 2011-01-09 02:40:25Z ian $
 * @package		Joomla.Site
 * @subpackage	mod_articles_latest
 * @copyright	Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */

// no direct access
defined('_JEXEC') or die;
$app =& JFactory::getApplication();

include_once (JPATH_THEMES . DS . $app->getTemplate() . DS . 'includes'. DS .'image.class.php');
	
?>

<ul class="latestnews<?php echo $moduleclass_sfx; ?>">
<?php 
	$i=1;
	
	//echo "<pre>".print_r($list,1);die;
	foreach ($list as $item) :  
	$yti = new YtImageJoomlaContent();
	$str = $yti->processImage($item);
	//echo $item->link;die;
?>
	<li>
		<?php if($moduleclass_sfx==' trending-news'){?><span><?php echo $i;?></span><?php } ?>
		<a href="<?php echo $item->link; ?>">
			<?php echo $item->title; ?><?php if($moduleclass_sfx==' trending-news'):?>	
		<?php echo substr($item->introtext,0,28).'</p>';//die;?>
		<?php endif;?></a>
		<?php if($moduleclass_sfx==' lastest_news'):?>	
		<?php echo substr($item->introtext,0,50).'...'.'</p>';//die;?>
		<?php endif;?>
	</li>
<?php 
	$i ++;
	endforeach; ?>
</ul>
<?php if($moduleclass_sfx==''){?><a href="<?php echo $item->catlink;?>" class="more-news"><?php echo 'Więcej...';?></a><?php } ?>
<?php if($moduleclass_sfx==' trending-news'){?><a href="#" class="see-all"><?php echo 'See all trends';?></a><?php } ?>


there is no such a thing like:

<a class="font_size<?php echo $i;?>" href="<?php echo $item->link; ?>"><?php echo $item->title; ?></a>
		
		<?php } else{ ?>
			<a href="<?php echo $item->link; ?>"><?php echo $item->title; ?></a>



Thank you for your patience.

Re: MegaMenu - number of characters of the article title 10 years, 4 months ago #14532

  • rymy
  • OFFLINE
  • Single Product
  • Junior Boarder
  • Posts: 39
  • Karma: 0
OK, I think I have what I want.
I put name "char_limit" into "Module Class Suffix" of every module I wanted to have title shorter, and made this change to:

your_site\templates\sj_news25\html\mod_articles_latest\default.php

<li>
		<?php if($moduleclass_sfx==' trending-news'){?><span><?php echo $i;?></span><?php } ?>
		<a href="<?php echo $item->link; ?>">
			<?php echo $item->title; ?><?php if($moduleclass_sfx==' trending-news'):?>	
		<?php echo substr($item->introtext,0,28).'</p>';//die;?>
		<?php endif;?></a>
		<?php if($moduleclass_sfx==' lastest_news'):?>	
		<?php echo substr($item->introtext,0,50).'...'.'</p>';//die;?>
		<?php endif;?>
	</li>




	<li>
		<?php if($moduleclass_sfx==' trending-news'){?><span><?php echo $i;?></span><?php } ?>
		<a href="<?php echo $item->link; ?>">
			<?php if($moduleclass_sfx==' char_limit') echo substr($item->title,0,20);
			else echo $item->title;?>
		
		<?php if($moduleclass_sfx==' trending-news'):?>	
		<?php echo substr($item->introtext,0,28).'</p>';//die;?>
		<?php endif;?></a>


		<?php if($moduleclass_sfx==' lastest_news'):?>	
		<?php echo substr($item->introtext,0,50).'...'.'</p>';//die;?>
		<?php endif;?>
	</li>


It seems to be working, so thank you for directions!
The following user(s) said Thank You: anhqn
  • Page:
  • 1
  • 2
Time to create page: 0.23 seconds

Notification

Please find your issue via Suggested Posts before submitting your question. We have solved the most of issues and maybe your issue was solved before.

Latest My Topics

No posts to display.

Love all our templates?

Join our membership clubs starting at $49 only for access to all of our templates

Join Now
Home Pricing
Your Cart is currently empty!
Product update
Coupon
add
Coupon code invalid! Please re-enter!
AJAX loader
SearchSupport
Magento Themes Magento Extensions Free Magento Extensions Prestashop Themes Prestashop Modules Magento 2 Themes