-
AuthorPosts
-
August 28, 2013 at 1:06 pm #190105
Hi,
Maybe you have noticed it. but here i am reporting it in case.
Also a 2nd question: How do you control how many words or characters are disabled before trim off?
Cheers,
Rani
Ninja Lead
Moderator
Ninja Lead
- Join date:
- November 2014
- Posts:
- 16064
- Downloads:
- 310
- Uploads:
- 2864
- Thanks:
- 341
- Thanked:
- 3854 times in 3563 posts
August 29, 2013 at 9:25 am #503912Hi Rani,
Try with my below suggestion:
+ Use cut_string function below to drop title and description in con_content
function cut_string($title, $max)
{
if($title!=''){
if(is_array($title)) list($string, $match_to) = $title;
else { $string = $title; $match_to = $title{0}; }$match_start = stristr($string, $match_to);
$match_compute = strlen($string) - strlen($match_start);if (strlen($string) > $max)
{
if ($match_compute < ($max - strlen($match_to)))
{
$pre_string = substr($string, 0, $max);
$pos_end = strrpos($pre_string, " ");
if($pos_end === false) $string = $pre_string."...";
else $string = substr($pre_string, 0, $pos_end)."...";
}
else if ($match_compute > (strlen($string) - ($max - strlen($match_to))))
{
$pre_string = substr($string, (strlen($string) - ($max - strlen($match_to))));
$pos_start = strpos($pre_string, " ");
$string = "...".substr($pre_string, $pos_start);
if($pos_start === false) $string = "...".$pre_string;
else $string = "...".substr($pre_string, $pos_start);
}
else
{
$pre_string = substr($string, ($match_compute - round(($max / 3))), $max);
$pos_start = strpos($pre_string, " "); $pos_end = strrpos($pre_string, " ");
$string = "...".substr($pre_string, $pos_start, $pos_end)."...";
if($pos_start === false && $pos_end === false) $string = "...".$pre_string."...";
else $string = "...".substr($pre_string, $pos_start, $pos_end)."...";
}$match_start = stristr($string, $match_to);
$match_compute = strlen($string) - strlen($match_start);
}return $string;
}else{
return $string ='';
}
}
Ex: echo cut_string(“Profesionální fotograf zachytí momenty radosti a štestí Vašeho dítete v jeho prirozeném prostredí a to na hrištích, pri hre, sportu, ci jiného konícku, budete tak mít na vždy uchovány vzpomínky, profesionálne zpracované tak jak si budete prát”, 60);
+ Open templates/ja_fixel/html/com_content folder in JA Fixel Template and use cut_string function above if you like
August 29, 2013 at 12:55 pm #503938
hummm :p As a 2nd thought & after figuring out the mechanism you are using. I have decided to do the following ( using your mechanism) :note: I mention it maybe others will find it useful.
For titles you have the following setup for it :
.fixel-grid .items article .item-desc h2 {
font-size: 17px;
font-size: 500;
line-height: 1.3;
max-height: 20px;
margin: 0;
overflow: hidden;
}and I changed it to :
.fixel-grid .items article .item-desc h2 {
font-size: 17px;
line-height: 1.3;
height: 41px;
margin: 0;
overflow: hidden;
}This way there will be space for 2 lines instead of 1.
also I have changed:
.fixel-grid .items.image.none article:hover .pull-left.item-image,
.fixel-grid .items.image.none article:hover .pull-right.item-image,
.fixel-grid .items.image.none article:hover img,
.fixel-grid .items.image.none article:focus .pull-left.item-image,
.fixel-grid .items.image.none article:focus .pull-right.item-image,
.fixel-grid .items.image.none article:focus img,
.fixel-grid .items.image.none article:active .pull-left.item-image,
.fixel-grid .items.image.none article:active .pull-right.item-image,
.fixel-grid .items.image.none article:active img {
-webkit-transform: translateY(-50px);
-moz-transform: translateY(-50px);
-ms-transform: translateY(-50px);
-o-transform: translateY(-50px);
transform: translateY(-50px);
}to :
.fixel-grid .items.image.none article:hover .pull-left.item-image,
.fixel-grid .items.image.none article:hover .pull-right.item-image,
.fixel-grid .items.image.none article:hover img,
.fixel-grid .items.image.none article:focus .pull-left.item-image,
.fixel-grid .items.image.none article:focus .pull-right.item-image,
.fixel-grid .items.image.none article:focus img,
.fixel-grid .items.image.none article:active .pull-left.item-image,
.fixel-grid .items.image.none article:active .pull-right.item-image,
.fixel-grid .items.image.none article:active img {
-webkit-transform: translateY(-70px);
-moz-transform: translateY(-70px);
-ms-transform: translateY(-70px);
-o-transform: translateY(-70px);
transform: translateY(-70px);
}so the image is translated up a 20px more when you hover over it.
-
AuthorPosts
This topic contains 3 replies, has 2 voices, and was last updated by rani 11 years, 5 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum