thanks for the hint,
but i probably did not make myself clear, sorry.
i need to insert author in generic.php not in view.html.php
the string you propose is from category item.php and does not work in generic.php becouse it is not category item i.e. does not have params like "item->params->get('catItemAuthor')"
i know nothing of php, but guess that was the reason to insert the params in view.html.php
please advise what and where exactly could be used!
10x in advance
Miro Mitov said:
Hey there,
To get the author in the view.html.php you dont need to to include this... simply put the following to get the author and the link:
<?php if($this->item->params->get('catItemAuthor')): ?>
<!-- Item Author -->
<span class="catItemDateCreated">
<?php echo K2HelperUtilities::writtenBy($this->item->author->profile->gender); ?> <a href="<?php echo $this->item->author->link; ?>"><?php echo $this->item->author->name; ?></a>
</span>
<?php endif; ?>
you can change the span class to anything you like to get it to display the way you like it.
Hope this works for you.
krmr trzv said:
Hi everyone,I have been struggling to get the author in generic.php for ages, and am happy to see now there is a solution.
However I tried the suggestion and it did work in generic template, but broke the category item template displaying error messages.May be I did it wrong? I placed "$items[$i]->author = &JFactory::getUser($items[$i]->created_by);" in view.html.php in line 255, after "else {" (just above "//Pathway" string)
Can someone point out the exact place for placing the code?
My problem is I have authors, and author aliases, so first the alias should be shown, and if absent then author/user is displayed, so I guess there must be some variable added to clear the error?
Any help is mush appreciated!