1

I am trying to style how the articles are laid out in a Category Blog and have got stuck on styling the actual content of the article.

My code for the first article on the Category Blog is as such:

<div class="items-leading">

<div class="leading-0">

    <h2>
        <a href="/news/5-news-post-1">News Post 1</a>
    </h2>

    <dl class="article-info">

        <dt class="article-info-term">Details</dt>

        <dd class="published">2nd Mar 2013</dd>

    </dl>

    Lorem ipsum dolor sit amet etc...

    <div class="item-separator"></div>

</div>

I am trying to style the lorem ipsum example text by wrapping it in some kind of tags, either div or paragraph I don't mind, so I can give its wrapping container a div and font styling etc.

Here is a link to the site where its currently on:

http://test.studevent.co.uk/news

Any help is greatly appreciated.

stu177
  • 567
  • 2
  • 7
  • 20

2 Answers2

1

You want to change default template for article item in blog? /components/com_content/views/category/tmpl/blog_item.php - it is default template. copy it in your template (/templates/{your_template_name}/html/com_content/category/blog_item.php). After, in your copy on line 137 you can find <?php echo $this->item->introtext; ?> - it is your text 'Lorem ipsum ...'

wearwoolf
  • 386
  • 1
  • 2
  • 10
  • So I can wrap item->introtext; ?> in a div by for example doing: ".$this->item->introtext.""; ?> – stu177 Mar 03 '13 at 22:52
  • 1
    Yes. But, i think better
    item->introtext; ?>
    . But this changes will be for all articles in all blogs.
    – wearwoolf Mar 03 '13 at 22:56
  • Is this good practice to do this by editing the actual PHP code, is there no way to do this just from template editing and styles? Also will an update to Joomla overwrite this change? – stu177 Mar 03 '13 at 22:57
  • 1
    It is normal native way of joomla for updating the template of extension (i about copy of the template). If you update version of joomla, your copy in the template not change. Also, you can try to wrap text with help of plugin. – wearwoolf Mar 03 '13 at 23:03
  • 1
    http://docs.joomla.org/How_to_override_the_output_from_the_Joomla!_core - little text about updating template of extension. – wearwoolf Mar 03 '13 at 23:13
0

To do this, the file you need to edit is found here:

YOURSITEROOT/layouts/joomla/content/blog_style_default_item_title.php

In order to edit file, create a new folder (within your template) and move the file here, so it would be:

YOURSITEROOT/templates/YOURTEMPLATE/html/layouts/joomla/content/blog_style_default_item_title.php
RustyIngles
  • 2,433
  • 4
  • 27
  • 31