Keyword

Template overides with custom sub templates - bug or confusion?

  • Alan Sparkes
  • Alan Sparkes's Avatar Topic Author
  • Offline
  • Premium Member
More
13 years 10 months ago #90301 by Alan Sparkes
I was overriding core temlates with an override.
In category.php instead of loading the default item for leading items i want to add a subn templatefor leading items.

So instead of this:
     // Load category_item.php by default
                            $this->item=$item;
                            echo $this->loadTemplate('item');


I have :
     // Load category_item_leading.php by default
                            $this->item=$item;
                            echo $this->loadTemplate('item_leading');


This give me my own template for leading items.Hooray

IN my 'category_item_leading' I acces the item content just like you would think:
eg title = $this->item>title

BUT!!!

'$this->item-image' is always null.
This is not null in the 'category_item.php' sub template.
This doesnt make sense to me but image variable for item can be accessed like this:
'$this->item->imageXSmall'

Is it a bug?

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

  • Alan Sparkes
  • Alan Sparkes's Avatar Topic Author
  • Offline
  • Premium Member
More
13 years 10 months ago #90302 by Alan Sparkes
Zipped up override attached
Attachments:

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


Powered by Kunena Forum