Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    Regular Coder
    Join Date
    Oct 2005
    Posts
    336
    Thanks
    43
    Thanked 2 Times in 2 Posts

    PHP and Joomla code help needed please

    Hello I have a Joomla 1.5.9 and PHP question, which Im hoping someone can help me out with -

    I want to apply different individual styles to my frontpage articles. Not just the usual single page class suffix style which applies to the whole page.

    I have 2 article categories (category1 and category2) and I need different styling for each category. For example, articles in category 1 will have different styling for articles in category2. This is just for the front page only.

    I am using the Beez template (default.php and default_item.php).

    The standard joomla code to output a page class suffix is -
    PHP Code:
    <div class="contentpaneopen_edit<?php echo $this->item->params->get('pageclass_sfx'); ?>">
    The code above lets you give a whole page an overall class suffix and outputs html as -
    Code:
    div class="contentpaneopen">
    I found this php code below which is supposed to output the page class suffix AND the category of the article as a suffix (so css styling can be applied to each article), but I just cannot get it to work -
    PHP Code:
    <div class="contentpaneopen<?php echo $this->item->params->get'pageclass_sfx' ) . '-' .  $this->item->category?>">
    The code is supposed to output html as the following -
    Code:
    <div class="contentpaneopen-CATEGORYHERE">
    But the category isnt displayed in the html when I view the source.

    I am hopeless with php and really stuck on this one, I hope my question has made sense
    Last edited by moss2076; 03-05-2009 at 11:17 AM.


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •