Keyword

Placing Read more... and Published in: into one line

  • Joe Louw
  • Joe Louw's Avatar Topic Author
  • Offline
  • New Member
More
13 years 5 months ago #95496 by Joe Louw
Could someone please give me the code I need to place my Read more... and Published in: buttons/links into one line next to each other: Please see www.thombesafari.com/index.php?option=com_k2&view=itemlist&layout=category&Itemid=1 for what I mean.
Thank you

Please Log in or Create an account to join the conversation.

  • Yiota
  • Yiota's Avatar
  • Visitor
13 years 5 months ago #95497 by Yiota
First of all you will have to edit the item.php of the K2 template (after you have created an override, if not already). Then locate the catItemLinks and catItemReadMore blocks and move the latter to be right under the former without any clr divs in between.

Then open the k2.css locate both blocks and add some CSS for those two. You will need to add a float:left, for example, etc. depending on the styling you want to give.

Please Log in or Create an account to join the conversation.

  • Joe Louw
  • Joe Louw's Avatar Topic Author
  • Offline
  • New Member
More
13 years 5 months ago #95498 by Joe Louw
Hi Yiota

Thank you for your response, I played a bit with these settings and notice it would be posible, but don't get it right 100%. I am a 1st time Joomla user and did this never before. If you don't mind wouls you just plaese explain to me again in more detail. - Conside I did nothing yet, not even the item.php.

OK what shoud I shange in the item.php?

Locate catItemLinks and catItemReadMore blocks in what file?

What do you mean with "move the latter to be right under the former without any clt divs in between?

This is the info I found on in my k2.css file in line 404 and till line 444:

Thank you

Joe Louw

Please Log in or Create an account to join the conversation.

  • Yiota
  • Yiota's Avatar
  • Visitor
13 years 5 months ago #95499 by Yiota
Start by creating a K2 template override. This is done by copying the folder from components/com_k2/templates and pasting it to templates/YOUR_TEMPLATE/html/com_k2/templates.

 

After that open the category_item.php located in default folder in your template folder you just copied.

Locate the catItemLinks on line 157

 

<?php if(  $this->item->params->get('catItemHits') ||  $this->item->params->get('catItemCategory') ||  $this->item->params->get('catItemTags') ||  $this->item->params->get('catItemAttachments')  ): ?>  <div class="catItemLinks">

....

end on 216 line.

And the catItemReadMore on line 264

<?php if ($this->item->params->get('catItemReadMore')): ?>    <!-- Item "read more..." link -->    <div class="catItemReadMore">        <a class="k2ReadMore" href="<?php echo $this->item->link; ?>">            <?php echo JText::_('Read more...'); ?>        </a>    </div>    <?php endif; ?>

 

Move the catItemReadMore right after the catItemLinks block (from line 264 to line 217)

Leave the rest as it is.

Save the file.

 

Now open the k2.css (which you can also copy in your template's CSS folder (templates/YOUR_TEMPLATE/css/) )

Add to the catItemLinks { float:left; margin:0 10px 16px 0; }

Then add to the catItemReadMore { float:left; (or float:right;) }

Please Log in or Create an account to join the conversation.

  • Joe Louw
  • Joe Louw's Avatar Topic Author
  • Offline
  • New Member
More
13 years 5 months ago #95500 by Joe Louw
Thank you Yiota

Sorted, it helped and my K2 now looks like a million bucks.

I was just a bit scary to edit the php file because if you don't know what you do you can break something.

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum