K2 author's bio and latest items issues

Support desk for Multipurpose Quark Theme
GK User
Wed Oct 21, 2015 9:09 pm
bio_latest_issue.png
HI Gavick -- In my Joomla 3.4.4 site, I have a K2 blog based on your quickstart. I have it set to display the author's bio (name/avatar/description) after their post as well as their latest items. But the bio doesn't display at all, and the latest item title is displaying as stacked letters, not horizontally. Your Quark demo doesn't have author bios/latest items displaying. Why is this happening? Can you please help me?

Thanks.
User avatar
Gold Boarder

teitbite
Mon Oct 26, 2015 1:13 pm
Could you please provide me with a URL to your website, either here or via PM (click the “Private Message” text underneath my avatar) so that I may analyze it? It is a lot easier for us to diagnose issues when we have a live site to examine.
User avatar
Moderator

GK User
Thu Oct 29, 2015 1:20 pm
HI Teitbite -- Polite "bump". I sent the login credentials and URL via PM. Please take a look when you have a chance. Additionally, I'm noticing that for the five blogger menu items, they are showing one person's post for any blogger you pick (from the menu) instead of only that person's posts. Is that something you can advise on, or should I check with K2?

Thanks!
User avatar
Gold Boarder

GK User
Thu Oct 29, 2015 3:19 pm
railer wrote:Additionally, I'm noticing that for the five blogger menu items, they are showing one person's post for any blogger you pick (from the menu) instead of only that person's posts.

Okay, forget about this part of my previous post. I changed them all to User Blog menu items. But the original issues still are problems, i.e., author's bio not displaying, and the latest items title displaying as stacked text.
User avatar
Gold Boarder

GK User
Thu Oct 29, 2015 3:55 pm
Okay, I fixed the layout issue pertaining to the latest posts from the author by adding a width: 100% attribute to my override.css file, as follows:
Code: Select all
.itemAuthorContent {
    margin: 0px 0px 70px;
    overflow: hidden;
    width: 100% !important;
}

Still have no Author's Bio displaying under their posts. Can you please help with that?
User avatar
Gold Boarder

teitbite
Thu Oct 29, 2015 4:38 pm
Hi

I'm afraid the access You've send me is not working. Can You please check if it has a proper permissions and if it's activated ?
User avatar
Moderator

GK User
Thu Oct 29, 2015 4:44 pm
teitbite wrote:Hi

I'm afraid the access You've send me is not working. Can You please check if it has a proper permissions and if it's activated ?

My bad. Sorry, forgot to enable it. I've confirmed that it now works. Thanks!
User avatar
Gold Boarder

GK User
Tue Nov 03, 2015 8:27 pm
Hope I can get back in the queue to have this looked at. Thanks.
User avatar
Gold Boarder

teitbite
Tue Nov 03, 2015 9:06 pm
Hi

Happy I have this thread opened :) This last bamp would push it to the end of the line again :)
I've copied this part from clear K2 package:

Code: Select all
  <?php if($this->item->params->get('itemAuthorBlock') && empty($this->item->created_by_alias)): ?>
  <!-- Author Block -->
  <div class="itemAuthorBlock">

     <?php if($this->item->params->get('itemAuthorImage') && !empty($this->item->author->avatar)): ?>
     <img class="itemAuthorAvatar" src="<?php echo $this->item->author->avatar; ?>" alt="<?php echo K2HelperUtilities::cleanHtml($this->item->author->name); ?>" />
     <?php endif; ?>

    <div class="itemAuthorDetails">
      <h3 class="itemAuthorName">
         <a rel="author" href="<?php echo $this->item->author->link; ?>"><?php echo $this->item->author->name; ?></a>
      </h3>

      <?php if($this->item->params->get('itemAuthorDescription') && !empty($this->item->author->profile->description)): ?>
      <p><?php echo $this->item->author->profile->description; ?></p>
      <?php endif; ?>

      <?php if($this->item->params->get('itemAuthorURL') && !empty($this->item->author->profile->url)): ?>
      <span class="itemAuthorUrl"><?php echo JText::_('K2_WEBSITE'); ?> <a rel="me" href="<?php echo $this->item->author->profile->url; ?>" target="_blank"><?php echo str_replace('http://','',$this->item->author->profile->url); ?></a></span>
      <?php endif; ?>

      <?php if($this->item->params->get('itemAuthorEmail')): ?>
      <span class="itemAuthorEmail"><?php echo JText::_('K2_EMAIL'); ?> <?php echo JHTML::_('Email.cloak', $this->item->author->email); ?></span>
      <?php endif; ?>

         <div class="clr"></div>

         <!-- K2 Plugins: K2UserDisplay -->
         <?php echo $this->item->event->K2UserDisplay; ?>

    </div>
    <div class="clr"></div>
  </div>
  <?php endif; ?>
User avatar
Moderator

teitbite
Tue Nov 03, 2015 9:16 pm
Hi

Sorry, posted too fast. This code needed some adjustments:

Code: Select all
  <?php if($this->params->get('itemAuthorBlock') && empty($this->created_by_alias)): ?>
  <!-- Author Block -->
  <div class="itemAuthorBlock">

     <?php if($this->params->get('itemAuthorImage') && !empty($this->author->avatar)): ?>
     <img class="itemAuthorAvatar" src="<?php echo $this->author->avatar; ?>" alt="<?php echo K2HelperUtilities::cleanHtml($this->author->name); ?>" />
     <?php endif; ?>

    <div class="itemAuthorDetails">
      <h3 class="itemAuthorName">
         <a rel="author" href="<?php echo $this->author->link; ?>"><?php echo $this->author->name; ?></a>
      </h3>

      <?php if($this->params->get('itemAuthorDescription') && !empty($this->author->profile->description)): ?>
      <p><?php echo $this->author->profile->description; ?></p>
      <?php endif; ?>

      <?php if($this->params->get('itemAuthorURL') && !empty($this->author->profile->url)): ?>
      <span class="itemAuthorUrl"><?php echo JText::_('K2_WEBSITE'); ?> <a rel="me" href="<?php echo $this->author->profile->url; ?>" target="_blank"><?php echo str_replace('http://','',$this->author->profile->url); ?></a></span>
      <?php endif; ?>

      <?php if($this->params->get('itemAuthorEmail')): ?>
      <span class="itemAuthorEmail"><?php echo JText::_('K2_EMAIL'); ?> <?php echo JHTML::_('Email.cloak', $this->author->email); ?></span>
      <?php endif; ?>

         <div class="clr"></div>

         <!-- K2 Plugins: K2UserDisplay -->
         <?php echo $this->event->K2UserDisplay; ?>

    </div>
    <div class="clr"></div>
  </div>
  <?php endif; ?>
User avatar
Moderator

GK User
Tue Nov 03, 2015 9:27 pm
Hi Teitbite,

What did you do with the code quoted below, or what do you want for me to do with it? I saw that the /templates/gk_quark/html/com_k2/templates/default/item.php file's date modification date has changed to today, but I didn't find the code below in the file. And more importantly, I don't see the author's bio info displayed after their blog posts. I'm 90% sure I have the K2 category set to display the authors bios.
**** Ah, cool, I see you are adjusting it. THANKS! ***
User avatar
Gold Boarder

teitbite
Tue Nov 03, 2015 9:32 pm
Hi

Yes I see it was not saved. Can't tell why. Please send me an access to FTP or try to paste one of this codes into this file. As I said it's an exact code copied from clean K2 installation.

You can also try rename /html/com_k2/templates/default/item.php to /html/com_k2/templates/default/_item.php this way an orginal K2 files will be used.
User avatar
Moderator

GK User
Tue Nov 03, 2015 9:35 pm
teitbite wrote:Hi

Yes I see it was not saved. Can't tell why. Please send me an access to FTP or try to paste one of this codes into this file. As I said it's an exact code copied from clean K2 installation.

You can also try rename /html/com_k2/templates/default/item.php to /html/com_k2/templates/default/_item.php this way an orginal K2 files will be used.


Thanks Teitbite — perhaps you could modify the item.php file you have as needed, and then send it to me and I'll replace the one in the template html directory?
User avatar
Gold Boarder

GK User
Tue Nov 03, 2015 9:40 pm
Changing the item.php filename to _item.php to disable it did cause the author's bio to display, but as you can imagine, the layout was all messed up.
I'll wait a bit for your response. If I don't hear from you, I'll try hacking the code below, unless you have the "adjusted" version, in which case, please attach it here.

Thanks
User avatar
Gold Boarder

teitbite
Fri Nov 06, 2015 3:21 pm
Hi

I found what the problem is. Here is a proper code:

Code: Select all
  <?php if($params->get('itemAuthorBlock') && empty($this->item->created_by_alias)): ?>
  <!-- Author Block -->
  <div class="itemAuthorBlock">

     <?php if($params->get('itemAuthorImage') && !empty($this->item->author->avatar)): ?>
     <img class="itemAuthorAvatar" src="<?php echo $this->item->author->avatar; ?>" alt="<?php echo K2HelperUtilities::cleanHtml($this->item->author->name); ?>" />
     <?php endif; ?>

    <div class="itemAuthorDetails">
      <h3 class="itemAuthorName">
         <a rel="author" href="<?php echo $this->item->author->link; ?>"><?php echo $this->item->author->name; ?></a>
      </h3>

      <?php if($params->get('itemAuthorDescription') && !empty($this->item->author->profile->description)): ?>
      <p><?php echo $this->item->author->profile->description; ?></p>
      <?php endif; ?>

      <?php if($params->get('itemAuthorURL') && !empty($this->item->author->profile->url)): ?>
      <span class="itemAuthorUrl"><?php echo JText::_('K2_WEBSITE'); ?> <a rel="me" href="<?php echo $this->item->author->profile->url; ?>" target="_blank"><?php echo str_replace('http://','',$this->item->author->profile->url); ?></a></span>
      <?php endif; ?>

      <?php if($params->get('itemAuthorEmail')): ?>
      <span class="itemAuthorEmail"><?php echo JText::_('K2_EMAIL'); ?> <?php echo JHTML::_('Email.cloak', $this->item->author->email); ?></span>
      <?php endif; ?>

         <div class="clr"></div>

         <!-- K2 Plugins: K2UserDisplay -->
         <?php echo $this->item->event->K2UserDisplay; ?>

    </div>
    <div class="clr"></div>
  </div>
  <?php endif; ?>
User avatar
Moderator

GK User
Fri Nov 06, 2015 8:16 pm
Thanks Teitbite!
That did the trick. I just had to apply some css to make the author image and author name center on the page.
All set with this issue.
Cheers!
User avatar
Gold Boarder

teitbite
Wed Nov 11, 2015 9:46 pm
Hi

Great. Cab You share some of this css ? Just in case someone else will want to use it.
User avatar
Moderator

GK User
Wed Nov 11, 2015 10:40 pm
In /templates/gk_quark/html/com_k2/templates/default/item.php, I added text-align:center !important; code to the itemAuthorImage and itemAuthorName divs. See below:
Code: Select all
       <?php if($params->get('itemAuthorBlock') && empty($this->item->created_by_alias)): ?>
      <!-- Author Block -->
      <div class="itemAuthorBlock">

         <div id="author_image" style="text-align:center !important;"><?php if($params->get('itemAuthorImage') && !empty($this->item->author->avatar)): ?>
         <img class="itemAuthorAvatar" src="<?php echo $this->item->author->avatar; ?>" alt="<?php echo K2HelperUtilities::cleanHtml($this->item->author->name); ?>" />
         <?php endif; ?></div>

        <div class="itemAuthorDetails">
          <h3 class="itemAuthorName" style="text-align:center !important;">
             <a rel="author" href="<?php echo $this->item->author->link; ?>"><?php echo $this->item->author->name; ?></a>
          </h3>

          <?php if($params->get('itemAuthorDescription') && !empty($this->item->author->profile->description)): ?>
          <p><?php echo $this->item->author->profile->description; ?></p>
          <?php endif; ?>

          <?php if($params->get('itemAuthorURL') && !empty($this->item->author->profile->url)): ?>
          <span class="itemAuthorUrl"><?php echo JText::_('K2_WEBSITE'); ?> <a rel="me" href="<?php echo $this->item->author->profile->url; ?>" target="_blank"><?php echo str_replace('http://','',$this->item->author->profile->url); ?></a></span>
          <?php endif; ?>

          <?php if($params->get('itemAuthorEmail')): ?>
          <span class="itemAuthorEmail"><?php echo JText::_('K2_EMAIL'); ?> <?php echo JHTML::_('Email.cloak', $this->item->author->email); ?></span>
          <?php endif; ?>

I probably could have done this in a css override file, but this worked and I was under the gun to fix it. If you have other suggestions, I'd welcome it/them.
User avatar
Gold Boarder

teitbite
Sat Nov 14, 2015 10:51 am
Hi

It may not be the "elegant" way to do this, but if it works for You, that it means it's a good solution.
User avatar
Moderator


cron