• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 409
  • Last Modified:

Need help getting table positioned properly on front page of joomla site

I am working on a new Joomla site and am having difficulty getting articles to center on the front page. The  article I am currently working with  is named "Agape In The Community"  I want to insert it under the weather module and span across the entire content area, centered. At this point it is shifted to the right, and I have had to reduce the size of the images to get it to stay withinthe content area. I don't know if it is a table configuration issue, or a template that needs to be editied.
The project site is moodle.agape-academy.com/joomla
0
tamray_tech
Asked:
tamray_tech
  • 11
  • 8
  • 2
1 Solution
 
LZ1Commented:
It looks like there are tables within tables within tables.  It is going to be rather difficult to do what you are wanting to do with the current layout.
0
 
tamray_techAuthor Commented:
I only created 1 table. The rest must be in the template
0
 
LZ1Commented:
In all truthfulness, your best bet would be to go complete CSS and use a 3 column layout.  The table is going to continue to make a mess of things.  Once you start modifing one thing and get it to work, something else will go out of line.  
 
0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

 
tamray_techAuthor Commented:
I am not sure how to do that within the atricle manager. Do you have an example?
0
 
j-b-tCommented:
Hello tamray

firstly have you modified the template at all?
secondly are you using the front page component for this page or is it just a regular article?
(ie what type of menu item is the default menu item?)
the solution willl most likely be in creatign some html overrides.
http://developer.joomla.org/tutorials/165-understanding-output-overrides-in-joomla.html
you can also download and modify some table less overrides frm here
http://www.yootheme.com/member-area/downloads/item/templates-15/template-overrides-15

PS - back up your site before doing anything to it.


0
 
tamray_techAuthor Commented:
So far I have only changed the logo in the template. I am using "Front Page" component and I believe the menu you see id the default.
0
 
j-b-tCommented:
ok you need to do an override for eth frontpage component then - I'm assumign this is the only problem page - do you know how to change php code? and a little html.

0
 
tamray_techAuthor Commented:
Given the proper tags, and page, yes?

You are correct; it is only a front page problem
0
 
j-b-tCommented:
ok
- in yrou webdirectory - you need to find this file:
yoursite.com/templates/the_template_you_are_using/html/com_content/frontpage
in that directory will be some files - default.php and default_item.php and default_links.php
 - you need to modify these to change the layout of that page

(this is a template override) - exactly where depends on these files etc

if those files do not exist  - create the directory as above and COPY teh files frome th joomla core
 iei go to :
yoursite.com/components/com_content/frontpage/views/frontpage/tmpl

Back up first!
0
 
tamray_techAuthor Commented:
Found the folder, and copied to the template I am using. It was not the same path you gave, but I assume I copied over the right items, since the file names were there, as you said. I have attached a screen shot of the path. I am not sure what to edit from here. Is it done via my file manager, or through joomla? Which file do I edit? How would the edit look in order to span the entire width of the front page?
Screenshot.png
0
 
tamray_techAuthor Commented:
bump
0
 
j-b-tCommented:
ok so you need to nmake this tree of directories within yoursite.com

In templates /success_v2_0_j1.5 [I am assuming this is the template you are using]
 - create a folder called html
 - in that folder create a folder called com_content
 - in that folder create a folder called frontpage
 - in that folder place COPIES OF the default_php, default_item.php, and default_links.php

from yoursite.com/components/com_content/frontpage/views/frontpage/tmpl

Now if you start tinkering with these files you have copied in to your template folder - you can change teh layout
0
 
tamray_techAuthor Commented:
Thanks for the reply. I understood this information from your previous post, and have the folders and files in place. I am stuck as to what to change to move things around on the page, as I explained earlier. I specifically need to move the bottom article over to the left, so it is centered with the rest of the content, and spans the whole page.

I will poke around, but am not skilled with editing templates yet.
0
 
j-b-tCommented:
oh ok from your image it looked like you had just dropped a copy of the files in yrou system folder. Umm it would take a little work to sort out what needs changing - hmm I can take a peek later - can you please post the code of the three php files
0
 
tamray_techAuthor Commented:
Here is the path the files are located:

joomla
templates
success_v2_0_i15 (template I am using)
system
html
com_content
views
frontpage
tmpl

I attached the three files in one , separated by their names.


Default.php:


<?php // no direct access
defined('_JEXEC') or die('Restricted access'); ?>
<?php if ($this->params->get('show_page_title', 1)) : ?>
<div class="componentheading<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>">
<?php echo $this->escape($this->params->get('page_title')); ?>
</div>
<?php endif; ?>
<table class="blog<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>" cellpadding="0" cellspacing="0">
<?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 = '';
if ($this->params->def('multi_column_order',1)) : // order across as before
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;
$i = $i + $this->params->get('num_intro_articles') ;
else : // otherwise, order down columns, like old category blog
for ($z = 0; $z < $this->params->get('num_columns'); $z ++) :
if ($z > 0) : $divider = " column_separator"; endif; ?>
<td valign="top" width="<?php echo intval(100 / $this->params->get('num_columns')) ?>%" class="article_column<?php echo $divider ?>">
<?php for ($y = 0; $y < ($this->params->get('num_intro_articles') / $this->params->get('num_columns')); $y ++) :
if ($i < $this->total && $i < ($numIntroArticles)) :
$this->item =& $this->getItem($i, $this->params);
echo $this->loadTemplate('item');
$i ++;
endif;
endfor; ?>
</td>
<?php endfor;
endif;?>        
</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->escape($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) == 1  || ($this->params->get('show_pagination') == 2 && $this->pagination->get('pages.total') > 1)) : ?>
<tr>
<td valign="top" align="center">
<?php echo $this->pagination->getPagesLinks(); ?>
<br /><br />
</td>
</tr>
<?php if ($this->params->def('show_pagination_results', 1)) : ?>
<tr>
<td valign="top" align="center">
<?php echo $this->pagination->getPagesCounter(); ?>
</td>
</tr>
<?php endif; ?>
<?php endif; ?>
</table>









Default_item:



<?php // no direct access
defined('_JEXEC') or die('Restricted access');

$canEdit    = ($this->user->authorize('com_content', 'edit', 'content', 'all') || $this->user->authorize('com_content', 'edit', 'content', 'own'));
?>
<?php if ($this->item->state == 0) : ?>
<div class="system-unpublished">
<?php endif; ?>

<?php if ($canEdit || $this->item->params->get('show_title') || $this->item->params->get('show_pdf_icon') || $this->item->params->get('show_print_icon') || $this->item->params->get('show_email_icon')) : ?>
<table class="contentpaneopen<?php echo $this->escape($this->item->params->get( 'pageclass_sfx' )); ?>">
<tr>
<?php if ($this->item->params->get('show_title')) : ?>
<td class="contentheading<?php echo $this->escape($this->item->params->get( 'pageclass_sfx' )); ?>" width="100%">
<?php if ($this->item->params->get('link_titles') && $this->item->readmore_link != '') : ?>
<a href="<?php echo $this->item->readmore_link; ?>" class="contentpagetitle<?php echo $this->escape($this->item->params->get( 'pageclass_sfx' )); ?>">
<?php echo $this->escape($this->item->title); ?></a>
<?php else : ?>
<?php echo $this->escape($this->item->title); ?>
<?php endif; ?>
</td>
<?php endif; ?>

<?php if ($this->item->params->get('show_pdf_icon')) : ?>
<td align="right" width="100%" class="buttonheading">
<?php echo JHTML::_('icon.pdf', $this->item, $this->item->params, $this->access); ?>
</td>
<?php endif; ?>

<?php if ( $this->item->params->get( 'show_print_icon' )) : ?>
<td align="right" width="100%" class="buttonheading">
<?php echo JHTML::_('icon.print_popup', $this->item, $this->item->params, $this->access); ?>
</td>
<?php endif; ?>

<?php if ($this->item->params->get('show_email_icon')) : ?>
<td align="right" width="100%" class="buttonheading">
<?php echo JHTML::_('icon.email', $this->item, $this->item->params, $this->access); ?>
</td>
<?php endif; ?>
<?php if ($canEdit) : ?>
<td align="right" width="100%" class="buttonheading">
<?php echo JHTML::_('icon.edit', $this->item, $this->item->params, $this->access); ?>
</td>
<?php endif; ?>
</tr>
</table>
<?php endif; ?>
<?php  if (!$this->item->params->get('show_intro')) :
echo $this->item->event->afterDisplayTitle;
endif; ?>
<?php echo $this->item->event->beforeDisplayContent; ?>
<table class="contentpaneopen<?php echo $this->escape($this->item->params->get( 'pageclass_sfx' )); ?>">
<?php if (($this->item->params->get('show_section') && $this->item->sectionid) || ($this->item->params->get('show_category') && $this->item->catid)) : ?>
<tr>
<td>
<?php if ($this->item->params->get('show_section') && $this->item->sectionid && isset($this->item->section)) : ?>
<span>
<?php if ($this->item->params->get('link_section')) : ?>
<?php echo '<a href="'.JRoute::_(ContentHelperRoute::getSectionRoute($this->item->sectionid)).'">'; ?>
<?php endif; ?>
<?php echo $this->escape($this->item->section); ?>
<?php if ($this->item->params->get('link_section')) : ?>
<?php echo '</a>'; ?>
<?php endif; ?>
<?php if ($this->item->params->get('show_category')) : ?>
<?php echo ' - '; ?>
<?php endif; ?>
</span>
<?php endif; ?>
<?php if ($this->item->params->get('show_category') && $this->item->catid) : ?>
<span>
<?php if ($this->item->params->get('link_category')) : ?>
<?php echo '<a href="'.JRoute::_(ContentHelperRoute::getCategoryRoute($this->item->catslug, $this->item->sectionid)).'">'; ?>
<?php endif; ?>
<?php echo $this->escape($this->item->category); ?>
<?php if ($this->item->params->get('link_category')) : ?>
<?php echo '</a>'; ?>
<?php endif; ?>
</span>
<?php endif; ?>
</td>
</tr>
<?php endif; ?>

<?php if (($this->item->params->get('show_author')) && ($this->item->author != "")) : ?>
<tr>
<td width="70%"  valign="top" colspan="2">
<span class="small">
<?php JText::printf( 'Written by', ($this->escape($this->item->created_by_alias) ? $this->escape($this->item->created_by_alias) : $this->escape($this->item->author)) ); ?>
</span>
&nbsp;&nbsp;
</td>
</tr>
<?php endif; ?>

<?php if ($this->item->params->get('show_create_date')) : ?>
<tr>
<td valign="top" colspan="2" class="createdate">
<?php echo JHTML::_('date', $this->item->created, JText::_('DATE_FORMAT_LC2')); ?>
</td>
</tr>
<?php endif; ?>

<?php if ($this->item->params->get('show_url') && $this->item->urls) : ?>
<tr>
<td valign="top" colspan="2">
<a href="http://<?php echo $this->escape($this->item->urls) ; ?>" target="_blank">
<?php echo $this->escape($this->item->urls); ?></a>
</td>
</tr>
<?php endif; ?>

<tr>
<td valign="top" colspan="2">
<?php if (isset ($this->item->toc)) : ?>
<?php echo $this->item->toc; ?>
<?php endif; ?>
<?php echo $this->item->text; ?>
</td>
</tr>

<?php if ( intval($this->item->modified) != 0 && $this->item->params->get('show_modify_date')) : ?>
<tr>
<td colspan="2"  class="modifydate">
<?php echo JText::sprintf('LAST_UPDATED2', JHTML::_('date', $this->item->modified, JText::_('DATE_FORMAT_LC2'))); ?>
</td>
</tr>
<?php endif; ?>

<?php if ($this->item->params->get('show_readmore') && $this->item->readmore) : ?>
<tr>
<td  colspan="2">
<a href="<?php echo $this->item->readmore_link; ?>" class="readon<?php echo $this->escape($this->item->params->get('pageclass_sfx')); ?>">
<?php if ($this->item->readmore_register) :
echo JText::_('Register to read more...');
elseif ($readmore = $this->item->params->get('readmore')) :
echo $readmore;
else :
echo JText::sprintf('Read more...');
endif; ?></a>
</td>
</tr>
<?php endif; ?>

</table>
<?php if ($this->item->state == 0) : ?>
</div>
<?php endif; ?>
<span class="article_separator">&nbsp;</span>
<?php echo $this->item->event->afterDisplayContent; ?>




Default_links:


<?php // no direct access
defined('_JEXEC') or die('Restricted access'); ?>
<div>
<strong><?php echo JText::_( 'More Articles...' ); ?></strong>
</div>
<ul>
<?php foreach ($this->links as $link) : ?>
<li>
<a class="blogsection" href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($link->slug, $link->catslug, $link->sectionid)); ?>">
<?php echo $this->escape($link->title); ?></a>
</li>
<?php endforeach; ?>
</ul>

Open in new window

0
 
j-b-tCommented:
tamray - you must use the path I suggested
0
 
j-b-tCommented:
also can you please give ma link to a page that has the specifi problem that you want to fix - I can't see it on teh home page
0
 
tamray_techAuthor Commented:
I must have misunderstood.

This is what you said previously:
- in yrou webdirectory - you need to find this file:
yoursite.com/templates/the_template_you_are_using/html/com_content/frontpage

The com_content did not exist, so I copied it over from a folder higher up the tree.

The template I am using is located at:
joomla
templates
success_v2_0_i15

The html folder is inside the system folder. Do you want me to move it outside of the system folder? I just assumed my setup was a bit different than what you posted.

The project site is http://moodle.agape-academy.com/joomla

I was dinging around with things today, but can put it back the way it was, if that helps.

0
 
j-b-tCommented:


Tamray I'm sorry this job is too big for me to do in thsi forum - please repost or request attention. My apologies - I thought you were going to be able to change the code yourself - you just needed pointing where.
0
 
tamray_techAuthor Commented:
OK, but I need to know if the com_content folder is in the right location, so I can be sure my edits will work as expected.
0
 
tamray_techAuthor Commented:
installing mod_html module
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

  • 11
  • 8
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now