Insert a single video from any source

Insert a single video from any source

Easily insert videos from any source which supports video share via embed. This can be used in Joomla content component, Custom module and any ...

Notice: Undefined variable: slideshow in /home/cmsenerg/public_html/modules/mod_cmse_articles_latest/tmpl/_slideshow.php on line 223

Notice: Undefined variable: slideshow in /home/cmsenerg/public_html/modules/mod_cmse_articles_latest/tmpl/_slideshow.php on line 223
Add vote anywhere

Add vote anywhere

section cols2 col-wrap col Allow users to vote on any item. A user's IP address is tracked by a cookie so they can only vote once. Place the ...

Notice: Undefined variable: slideshow in /home/cmsenerg/public_html/modules/mod_cmse_articles_latest/tmpl/_slideshow.php on line 223

Notice: Undefined variable: slideshow in /home/cmsenerg/public_html/modules/mod_cmse_articles_latest/tmpl/_slideshow.php on line 223
Add Google Map anywhere

Add Google Map anywhere

section cols2 col-wrap col Enter an address and done. Place the shortcode anywhere in the article text area as googlemap . Alternatively write ...

Notice: Undefined variable: slideshow in /home/cmsenerg/public_html/modules/mod_cmse_articles_latest/tmpl/_slideshow.php on line 223

Notice: Undefined variable: slideshow in /home/cmsenerg/public_html/modules/mod_cmse_articles_latest/tmpl/_slideshow.php on line 223
Insert video playlist

Insert video playlist

section cols2 col-wrap col All you need is the video source URL, which can be from nearly unlimited providers which allow video embed. Simply add ...

Notice: Undefined variable: slideshow in /home/cmsenerg/public_html/modules/mod_cmse_articles_latest/tmpl/_slideshow.php on line 223

Notice: Undefined variable: slideshow in /home/cmsenerg/public_html/modules/mod_cmse_articles_latest/tmpl/_slideshow.php on line 223
Insert Pinterest post

Insert Pinterest post

ogurl="https://pin.it/v4rg47fc73dbou"/ogurl

Notice: Undefined variable: slideshow in /home/cmsenerg/public_html/modules/mod_cmse_articles_latest/tmpl/_slideshow.php on line 223

Notice: Undefined variable: slideshow in /home/cmsenerg/public_html/modules/mod_cmse_articles_latest/tmpl/_slideshow.php on line 223

How To Add An Article's Author 'About Me' Details On The Article Page

How To Add An Article's Author 'About Me' Details On The Article Page

Why an option to display the 'about me' user profile field in articles written by the user, is not yet a default function in a supreme CMS as Joomla, is indeed a mystery! Many Joomla users seek this ability, and if asked in the Joomla "support" forum, the so-called branded "joomla masters" tend to send the inquirer to the Joomla Extensions Directory to install yet another unnecessary addon. Stop It! Joomla is developed to be configurable.

The Method (see video guide below)

1. Create A Layout Override

Joomla is equipped with a superb template override system to manipulate most display files for your preferred appearance.

  • Go to Extensions > Templates
  • Click the name of your default template (highlighted star), under the column titled Template.
  • Click the tab labeled Overrides
  • Under the column titled Layouts, click Joomla then click content

The page will refresh and show the confirmation of the override creation. Now edit the file

  • Click the tab labeled Editor
  • Click through directories html > layouts > joomla > content > info_block
  • Click the file named author.php to open the code editor on the right

 

2. Edit The Override File Name author.php

html/layouts/joomla/content/info_block/author.php

Add the following to the top within the <?php tag. This gets the author ID of the currently viewed article, then creates an output variable of the user profile aboutme through the JUserHelper class.

// get author ID
$authorId = $displayData['item']->created_by;

// get user profile field data
$authordetail = JUserHelper::getProfile($authorId)->profile['aboutme'];
$authorwebsite = JUserHelper::getProfile($authorId)->profile['website'];

 

then add the output variable where you desire

	<?php // the output
	if( !empty($authordetail) ) { ?>
	<div class="aboutme">
		<?php echo $authordetail; ?>
		<?php if( !empty($authorwebsite) ) { ?>
			<p><a href='<?php echo $authorwebsite; ?>' rel="nofollow" target="_blank">Author's Website</a></p>
		<?php } ?>
	</div>
	<?php } ?>

 

The completed file should look like this. A <div> wrap was added so the out put can be formatted with css.

<?php
/**
 * @package     Joomla.Site
 * @subpackage  Layout
 *
 * @copyright   Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('JPATH_BASE') or die;

// get author ID
$authorId = $displayData['item']->created_by;

// get user profile field data
$authordetail = JUserHelper::getProfile($authorId)->profile['aboutme'];
$authorwebsite = JUserHelper::getProfile($authorId)->profile['website'];
//uncomment either of the following to see the available array values you can use to return any output
//print_r($displayData['item']);
//print_r(JUserHelper::getProfile($authorId)->profile);
?>
<dd class="createdby" itemprop="author" itemscope itemtype="https://schema.org/Person">
	<?php $author = ($displayData['item']->created_by_alias ?: $displayData['item']->author); ?>
	<?php $author = '<span itemprop="name">' . $author . '</span>'; ?>
	<?php if (!empty($displayData['item']->contact_link ) && $displayData['params']->get('link_author') == true) : ?>
		<?php echo JText::sprintf('COM_CONTENT_WRITTEN_BY', JHtml::_('link', $displayData['item']->contact_link, $author, array('itemprop' => 'url'))); ?>
	<?php else : ?>
		<?php echo JText::sprintf('COM_CONTENT_WRITTEN_BY', $author); ?>
	<?php endif; ?>
	
	<?php // the output
	if( !empty($authordetail) ) { ?>
	<div class="aboutme">
	<h4>About The Author</h4>
		<?php echo $authordetail; ?>
		<?php if( !empty($authorwebsite) ) { ?>
			<p><a href="/<?php echo $authorwebsite; ?>" rel="nofollow" target="_blank">Author's Website</a></p>
		<?php } ?>
	</div>
	<?php } ?>
</dd>

 

Now the article aboutme text will display where the article info is assigned. Of course you must enable Show Author either in the content global configuration, or in the menu item options.

The Output

author-profile-shown-with-article.jpg

 

Video Guide

[videoplayer/]
Copyright © 2020 CMSEnergizer.com. All Rights Reserved.
This website is powered by the Joomla!©™ 3 Website Framework | File download and article manager component by CMSE Custom Fields | Website hosting and development by WebsiteDons

CMSEnergizer.com is owned and operated by Emuzement Net Inc, Tampa, Florida USA