Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • cod1 Friend
    #988656

    Hi,

    I’m trying to customize "author.php" so that only Super User and Admin can see their usernames on their posts (created by …). Other users (e.g. John Doe,…) will have access to the posts created by Super User and Admin, but not their authors. The usernames of the other users must appear on their posts. How can I achieve that? I’m still working on localhost. Below is the code.

    <dd class="createdby hasTooltip" itemprop="author" title="<?php echo JText::sprintf('COM_CONTENT_WRITTEN_BY', ''); ?>">
        <i class="fa fa-user"></i>
        <?php if (!empty($displayData['item']->contact_link ) && $displayData['params']->get('link_author') == true) : ?>
            <span itemprop="name"><?php echo JHtml::_('link', $displayData['item']->contact_link, $author, array('itemprop' => 'url')); ?></span>
        <?php else :?>
            <span itemprop="name"><?php echo $author; ?></span>
        <?php endif; ?>
      <span style="display: none;" itemprop="publisher" itemscope itemtype="https://schema.org/Organization">
      <span itemprop="logo" itemscope itemtype="https://schema.org/ImageObject">
        <img src="<?php echo JURI::base(); ?>/templates/<?php echo JFactory::getApplication()->getTemplate() ?>/images/logo.png" alt="logo" itemprop="url" />
        <meta itemprop="width" content="auto" />
        <meta itemprop="height" content="auto" />
      </span>
      <meta itemprop="name" content="<?php echo $author; ?>"/>
      </span>
    </dd>

    1. Super_User
    2. Do-Not-Hide-Me
    Saguaros Moderator
    #988848

    Hi,

    You can try with my tweak as below:

    • Download attached file
    • Unzip & copy folder ‘info_block’ into this directory: ROOT/templates/ja_intranet/html/layouts/joomla/content/ (this way will help to override the info_block in template)

    Then check again.

    Hope this helps.

    Regards


    1. info_block.zip
    cod1 Friend
    #988992

    Hi Saguaros,

    I really appreciate your prompt reply. It works like a charm.

    Thanks.

    Regards

    Saguaros Moderator
    #989133

    Glad to hear that it helped!

    Have a nice day!

Viewing 4 posts - 1 through 4 (of 4 total)

This topic contains 3 replies, has 2 voices, and was last updated by  Saguaros 8 years ago.

We moved to new unified forum. Please post all new support queries in our New Forum