Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • jp Friend
    #202421

    Good day

    I would like the “department” module on main page to be 4 columns block as i only have 8 articles to put into that space
    when i select 4 columns in the alternative layout in the article category the module does not display on page

    I would also like the department page which displays the departments to line up in the blocks, it looks out of proportion if the blocks is not the same height


    1. 1
    2. 2
    Ninja Lead Moderator
    #554216

    The four-columns of Alternative Layout in Articles Category can not support your expectations, but you can try to use my customization below

    + Open templates/ja_medicare/html/mod_articles_category/five-columns.php file

    Find and change

    <div class="category-module-item <?php if($count > 5): echo "border-top"; endif; ?> <?php if($count % 5 != 0): echo "border-right"; endif; ?>">

    To

    <div class="category-module-item <?php if($count > 4): echo "border-top"; endif; ?> <?php if($count % 4 != 0): echo "border-right"; endif; ?>">

    + Create templates/ja_medicare/css/custom.css file and add new rule

    @media (min-width: 768px) {
    .category-module.five-columns .category-module-item {
    border: none;
    width: 25%;
    padding-top: 50px;
    padding-bottom: 0;
    }
    }

    Let me know if it helps

    jp Friend
    #556615

    Hey Ninja

    I went a other way with the department slider
    But still struggeling with the department page blocks… they should all be the same size

    Regards
    JP

    Ninja Lead Moderator
    #556753

    <em>@jptromp 454885 wrote:</em><blockquote>Hey Ninja

    I went a other way with the department slider
    But still struggeling with the department page blocks… they should all be the same size

    Regards
    JP</blockquote>

    Try to use my solution above or you can pm me FTP account of your site. I will help you out.

    Ninja Lead Moderator
    #557344

    <em>@jptromp 454885 wrote:</em><blockquote>Hey Ninja

    I went a other way with the department slider
    But still struggeling with the department page blocks… they should all be the same size

    Regards
    JP</blockquote>

    I fixed the problem directly on your site because the text in Department module are very long, I wrote the cut_string function into templates/ja_medicare/html/com_content/category/department_item.php file for the purpose of stripping text

    Beside that, I added new rule into templates/ja_medicare/css/custom.css file

    .grid-view .item {
    min-height: 350px;
    }

    You can check it on your site, let me know if it helps

    rovisco Friend
    #747194

    Hi,

    I have the same problem, could you help me how to write cut_string function?

    Thanks

    Ninja Lead Moderator
    #681396

    <em>@rovisco 490043 wrote:</em><blockquote>Hi,

    I have the same problem, could you help me how to write cut_string function?

    Thanks</blockquote>

    You can follow the solution about cut_string function here

    Ninja Lead Moderator
    #747333

    <em>@rovisco 490043 wrote:</em><blockquote>Hi,

    I have the same problem, could you help me how to write cut_string function?

    Thanks</blockquote>

    You can follow this thread

    rovisco Friend
    #681551

    <em>@Ninja Lead 490233 wrote:</em><blockquote>You can follow this thread</blockquote>

    I don’t have permissions 🙁

    rovisco Friend
    #747414

    <em>@Ninja Lead 490233 wrote:</em><blockquote>You can follow this thread</blockquote>

    I don’t have permissions 🙁

    Ninja Lead Moderator
    #681583

    <em>@rovisco 490349 wrote:</em><blockquote>I don’t have permissions :(</blockquote>

    I copied that function below


    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 ='';
    }
    }

    With $title: string needs to trim
    $max: Number character

    Use it: cut_string($data, 50);

    Ninja Lead Moderator
    #747446

    <em>@rovisco 490349 wrote:</em><blockquote>I don’t have permissions :(</blockquote>

    I copied that function below


    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 ='';
    }
    }

    With $title: string needs to trim
    $max: Number character

    Use it: cut_string($data, 50);

Viewing 12 posts - 1 through 12 (of 12 total)

This topic contains 12 replies, has 3 voices, and was last updated by  Ninja Lead 9 years, 2 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum