category blog format (intro columns)

Need help with the Administration of your Joomla! 1.5 site? This is the spot for you.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
afrenyo
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Fri Feb 08, 2008 8:34 pm

category blog format (intro columns)

Postby afrenyo » Fri Feb 08, 2008 9:03 pm

hi there,

as it stands, i have only been able to apply two columns to a category blog layout (through its calling menu item) in such a way that the article intros get listed all the way down on the left, then continue on top of the next column.

ex.
+column1
-article1
-article2
-article3

+column2
-article4
-article5
-article6

is there a way to make the intros go left to right in a row across columns, then continue down to the next row?

ex.
+column1
-article1
-article3
-article5

+column2
-article2
-article4
-article6

Thanks.

NikonUser
Joomla! Apprentice
Joomla! Apprentice
Posts: 34
Joined: Mon Aug 20, 2007 3:01 am

Re: category blog format (intro columns)

Postby NikonUser » Tue Apr 15, 2008 6:43 am

Did you find an answer to this problem? I am experiencing the same thing and would love to change it.

Paul

DB5
Joomla! Apprentice
Joomla! Apprentice
Posts: 30
Joined: Sun Feb 10, 2008 1:01 pm

Re: category blog format (intro columns)

Postby DB5 » Tue Apr 15, 2008 5:27 pm

me aswell! thanks!

afrenyo
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Fri Feb 08, 2008 8:34 pm

Re: category blog format (intro columns)

Postby afrenyo » Tue Apr 15, 2008 11:33 pm

No, I'm afraid no one has been able to help me out.

NikonUser
Joomla! Apprentice
Joomla! Apprentice
Posts: 34
Joined: Mon Aug 20, 2007 3:01 am

Re: category blog format (intro columns)

Postby NikonUser » Wed Apr 16, 2008 5:28 am

Apparently a Template Override will do the trick.

I have very little programming knowledge but I will see if I can work something out over the next few days.

I'm really surprised this isn't a bigger issue. Maybe we are missing something?

Paul

NikonUser
Joomla! Apprentice
Joomla! Apprentice
Posts: 34
Joined: Mon Aug 20, 2007 3:01 am

Re: category blog format (intro columns)

Postby NikonUser » Wed Apr 16, 2008 9:06 am

I'm really hoping someone with some knowhow will chime in here. I am trying my best but my programming knowledge is very limited. Especially when it comes to all the Joomla variables and such.

I have modified the
->componants->com_content->section->tmpl->blog.php

and tried to use it as a template override by putting it in

->MYTEMPLATE->html->com_content->section->blog.php (this will only modify the blog layout of a section to do a category you will need to put the file in ->category->blog.php)

Here is the code I am using. It's not even nearly perfect (it uses tables, still not completed) but it is a starting point that maybe someone (along with me playing around) can work on.

EDIT: SEE THE POST BELOW FOR UPDATED CODE (COPY/PASTED FROM ACTUAL JOOMLA CODE)
Last edited by NikonUser on Wed Apr 16, 2008 9:26 am, edited 2 times in total.

NikonUser
Joomla! Apprentice
Joomla! Apprentice
Posts: 34
Joined: Mon Aug 20, 2007 3:01 am

Re: category blog format (intro columns)

Postby NikonUser » Wed Apr 16, 2008 9:21 am

UPDATE:

I just had a thought (rare for me)... Since the layout on the front page works from left to right I could steal the code used in: (only the bit that arranges the articles)

->components->com_content->frontpage->tmpl->default.php

as a template override. This achieves exactly what I was trying to do before but with code made by the Joomla team (which is much better than my code!!!). So this should now work perfectly. I will attach the file that you need to upload as a template override.

Code: Select all

<?php
defined('_JEXEC') or die('Restricted access');
$cparams =& JComponentHelper::getParams('com_media');
?>
<?php if ($this->params->get('show_page_title')) : ?>
<div class="componentheading<?php echo $this->params->get('pageclass_sfx');?>">
   <?php echo $this->escape($this->params->get('page_title')); ?>
</div>
<?php endif; ?>
<table class="blog<?php echo $this->params->get('pageclass_sfx'); ?>" cellpadding="0" cellspacing="0">
<?php if ($this->params->def('show_description', 1) || $this->params->def('show_description_image', 1)) :?>
<tr>
   <td valign="top">
   <?php if ($this->params->get('show_description_image') && $this->section->image) : ?>
      <img src="<?php echo $this->baseurl . '/' . $cparams->get('image_path') . '/'. $this->section->image;?>" align="<?php echo $this->section->image_position;?>" hspace="6" alt="" />
   <?php endif; ?>
   <?php if ($this->params->get('show_description') && $this->section->description) : ?>
      <?php echo $this->section->description; ?>
   <?php endif; ?>
      <br/>
      <br/>
   </td>
</tr>
<?php endif; ?>
<?php if ($this->params->def('num_leading_articles', 1)) : ?>
<tr>
   <td valign="top">
   <?php for ($i = $this->pagination->limitstart; $i < ($this->pagination->limitstart + $this->params->get('num_leading_articles')); $i++) : ?>
      <?php if ($i >= $this->total) : break; endif; ?>
      <div>
      <?php
         $this->item =& $this->getItem($i, $this->params);
         echo $this->loadTemplate('item');
      ?>
      </div>
   <?php endfor; ?>
   </td>
</tr>
<?php else : $i = $this->pagination->limitstart; endif; ?>

<?php
$startIntroArticles = $this->pagination->limitstart + $this->params->get('num_leading_articles');
$numIntroArticles = $startIntroArticles + $this->params->get('num_intro_articles', 4);
if (($numIntroArticles != $startIntroArticles) && ($i < $this->total)) : ?>
<tr>
   <td valign="top">
      <table width="100%"  cellpadding="0" cellspacing="0">
      <tr>
      <?php
         $divider = '';
         for ($z = 0; $z < $this->params->def('num_columns', 2); $z ++) :
            if ($z > 0) : $divider = " column_separator"; endif; ?>
            <?php
                $rows = (int) ($this->params->get('num_intro_articles', 4) / $this->params->get('num_columns'));
                $cols = ($this->params->get('num_intro_articles', 4) % $this->params->get('num_columns'));
            ?>
            <td valign="top" width="<?php echo intval(100 / $this->params->get('num_columns')) ?>%" class="article_column<?php echo $divider ?>">
            <?php
            $loop = (($z < $cols)?1:0) + $rows;
            
            for ($y = 0; $y < $loop; $y ++) :
               $target = $i + ($y * $this->params->get('num_columns')) + $z;
               if ($target < $this->total && $target < ($numIntroArticles)) :
                  $this->item =& $this->getItem($target, $this->params);
                  echo $this->loadTemplate('item');
               endif;
            endfor;
            ?>
            </td>
      <?php endfor; ?>
      <?php $i = $i + $this->params->get('num_intro_articles') ; ?>
      </tr>
      </table>
   </td>
</tr>
<?php endif; ?>
<?php if ($this->params->def('num_links', 4) && ($i < $this->total)) : ?>
<tr>
   <td valign="top">
      <div class="blog_more<?php echo $this->params->get('pageclass_sfx') ?>">
         <?php
            $this->links = array_splice($this->items, $i - $this->pagination->limitstart);
            echo $this->loadTemplate('links');
         ?>
      </div>
   </td>
</tr>
<?php endif; ?>

<?php if ($this->params->def('show_pagination', 2)) : ?>
<tr>
   <td valign="top" align="center">
      <?php echo $this->pagination->getPagesLinks(); ?>
      <br /><br />
   </td>
</tr>
<?php endif; ?>
<?php if ($this->params->def('show_pagination_results', 1)) : ?>
<tr>
   <td valign="top" align="center">
      <?php echo $this->pagination->getPagesCounter(); ?>
   </td>
</tr>
<?php endif; ?>
</table>



[YOUR TEMPLATE]->html->com_content->section->
[YOUR TEMPLATE]->html->com_content->category->

(choose one or both of the above depending on what your needs are)

This works perfectly for me. I hope it works for someone else having trouble as well.

Paul

User avatar
dwizer
Joomla! Apprentice
Joomla! Apprentice
Posts: 27
Joined: Mon Sep 24, 2007 6:19 am

Re: category blog format (intro columns)

Postby dwizer » Thu Apr 24, 2008 2:21 pm

I have the same problem..

Hmm i'm not following :( Where to put that code? What file?

Maybe a stupid question but i'm new to Joomla and don't have any coding experience =( So maybe you can write a step by step guide for a newbie? Because this is really annoying when you have a lot of pages with articles that needs to be sorted in the right way ;)

Thanks / Mats

ando66
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Tue Apr 15, 2008 12:55 am

Re: category blog format (intro columns)

Postby ando66 » Sat Apr 26, 2008 1:01 am

It would be great to fix this problem! But I also don't know how to do this (i.e what file, what name etc) ... I'm using a template I made myself so don't have any template overrides at all.

ando66
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Tue Apr 15, 2008 12:55 am

Re: category blog format (intro columns)

Postby ando66 » Sat Apr 26, 2008 1:44 am

nikonuser is a frigging genius!

Worked it out with a bit of trial and error ... All you do is as he mentions, cut and paste his code into a file called blog.php and save it to

[YOUR TEMPLATE]->html->com_content->category->

And that it - it works like a dream ... I'm guessing saving that file to

[YOUR TEMPLATE]->html->com_content->section->

Would work also for sections ....

I'm using a custom template without lots of frills etc, very basic, and I didn't need to touch any other part of the template, I just created those 2 files... too easy

Worked for me on joomla 1.5.3 ..... THANKS NIKONUSER!!!!!!!!!!

User avatar
dwizer
Joomla! Apprentice
Joomla! Apprentice
Posts: 27
Joined: Mon Sep 24, 2007 6:19 am

Re: category blog format (intro columns)

Postby dwizer » Sat Apr 26, 2008 9:23 am

Ah now i understand :) Works perfect..

So you have to CREAT the directories /html/com_content/category/ inside your template dir and put the blog.php inside :) I was looking for the directories but didn't found them so i thought something was wrong or that it wouldn't work with just MY template..

Stupid how blind you can be sometimes :P I hope all newbies like myself, can fix this now!

Maybe someone can tell the mighty joomla coders about this problem if its not already done?

Thank u, thank u :)) you are my hero!

/ Mats

User avatar
humvee
Joomla! Master
Joomla! Master
Posts: 14713
Joined: Wed Aug 17, 2005 10:27 pm
Location: Kent, England

Re: category blog format (intro columns)

Postby humvee » Sat Apr 26, 2008 12:26 pm

Unfortunately it seems whilst this matter was reported Tracker 10691 - someone somewhere has decided that correct historical means of reading - left to right and then down the page, left to right - does not apply to Joomla! and has therefore been dismissed out of hand as something for Webmasters to fix!!

Andy

kurtroesand
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Wed Jul 18, 2007 3:41 pm

Re: category blog format (intro columns)

Postby kurtroesand » Fri May 09, 2008 8:12 am

I'm baffled that Joomla does this. :eek:

How hard could it be for the Joomla developers to add an option in the 'Parameters - Basic' panel so that the users can select 'left to right' or 'top to bottom' reading?

greyham
Joomla! Intern
Joomla! Intern
Posts: 55
Joined: Tue Jul 15, 2008 5:02 am
Contact:

Re: category blog format (intro columns)

Postby greyham » Sat Dec 27, 2008 12:46 am

I've noticed this too; If I have the default category blog layout settings with only 3 articles in the category, I get one article at the top and a column on the left with the other two, and a big empty column on the right. Does anyone know whether this issue is going to be fixed in the core, or are we going to have to hack templates?

scoobysue
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Mon Nov 30, 2009 11:32 am

Re: category blog format (intro columns)

Postby scoobysue » Mon Nov 30, 2009 11:37 am

Hi, I was just reading this and I know it is late - but you can control this under the menus
Go the menu link which is for the category blog you are listing.
In the parameters under ADVANCED
it states Multi column order Across or Down
make sure you click ACROSS
this will mean you will get the articles reading across and down rather than down.

;)

User avatar
joomfriend
Joomla! Explorer
Joomla! Explorer
Posts: 277
Joined: Sun Feb 08, 2009 5:10 pm
Contact:

Re: category blog format (intro columns)

Postby joomfriend » Mon Dec 14, 2009 7:38 am

scoobysue wrote:Hi, I was just reading this and I know it is late - but you can control this under the menus
Go the menu link which is for the category blog you are listing.
In the parameters under ADVANCED
it states Multi column order Across or Down
make sure you click ACROSS
this will mean you will get the articles reading across and down rather than down.

;)


Better late than never. Thanks very much for the tip. It helps. I was trying to figure out how to have articles reading across and down. I knew it was possible from the backend without any hack but i couldn't find my way.

Many thanks
- http://www.brasperto.com.br: BrasPerto - Free Business Website Directory
- http://www.egliseprimitive.org: Christian Website

User avatar
wangbia
Joomla! Apprentice
Joomla! Apprentice
Posts: 17
Joined: Wed Nov 25, 2009 12:04 am

Re: category blog format (intro columns)

Postby wangbia » Wed Mar 17, 2010 11:57 am

Better late than never. Thanks very much for the tip. It helps. I was trying to figure out how to have articles reading across and down. I knew it was possible from the backend without any hack but i couldn't find my way.

Many thanks[/quote]

I've worked this solutions in and out every way possible and still do not have success with 3 or 4 columns reading across then down on a category/blog page.

Neither did the above provided template over ride.

I'm using v. 1.5.15 and wonder if changes in that latest version are causing the problem.

I am not enough of a php programmer to be able to decipher it.

Still looking for help... :( ???
Paul Anderson
Longview, TX

User avatar
nooblarama
Joomla! Intern
Joomla! Intern
Posts: 54
Joined: Fri Oct 12, 2007 10:31 am
Location: Australia

Re: category blog format (intro columns)

Postby nooblarama » Tue May 04, 2010 3:22 am

Yeah same problem as wangbia on 1.5.15.
doesnt matter what you change in the category blog layout of a menu item, it stays as one header and one column with 2nd 3rd 4th articles streaming down the left side column and a big empty right column.
sighs...

jsh123
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Fri Jun 18, 2010 6:38 pm

Re: category blog format (intro columns)

Postby jsh123 » Mon Oct 11, 2010 1:03 pm

Seems this also is an issue in Joomla 1.5.20..

Only one column..

antaraflo
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Wed Aug 04, 2010 5:14 am

Re: category blog format (intro columns) WITHOUT columns

Postby antaraflo » Mon Jan 16, 2012 8:37 pm

Hello, I came here looking for a solution for editing the categories default columns, because I needed just one .

The code that i´m using to do this is:

Code: Select all

   
              <?php
         $divider = '';
         for ($z = 0; $z < $this->params->get('num_columns'); $z ++) :
          if ($z > 0) : $divider = " column_separator"; endif; ?>
            <td valign="top" width="1000px" class="article_column">
            <?php for ($y = 0; $y < ($this->params->get('num_intro_articles')); $y ++) :
            if ($i < $this->total && $i < ($numIntroArticles)) :
                  $this->item =& $this->getItem($i, $this->params);
                  echo $this->loadTemplate('item');
                  $i ++;
            endif;
         endfor; ?>
            </td>
      <?php endfor; ?>
       


The file is in: "<your joomla! home>components/com_content/views/category/tmpl/blog.php


Create the override directory for the Category Blog as follows: "<your joomla! home>/templates/<your template>/html/com_content/category/blog.php

I attach the entire override blog.php also.


Hope that helps to somebody!
You do not have the required permissions to view the files attached to this post.


Return to “Administration 1.5”

Who is online

Users browsing this forum: No registered users and 12 guests