The Joomla! Forum ™



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.



Post new topic Reply to topic  [ 20 posts ] 
Author Message
PostPosted: Fri Feb 08, 2008 9:03 pm 
Joomla! Fledgling
Joomla! Fledgling

Joined: Fri Feb 08, 2008 8:34 pm
Posts: 2
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.


Top
 Profile  
 
PostPosted: Tue Apr 15, 2008 6:43 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Mon Aug 20, 2007 3:01 am
Posts: 34
Did you find an answer to this problem? I am experiencing the same thing and would love to change it.

Paul


Top
 Profile  
 
PostPosted: Tue Apr 15, 2008 5:27 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sun Feb 10, 2008 1:01 pm
Posts: 30
me aswell! thanks!


Top
 Profile  
 
PostPosted: Tue Apr 15, 2008 11:33 pm 
Joomla! Fledgling
Joomla! Fledgling

Joined: Fri Feb 08, 2008 8:34 pm
Posts: 2
No, I'm afraid no one has been able to help me out.


Top
 Profile  
 
PostPosted: Wed Apr 16, 2008 5:28 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Mon Aug 20, 2007 3:01 am
Posts: 34
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


Top
 Profile  
 
PostPosted: Wed Apr 16, 2008 9:06 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Mon Aug 20, 2007 3:01 am
Posts: 34
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.

Top
 Profile  
 
PostPosted: Wed Apr 16, 2008 9:21 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Mon Aug 20, 2007 3:01 am
Posts: 34
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:
<?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


Top
 Profile  
 
PostPosted: Thu Apr 24, 2008 2:21 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice

Joined: Mon Sep 24, 2007 6:19 am
Posts: 27
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


Top
 Profile  
 
PostPosted: Sat Apr 26, 2008 1:01 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Tue Apr 15, 2008 12:55 am
Posts: 5
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.


Top
 Profile  
 
PostPosted: Sat Apr 26, 2008 1:44 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Tue Apr 15, 2008 12:55 am
Posts: 5
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!!!!!!!!!!


Top
 Profile  
 
PostPosted: Sat Apr 26, 2008 9:23 am 
User avatar
Joomla! Apprentice
Joomla! Apprentice

Joined: Mon Sep 24, 2007 6:19 am
Posts: 27
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


Top
 Profile  
 
PostPosted: Sat Apr 26, 2008 12:26 pm 
User avatar
Joomla! Master
Joomla! Master

Joined: Wed Aug 17, 2005 10:27 pm
Posts: 14715
Location: Kent, England
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


Top
 Profile  
 
PostPosted: Fri May 09, 2008 8:12 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Wed Jul 18, 2007 3:41 pm
Posts: 8
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?


Top
 Profile  
 
PostPosted: Sat Dec 27, 2008 12:46 am 
Joomla! Intern
Joomla! Intern

Joined: Tue Jul 15, 2008 5:02 am
Posts: 55
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?


Top
 Profile  
 
PostPosted: Mon Nov 30, 2009 11:37 am 
Joomla! Fledgling
Joomla! Fledgling

Joined: Mon Nov 30, 2009 11:32 am
Posts: 3
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.

;)


Top
 Profile  
 
PostPosted: Mon Dec 14, 2009 7:38 am 
User avatar
Joomla! Explorer
Joomla! Explorer

Joined: Sun Feb 08, 2009 5:10 pm
Posts: 275
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.divulgaterium.com: Divulgaterium - Free Business Website Directory
- http://www.egliseprimitive.org: Christian Website


Top
 Profile  
 
PostPosted: Wed Mar 17, 2010 11:57 am 
User avatar
Joomla! Apprentice
Joomla! Apprentice

Joined: Wed Nov 25, 2009 12:04 am
Posts: 17
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


Top
 Profile  
 
PostPosted: Tue May 04, 2010 3:22 am 
User avatar
Joomla! Intern
Joomla! Intern

Joined: Fri Oct 12, 2007 10:31 am
Posts: 53
Location: Australia
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...


Top
 Profile  
 
PostPosted: Mon Oct 11, 2010 1:03 pm 
Joomla! Fledgling
Joomla! Fledgling

Joined: Fri Jun 18, 2010 6:38 pm
Posts: 3
Seems this also is an issue in Joomla 1.5.20..

Only one column..


Top
 Profile  
 
PostPosted: Mon Jan 16, 2012 8:37 pm 
Joomla! Fledgling
Joomla! Fledgling

Joined: Wed Aug 04, 2010 5:14 am
Posts: 4
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:
   
              <?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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 20 posts ] 



Who is online

Users browsing this forum: Google [Bot], MikeyDL and 34 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group