help to better help you:
Please: add always Joomla / JEM version and details to your posts, so we can try to reproduce your issue!
Change position of category icons
Change position of category icons
5 years 9 months ago
Hello,
I'm wrestling with showing my category icons on a different place but don't know how to go about it. I don't seem to find the code and the right place.
I host my website with CloudAccess.net (in case I need to change things in one or another place.
On the picture you can see where I would like the icon:
1 before or after the category name in the heading
1 in the table in stead of the category name.
The site is sabaoutandabout.joomla.com
Thanks for helping
Esther
I'm wrestling with showing my category icons on a different place but don't know how to go about it. I don't seem to find the code and the right place.
I host my website with CloudAccess.net (in case I need to change things in one or another place.
On the picture you can see where I would like the icon:
1 before or after the category name in the heading
1 in the table in stead of the category name.
The site is sabaoutandabout.joomla.com
Thanks for helping
Esther
Please Log in or Create an account to join the conversation.
Re: Change position of category icons
5 years 9 months ago
You can change the position of <div class="catimg"> into h2 tag.
Open /components/com_jem/views/categories/tmp/default.php, Go to line 34 and move this block into <h2> tag previous.
<?php foreach ($this->rows as $row) : ?>
<h2 class="jem cat<?php echo $row->id; ?>">
<?php if ($this->jemsettings->discatheader) { ?>
<div class="catimg">
<?php // flyer
if (empty($row->image)) {
$jemsettings = JemHelper::config();
$imgattribs = $jemsettings->imagewidth;
$imgattribs = $jemsettings->imagehight;
echo JHtml::_('image', 'com_jem/noimage.png', $row->catname, $imgattribs, true);
} else {
$cimage = JemImage::flyercreator($row->image, 'category');
echo JemOutput::flyer($row, $cimage, 'category');
}
?>
</div>
<?php echo JHtml::_('link', JRoute::_($row->linktarget), $this->escape($row->catname)); ?>
</h2>
Open /components/com_jem/views/categories/tmp/default.php, Go to line 34 and move this block into <h2> tag previous.
<?php foreach ($this->rows as $row) : ?>
<h2 class="jem cat<?php echo $row->id; ?>">
<?php if ($this->jemsettings->discatheader) { ?>
<div class="catimg">
<?php // flyer
if (empty($row->image)) {
$jemsettings = JemHelper::config();
$imgattribs = $jemsettings->imagewidth;
$imgattribs = $jemsettings->imagehight;
echo JHtml::_('image', 'com_jem/noimage.png', $row->catname, $imgattribs, true);
} else {
$cimage = JemImage::flyercreator($row->image, 'category');
echo JemOutput::flyer($row, $cimage, 'category');
}
?>
</div>
<?php echo JHtml::_('link', JRoute::_($row->linktarget), $this->escape($row->catname)); ?>
</h2>
Please Log in or Create an account to join the conversation.
Re: Change position of category icons
5 years 9 months ago
Hi McKillo,
Thanks for the answer.
It worked! I did not put the same thing exactly that you put as I couldn't find all in my default.php. So I tried to cut and paste the lines that were kind of the same.
Maybe that's why the image is stuck to the bottom and not vertically centered?
I am working with CloudAccess as a server and the editing of the php that I found does not have line numbers. (I couldn't find the files in the backend of the joomla site, should I have?)
I now tried to figure out in the same way how to put the icon in the last row of the table but still figuring out in what map to find this table.
Thanks for the answer.
It worked! I did not put the same thing exactly that you put as I couldn't find all in my default.php. So I tried to cut and paste the lines that were kind of the same.
Maybe that's why the image is stuck to the bottom and not vertically centered?
I am working with CloudAccess as a server and the editing of the php that I found does not have line numbers. (I couldn't find the files in the backend of the joomla site, should I have?)
I now tried to figure out in the same way how to put the icon in the last row of the table but still figuring out in what map to find this table.
Please Log in or Create an account to join the conversation.
Re: Change position of category icons
5 years 9 months ago
If you want center img, you can write the style for div tag or modified css file.
In the previous code, change this line:
<div class="catimg">
fot this one:
<div class="catimg" style="margin-top:-2px">
Now, category icon is center
In the previous code, change this line:
<div class="catimg">
fot this one:
<div class="catimg" style="margin-top:-2px">
Now, category icon is center
Please Log in or Create an account to join the conversation.
Time to create page: 0.596 seconds