Joomla! Template Override:

"Keine Artikel vorhanden" individuell gestalten


Bei diesem Template Override handelt es sich um ein Override von "com_content / category" und ermöglicht es, den Ausgabetext individuell zu gestalten, wenn keine Artikel in dieser Kategorie vorhanden sind. Statt der einfachen Ausgabe des Sprachstrings "COM_CONTENT_NO_ARTICLES" hat man nun ein zusätzliches Editorfeld im Menüpunkt auf dem Reiter "Kategorie".

Zusätzlich werden zwei Sprachoverrides für den Administrationsbereich (Erweiterungen > Sprachen > Overrides > Bereich: Administrator) benötigt:

  • COM_CONTENT_CATEGORY_VIEW_BLOG_FREE_GARDEN_TITLE (Name des Menüeintragstyps, z. B. Freie Gärten)
  • COM_CONTENT_FIELD_TEXT_NO_ARTICLES_LABEL (Feldname für das neue Editorfeld)

Durch das zusätzliche Editorfeld hat man nun die Möglichkeit die Ausgabe individuell z. B. mit Bildern und Links zu gestalten. Wird in dem Editorfeld nichts eingetragen, so erfolgt die Ausgabe des Standard-Sprachstrings.

Das Override greift nur, wenn keine Artikel für diese Kategorie vorhanden sind. Ansonsten erfolgt die normale Ausgabe der Blogartikel.

 

Benötigte Override-Dateien


  • <?php
    /**
     * @package     Joomla.Site
     * @subpackage  com_content
     *
     * @copyright   Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
     * @license     GNU General Public License version 2 or later; see LICENSE.txt
     */
    
    defined('_JEXEC') or die;
    
    JHtml::addIncludePath(JPATH_COMPONENT . '/helpers');
    
    JHtml::_('behavior.caption');
    
    $dispatcher = JEventDispatcher::getInstance();
    
    $this->category->text = $this->category->description;
    $dispatcher->trigger('onContentPrepare', array($this->category->extension . '.categories', &$this->category, &$this->params, 0));
    $this->category->description = $this->category->text;
    
    $results = $dispatcher->trigger('onContentAfterTitle', array($this->category->extension . '.categories', &$this->category, &$this->params, 0));
    $afterDisplayTitle = trim(implode("\n", $results));
    
    $results = $dispatcher->trigger('onContentBeforeDisplay', array($this->category->extension . '.categories', &$this->category, &$this->params, 0));
    $beforeDisplayContent = trim(implode("\n", $results));
    
    $results = $dispatcher->trigger('onContentAfterDisplay', array($this->category->extension . '.categories', &$this->category, &$this->params, 0));
    $afterDisplayContent = trim(implode("\n", $results));
    
    ?>
    <div class="blog<?php echo $this->pageclass_sfx; ?>" itemscope itemtype="https://schema.org/Blog">
    	<?php if ($this->params->get('show_page_heading')) : ?>
    		<div class="page-header">
    			<h1> <?php echo $this->escape($this->params->get('page_heading')); ?> </h1>
    		</div>
    	<?php endif; ?>
    
    	<?php if ($this->params->get('show_category_title', 1) or $this->params->get('page_subheading')) : ?>
    		<h2> <?php echo $this->escape($this->params->get('page_subheading')); ?>
    			<?php if ($this->params->get('show_category_title')) : ?>
    				<span class="subheading-category"><?php echo $this->category->title; ?></span>
    			<?php endif; ?>
    		</h2>
    	<?php endif; ?>
    	<?php echo $afterDisplayTitle; ?>
    
    	<?php if ($this->params->get('show_cat_tags', 1) && !empty($this->category->tags->itemTags)) : ?>
    		<?php $this->category->tagLayout = new JLayoutFile('joomla.content.tags'); ?>
    		<?php echo $this->category->tagLayout->render($this->category->tags->itemTags); ?>
    	<?php endif; ?>
    
    	<?php if ($beforeDisplayContent || $afterDisplayContent || $this->params->get('show_description', 1) || $this->params->def('show_description_image', 1)) : ?>
    		<div class="category-desc clearfix">
    			<?php if ($this->params->get('show_description_image') && $this->category->getParams()->get('image')) : ?>
    				<img src="<?php echo $this->category->getParams()->get('image'); ?>" alt="<?php echo htmlspecialchars($this->category->getParams()->get('image_alt'), ENT_COMPAT, 'UTF-8'); ?>"/>
    			<?php endif; ?>
    			<?php echo $beforeDisplayContent; ?>
    			<?php if ($this->params->get('show_description') && $this->category->description) : ?>
    				<?php echo JHtml::_('content.prepare', $this->category->description, '', 'com_content.category'); ?>
    			<?php endif; ?>
    			<?php echo $afterDisplayContent; ?>
    		</div>
    	<?php endif; ?>
    
    	<?php if (empty($this->lead_items) && empty($this->link_items) && empty($this->intro_items)) : ?>
    		<?php if ($this->params->get('show_no_articles', 1)) : ?>
    			
              <?php // ---------------- O V E R R I D E ----------------- ?>
              <?php if (!empty($this->params->get('text_no_articles'))) : ?>
    				<div><?php echo $this->params->get('text_no_articles'); ?></div>
              <?php else : ?>         
                    <p><?php echo JText::_('COM_CONTENT_NO_ARTICLES'); ?></p>
    		  <?php endif; ?>
              <?php // --------------- E N D E - O V E R R I D E ------------ ?>
    			
    		<?php endif; ?>
    	<?php endif; ?>
    
    	<?php $leadingcount = 0; ?>
    	<?php if (!empty($this->lead_items)) : ?>
    		<div class="items-leading clearfix">
    			<?php foreach ($this->lead_items as &$item) : ?>
    				<div class="leading-<?php echo $leadingcount; ?><?php echo $item->state == 0 ? ' system-unpublished' : null; ?>"
    					itemprop="blogPost" itemscope itemtype="https://schema.org/BlogPosting">
    					<?php
    					$this->item = &$item;
    					echo $this->loadTemplate('item');
    					?>
    				</div>
    				<?php $leadingcount++; ?>
    			<?php endforeach; ?>
    		</div><!-- end items-leading -->
    	<?php endif; ?>
    
    	<?php
    	$introcount = count($this->intro_items);
    	$counter = 0;
    	?>
    
    	<?php if (!empty($this->intro_items)) : ?>
    		<?php foreach ($this->intro_items as $key => &$item) : ?>
    			<?php $rowcount = ((int) $key % (int) $this->columns) + 1; ?>
    			<?php if ($rowcount === 1) : ?>
    				<?php $row = $counter / $this->columns; ?>
    				<div class="items-row cols-<?php echo (int) $this->columns; ?> <?php echo 'row-' . $row; ?> row-fluid clearfix">
    			<?php endif; ?>
    			<div class="span<?php echo round(12 / $this->columns); ?>">
    				<div class="item column-<?php echo $rowcount; ?><?php echo $item->state == 0 ? ' system-unpublished' : null; ?>"
    					itemprop="blogPost" itemscope itemtype="https://schema.org/BlogPosting">
    					<?php
    					$this->item = &$item;
    					echo $this->loadTemplate('item');
    					?>
    				</div>
    				<!-- end item -->
    				<?php $counter++; ?>
    			</div><!-- end span -->
    			<?php if (($rowcount == $this->columns) or ($counter == $introcount)) : ?>
    				</div><!-- end row -->
    			<?php endif; ?>
    		<?php endforeach; ?>
    	<?php endif; ?>
    
    	<?php if (!empty($this->link_items)) : ?>
    		<div class="items-more">
    			<?php echo $this->loadTemplate('links'); ?>
    		</div>
    	<?php endif; ?>
    
    	<?php if ($this->maxLevel != 0 && !empty($this->children[$this->category->id])) : ?>
    		<div class="cat-children">
    			<?php if ($this->params->get('show_category_heading_title_text', 1) == 1) : ?>
    				<h3> <?php echo JText::_('JGLOBAL_SUBCATEGORIES'); ?> </h3>
    			<?php endif; ?>
    			<?php echo $this->loadTemplate('children'); ?> </div>
    	<?php endif; ?>
    	<?php if (($this->params->def('show_pagination', 1) == 1 || ($this->params->get('show_pagination') == 2)) && ($this->pagination->get('pages.total') > 1)) : ?>
    		<div class="pagination">
    			<?php if ($this->params->def('show_pagination_results', 1)) : ?>
    				<p class="counter pull-right"> <?php echo $this->pagination->getPagesCounter(); ?> </p>
    			<?php endif; ?>
    			<?php echo $this->pagination->getPagesLinks(); ?> </div>
    	<?php endif; ?>
    </div>
  • <?xml version="1.0" encoding="utf-8"?>
    <metadata>
    	<layout title="COM_CONTENT_CATEGORY_VIEW_BLOG_FREE_GARDEN_TITLE" option="COM_CONTENT_CATEGORY_VIEW_BLOG_OPTION">
    		<help key = "JHELP_MENUS_MENU_ITEM_ARTICLE_CATEGORY_BLOG" />
    		<message>
    			<![CDATA[COM_CONTENT_CATEGORY_VIEW_BLOG_DESC]]>
    		</message>
    	</layout>
    
    	<!-- Add fields to the request variables for the layout. -->
    	<fields name="request">
    		<fieldset name="request"
    			addfieldpath="/administrator/components/com_categories/models/fields"
    		>
    			<field
    				name="id"
    				type="modal_category"
    				label="JGLOBAL_CHOOSE_CATEGORY_LABEL"
    				description="JGLOBAL_CHOOSE_CATEGORY_DESC"
    				extension="com_content"
    				required="true"
    				select="true"
    				new="true"
    				edit="true"
    				clear="true"
    			/>
    
    			<field
    				name="filter_tag"
    				type="tag"
    				label="JTAG"
    				description="JTAG_FIELD_SELECT_DESC"
    				multiple="true"
    			/>
    		</fieldset>
    	</fields>
    
    	<!-- Add fields to the parameters object for the layout. -->
    	<fields name="params">
    		<fieldset name="basic" label="JGLOBAL_CATEGORY_OPTIONS">
    				<field
    					name="layout_type"
    					type="hidden"
    					default="blog"
    				/>
    
    				<field
    					name="show_category_heading_title_text"
    					type="list"
    	 				label="JGLOBAL_SHOW_CATEGORY_HEADING_TITLE_TEXT_LABEL"
    					description="JGLOBAL_SHOW_CATEGORY_HEADING_TITLE_TEXT_DESC"
    					useglobal="true"
    					class="chzn-color"
    					>
    					<option value="0">JHIDE</option>
    					<option value="1">JSHOW</option>
    				</field>
    
    				<field
    					name="show_category_title"
    					type="list"
    					label="JGLOBAL_SHOW_CATEGORY_TITLE"
    					description="JGLOBAL_SHOW_CATEGORY_TITLE_DESC"
    					useglobal="true"
    					class="chzn-color"
    					>
    					<option value="0">JHIDE</option>
    					<option value="1">JSHOW</option>
    				</field>
    
    				<field
    					name="show_description"
    					type="list"
    					label="JGLOBAL_SHOW_CATEGORY_DESCRIPTION_LABEL"
    					description="JGLOBAL_SHOW_CATEGORY_DESCRIPTION_DESC"
    					useglobal="true"
    					class="chzn-color"
    					>
    					<option value="0">JHIDE</option>
    					<option value="1">JSHOW</option>
    				</field>
    
    				<field
    					name="show_description_image"
    					type="list"
    					label="JGLOBAL_SHOW_CATEGORY_IMAGE_LABEL"
    					description="JGLOBAL_SHOW_CATEGORY_IMAGE_DESC"
    					useglobal="true"
    					class="chzn-color"
    					>
    					<option value="0">JHIDE</option>
    					<option value="1">JSHOW</option>
    				</field>
    
    				<field
    					name="maxLevel"
    					type="list"
    					label="JGLOBAL_MAXLEVEL_LABEL"
    					description="JGLOBAL_MAXLEVEL_DESC"
    					useglobal="true"
    					>
    					<option value="-1">JALL</option>
    					<option value="0">JNONE</option>
    					<option value="1">J1</option>
    					<option value="2">J2</option>
    					<option value="3">J3</option>
    					<option value="4">J4</option>
    					<option value="5">J5</option>
    				</field>
    
    				<field
    					name="show_empty_categories"
    					type="list"
    					label="JGLOBAL_SHOW_EMPTY_CATEGORIES_LABEL"
    					description="COM_CONTENT_SHOW_EMPTY_CATEGORIES_DESC"
    					useglobal="true"
    					class="chzn-color"
    					>
    					<option value="0">JHIDE</option>
    					<option value="1">JSHOW</option>
    				</field>
    
    				<field
    					name="show_no_articles"
    					type="list"
    					label="COM_CONTENT_NO_ARTICLES_LABEL"
    					description="COM_CONTENT_NO_ARTICLES_DESC"
    					useglobal="true"
    					class="chzn-color"
    					>
    					<option value="0">JHIDE</option>
    					<option value="1">JSHOW</option>
    				</field>
    
    				<field
    					name="show_subcat_desc"
    					type="list"
    					label="JGLOBAL_SHOW_SUBCATEGORIES_DESCRIPTION_LABEL"
    					description="JGLOBAL_SHOW_SUBCATEGORIES_DESCRIPTION_DESC"
    					useglobal="true"
    					class="chzn-color"
    					>
    					<option value="0">JHIDE</option>
    					<option value="1">JSHOW</option>
    				</field>
    
    				<field
    					name="show_cat_num_articles"
    					type="list"
    					label="COM_CONTENT_NUMBER_CATEGORY_ITEMS_LABEL"
    					description="COM_CONTENT_NUMBER_CATEGORY_ITEMS_DESC"
    					useglobal="true"
    					class="chzn-color"
    					>
    					<option value="0">JHIDE</option>
    					<option value="1">JSHOW</option>
    				</field>
    
    				<field 
    					name="show_cat_tags"
    					type="list"
    					label="COM_CONTENT_FIELD_SHOW_CAT_TAGS_LABEL"
    					description="COM_CONTENT_FIELD_SHOW_CAT_TAGS_DESC"
    					useglobal="true"
    					class="chzn-color"
    					>
    					<option value="0">JHIDE</option>
    					<option value="1">JSHOW</option>
    				</field>
    
    				<field
    					name="page_subheading"
    					type="text"
    					label="JGLOBAL_SUBHEADING_LABEL"
    					description="JGLOBAL_SUBHEADING_DESC"
    					size="20"
    				/>
    
          			<!-- Feld hinzugefügt -->
          			<field 
          				name="text_no_articles"
          				type="editor"
          				label="COM_CONTENT_FIELD_TEXT_NO_ARTICLES_LABEL"
          				description="COM_CONTENT_FIELD_TEXT_NO_ARTICLES_DESC"
          				filter="safehtml" 
          			/>
          
    		</fieldset>
    
    		<fieldset name="advanced" label="JGLOBAL_BLOG_LAYOUT_OPTIONS">
    				<field 
    					name="bloglayout"
    					type="spacer"
    					label="JGLOBAL_SUBSLIDER_BLOG_LAYOUT_LABEL"
    					class="text"
    				/>
    
    				<field
    					name="num_leading_articles"
    					type="number"
    					label="JGLOBAL_NUM_LEADING_ARTICLES_LABEL"
    					description="JGLOBAL_NUM_LEADING_ARTICLES_DESC"
    					useglobal="true"
    					size="3"
    				/>
    
    				<field
    					name="num_intro_articles"
    					type="number"
    					label="JGLOBAL_NUM_INTRO_ARTICLES_LABEL"
    					description="JGLOBAL_NUM_INTRO_ARTICLES_DESC"
    					useglobal="true"
    					size="3"
    				/>
    
    				<field
    					name="num_columns"
    					type="number"
    					label="JGLOBAL_NUM_COLUMNS_LABEL"
    					description="JGLOBAL_NUM_COLUMNS_DESC"
    					useglobal="true"
    					size="3"
    				/>
    
    				<field
    					name="num_links"
    					type="number"
    					label="JGLOBAL_NUM_LINKS_LABEL"
    					description="JGLOBAL_NUM_LINKS_DESC"
    					useglobal="true"
    					size="3"
    				/>
    
    				<field
    					name="multi_column_order"
    					type="list"
    					label="JGLOBAL_MULTI_COLUMN_ORDER_LABEL"
    					description="JGLOBAL_MULTI_COLUMN_ORDER_DESC"
    					useglobal="true"
    					>
    					<option value="0">JGLOBAL_DOWN</option>
    					<option value="1">JGLOBAL_ACROSS</option>
    				</field>
    
    				<field
    					name="show_subcategory_content"
    					type="list"
    					label="JGLOBAL_SHOW_SUBCATEGORY_CONTENT_LABEL"
    					description="JGLOBAL_SHOW_SUBCATEGORY_CONTENT_DESC"
    					useglobal="true"
    					>
    					<option value="0">JNONE</option>
    					<option value="-1">JALL</option>
    					<option value="1">J1</option>
    					<option value="2">J2</option>
    					<option value="3">J3</option>
    					<option value="4">J4</option>
    					<option value="5">J5</option>
    				</field>
    
    				<field
    					name="spacer1"
    					type="spacer"
    					hr="true"
    				/>
    
    				<field
    					name="orderby_pri"
    					type="list"
    					label="JGLOBAL_CATEGORY_ORDER_LABEL"
    					description="JGLOBAL_CATEGORY_ORDER_DESC"
    					useglobal="true"
    					>
    					<option value="none">JGLOBAL_NO_ORDER</option>
    					<option value="alpha">JGLOBAL_TITLE_ALPHABETICAL</option>
    					<option value="ralpha">JGLOBAL_TITLE_REVERSE_ALPHABETICAL</option>
    					<option value="order">JGLOBAL_CATEGORY_MANAGER_ORDER</option>
    				</field>
    
    				<field
    					name="orderby_sec"
    					type="list"
    					label="JGLOBAL_ARTICLE_ORDER_LABEL"
    					description="JGLOBAL_ARTICLE_ORDER_DESC"
    					useglobal="true"
    					>
    					<option value="front">COM_CONTENT_FEATURED_ORDER</option>
    					<option value="rdate">JGLOBAL_MOST_RECENT_FIRST</option>
    					<option value="date">JGLOBAL_OLDEST_FIRST</option>
    					<option value="alpha">JGLOBAL_TITLE_ALPHABETICAL</option>
    					<option value="ralpha">JGLOBAL_TITLE_REVERSE_ALPHABETICAL</option>
    					<option value="author">JGLOBAL_AUTHOR_ALPHABETICAL</option>
    					<option value="rauthor">JGLOBAL_AUTHOR_REVERSE_ALPHABETICAL</option>
    					<option value="hits">JGLOBAL_MOST_HITS</option>
    					<option value="rhits">JGLOBAL_LEAST_HITS</option>
    					<option value="random">JGLOBAL_RANDOM_ORDER</option>
    					<option value="order">JGLOBAL_ORDERING</option>
    					<option	value="rorder">JGLOBAL_REVERSE_ORDERING</option>
    					<option value="vote" requires="vote">JGLOBAL_VOTES_DESC</option>
    					<option value="rvote" requires="vote">JGLOBAL_VOTES_ASC</option>
    					<option value="rank" requires="vote">JGLOBAL_RATINGS_DESC</option>
    					<option value="rrank" requires="vote">JGLOBAL_RATINGS_ASC</option>
    				</field>
    
    				<field
    					name="order_date"
    					type="list"
    					label="JGLOBAL_ORDERING_DATE_LABEL"
    					description="JGLOBAL_ORDERING_DATE_DESC"
    					useglobal="true"
    					>
    					<option value="created">JGLOBAL_CREATED</option>
    					<option value="modified">JGLOBAL_MODIFIED</option>
    					<option value="published">JPUBLISHED</option>
    					<option value="unpublished">JUNPUBLISHED</option>
    				</field>
    
    				<field
    					name="show_pagination"
    					type="list"
    					label="JGLOBAL_PAGINATION_LABEL"
    					description="JGLOBAL_PAGINATION_DESC"
    					useglobal="true"
    					class="chzn-color"
    					>
    					<option value="0">JHIDE</option>
    					<option value="1">JSHOW</option>
    					<option value="2">JGLOBAL_AUTO</option>
    				</field>
    
    				<field
    					name="show_pagination_results"
    					type="list"
    					label="JGLOBAL_PAGINATION_RESULTS_LABEL"
    					description="JGLOBAL_PAGINATION_RESULTS_DESC"
    					useglobal="true"
    					class="chzn-color"
    					>
    					<option value="0">JHIDE</option>
    					<option value="1">JSHOW</option>
    				</field>
    
    				<field
    					name="show_featured"
    					type="list"
    					default=""
    					label="JGLOBAL_SHOW_FEATURED_ARTICLES_LABEL"
    					description="JGLOBAL_SHOW_FEATURED_ARTICLES_DESC"
    					useglobal="true"
    					class="chzn-color"
    					>
    					<option value="show">JSHOW</option>
    					<option value="hide">JHIDE</option>
    					<option value="only">JONLY</option>
    				</field>
    		</fieldset>
    
    		<fieldset name="article" label="COM_CONTENT_ATTRIBS_FIELDSET_LABEL">
    
    			<field
    				name="article_layout" type="componentlayout"
    				label="JGLOBAL_FIELD_LAYOUT_LABEL"
    				description="JGLOBAL_FIELD_LAYOUT_DESC"
    				menuitems="true"
    				extension="com_content"
    				view="article"
    			/>
    
    			<field
    				name="show_title"
    				type="list"
    				label="JGLOBAL_SHOW_TITLE_LABEL"
    				description="JGLOBAL_SHOW_TITLE_DESC"
    				useglobal="true"
    				class="chzn-color"
    				>
    				<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
    				<option value="0">JHIDE</option>
    				<option value="1">JSHOW</option>
    			</field>
    
    			<field
    				name="link_titles"
    				type="list"
    				label="JGLOBAL_LINKED_TITLES_LABEL"
    				description="JGLOBAL_LINKED_TITLES_DESC"
    				useglobal="true"
    				class="chzn-color"
    				>
    				<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
    				<option value="0">JNO</option>
    				<option value="1">JYES</option>
    			</field>
    
    			<field
    				name="show_intro"
    				type="list"
    				label="JGLOBAL_SHOW_INTRO_LABEL"
    				description="JGLOBAL_SHOW_INTRO_DESC"
    				useglobal="true"
    				class="chzn-color"
    				>
    				<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
    				<option value="0">JHIDE</option>
    				<option value="1">JSHOW</option>
    			</field>
    
    			<field
    				name="info_block_position"
    				type="list"
    				label="COM_CONTENT_FIELD_INFOBLOCK_POSITION_LABEL"
    				description="COM_CONTENT_FIELD_INFOBLOCK_POSITION_DESC"
    				default=""
    				useglobal="true"
    				class="chzn-color"
    				>
    				<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
    				<option value="0">COM_CONTENT_FIELD_OPTION_ABOVE</option>
    				<option value="1">COM_CONTENT_FIELD_OPTION_BELOW</option>
    				<option value="2">COM_CONTENT_FIELD_OPTION_SPLIT</option>
    			</field>
    
    			<field
    				name="info_block_show_title"
    				type="list"
    				label="COM_CONTENT_FIELD_INFOBLOCK_TITLE_LABEL"
    				description="COM_CONTENT_FIELD_INFOBLOCK_TITLE_DESC"
    				useglobal="true"
    				class="chzn-color"
    				>
    				<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
    				<option	value="0">JHIDE</option>
    				<option	value="1">JSHOW</option>
    			</field>
    
    			<field
    				name="show_category"
    				type="list"
    				label="JGLOBAL_SHOW_CATEGORY_LABEL"
    				description="JGLOBAL_SHOW_CATEGORY_DESC"
    				useglobal="true"
    				class="chzn-color"
    				>
    				<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
    				<option value="0">JHIDE</option>
    				<option value="1">JSHOW</option>
    			</field>
    
    			<field
    				name="link_category"
    				type="list"
    				label="JGLOBAL_LINK_CATEGORY_LABEL"
    				description="JGLOBAL_LINK_CATEGORY_DESC"
    				useglobal="true"
    				class="chzn-color"
    				>
    				<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
    				<option value="0">JNO</option>
    				<option value="1">JYES</option>
    			</field>
    
    			<field
    				name="show_parent_category"
    				type="list"
    				label="JGLOBAL_SHOW_PARENT_CATEGORY_LABEL"
    				description="JGLOBAL_SHOW_PARENT_CATEGORY_DESC"
    				useglobal="true"
    				class="chzn-color"
    				>
    				<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
    				<option value="0">JHIDE</option>
    				<option value="1">JSHOW</option>
    			</field>
    
    			<field
    				name="link_parent_category"
    				type="list"
    				label="JGLOBAL_LINK_PARENT_CATEGORY_LABEL"
    				description="JGLOBAL_LINK_PARENT_CATEGORY_DESC"
    				useglobal="true"
    				class="chzn-color"
    				>
    				<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
    				<option value="0">JNO</option>
    				<option value="1">JYES</option>
    			</field>
    
    			<field
    				name="show_associations"
    				type="list"
    				label="JGLOBAL_SHOW_ASSOCIATIONS_LABEL"
    				description="JGLOBAL_SHOW_ASSOCIATIONS_DESC"
    				useglobal="true"
    				class="chzn-color"
    				>
    				<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
    				<option value="0">JHIDE</option>
    				<option value="1">JSHOW</option>
    			</field>
    
    			<field
    				name="show_author"
    				type="list"
    				label="JGLOBAL_SHOW_AUTHOR_LABEL"
    				description="JGLOBAL_SHOW_AUTHOR_DESC"
    				useglobal="true"
    				class="chzn-color"
    				>
    				<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
    				<option value="0">JHIDE</option>
    				<option value="1">JSHOW</option>
    			</field>
    
    			<field
    				name="link_author"
    				type="list"
    				label="JGLOBAL_LINK_AUTHOR_LABEL"
    				description="JGLOBAL_LINK_AUTHOR_DESC"
    				useglobal="true"
    				class="chzn-color"
    				>
    				<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
    				<option value="0">JNO</option>
    				<option value="1">JYES</option>
    			</field>
    
    			<field
    				name="show_create_date"
    				type="list"
    				label="JGLOBAL_SHOW_CREATE_DATE_LABEL"
    				description="JGLOBAL_SHOW_CREATE_DATE_DESC"
    				useglobal="true"
    				class="chzn-color"
    				>
    				<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
    				<option value="0">JHIDE</option>
    				<option value="1">JSHOW</option>
    			</field>
    
    			<field
    				name="show_modify_date"
    				type="list"
    				label="JGLOBAL_SHOW_MODIFY_DATE_LABEL"
    				description="JGLOBAL_SHOW_MODIFY_DATE_DESC"
    				useglobal="true"
    				class="chzn-color"
    				>
    				<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
    				<option value="0">JHIDE</option>
    				<option value="1">JSHOW</option>
    			</field>
    
    			<field
    				name="show_publish_date"
    				type="list"
    				label="JGLOBAL_SHOW_PUBLISH_DATE_LABEL"
    				description="JGLOBAL_SHOW_PUBLISH_DATE_DESC"
    				useglobal="true"
    				class="chzn-color"
    				>
    				<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
    				<option value="0">JHIDE</option>
    				<option value="1">JSHOW</option>
    			</field>
    
    			<field
    				name="show_item_navigation"
    				type="list"
    				label="JGLOBAL_SHOW_NAVIGATION_LABEL"
    				description="JGLOBAL_SHOW_NAVIGATION_DESC"
    				useglobal="true"
    				class="chzn-color"
    				>
    				<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
    				<option value="0">JHIDE</option>
    				<option value="1">JSHOW</option>
    			</field>
    
    			<field
    				name="show_vote"
    				type="list"
    				label="JGLOBAL_SHOW_VOTE_LABEL"
    				description="JGLOBAL_SHOW_VOTE_DESC"
    				useglobal="true"
    				class="chzn-color"
    				>
    				<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
    				<option value="0">JHIDE</option>
    				<option	value="1">JSHOW</option>
    			</field>
    
    			<field
    				name="show_readmore"
    				type="list"
    				label="JGLOBAL_SHOW_READMORE_LABEL"
    				description="JGLOBAL_SHOW_READMORE_DESC"
    				useglobal="true"
    				class="chzn-color"
    				>
    				<option value="0">JHIDE</option>
    				<option value="1">JSHOW</option>
    			</field>
    
    			<field
    				name="show_readmore_title"
    				type="list"
    				label="JGLOBAL_SHOW_READMORE_TITLE_LABEL"
    				description="JGLOBAL_SHOW_READMORE_TITLE_DESC"
    				useglobal="true"
    				class="chzn-color"
    				>
    				<option value="0">JHIDE</option>
    				<option value="1">JSHOW</option>
    			</field>
    
    			<field
    				name="show_icons"
    				type="list"
    				label="JGLOBAL_SHOW_ICONS_LABEL"
    				description="JGLOBAL_SHOW_ICONS_DESC"
    				useglobal="true"
    				class="chzn-color"
    				>
    				<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
    				<option value="0">JHIDE</option>
    				<option value="1">JSHOW</option>
    			</field>
    
    			<field
    				name="show_print_icon"
    				type="list"
    				label="JGLOBAL_SHOW_PRINT_ICON_LABEL"
    				description="JGLOBAL_SHOW_PRINT_ICON_DESC"
    				useglobal="true"
    				class="chzn-color"
    				>
    				<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
    				<option value="0">JHIDE</option>
    				<option value="1">JSHOW</option>
    			</field>
    
    			<field
    				name="show_email_icon"
    				type="list"
    				label="JGLOBAL_Show_Email_Icon_Label"
    				description="JGLOBAL_Show_Email_Icon_Desc"
    				useglobal="true"
    				class="chzn-color"
    				>
    				<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
    				<option value="0">JHIDE</option>
    				<option value="1">JSHOW</option>
    			</field>
    
    			<field
    				name="show_hits"
    				type="list"
    				label="JGLOBAL_SHOW_HITS_LABEL"
    				description="JGLOBAL_SHOW_HITS_DESC"
    				useglobal="true"
    				class="chzn-color"
    				>
    				<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
    				<option value="0">JHIDE</option>
    				<option value="1">JSHOW</option>
    			</field>
    
    			<field
    				name="show_tags"
    				type="list"
    				label="COM_CONTENT_FIELD_SHOW_TAGS_LABEL"
    				description="COM_CONTENT_FIELD_SHOW_TAGS_DESC"
    				useglobal="true"
    				class="chzn-color"
    				>
    				<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
    				<option value="0">JHIDE</option>
    				<option value="1">JSHOW</option>
    			</field>
    
    			<field
    				name="show_noauth"
    				type="list"
    				label="JGLOBAL_SHOW_UNAUTH_LINKS_LABEL"
    				description="JGLOBAL_SHOW_UNAUTH_LINKS_DESC"
    				useglobal="true"
    				class="chzn-color"
    				>
    				<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
    				<option value="0">JNO</option>
    				<option value="1">JYES</option>
    			</field>
    		</fieldset>
    
    		<fieldset name="integration" label="COM_MENUS_INTEGRATION_FIELDSET_LABEL">
    			<field
    				name="show_feed_link"
    				type="list"
    				label="JGLOBAL_SHOW_FEED_LINK_LABEL"
    				description="JGLOBAL_SHOW_FEED_LINK_DESC"
    				useglobal="true"
    				class="chzn-color"
    				>
    				<option value="0">JHIDE</option>
    				<option value="1">JSHOW</option>
    			</field>
    
    			<field
    				name="feed_summary"
    				type="list"
    				label="JGLOBAL_FEED_SUMMARY_LABEL"
    				description="JGLOBAL_FEED_SUMMARY_DESC"
    				useglobal="true"
    				>
    				<option value="0">JGLOBAL_INTRO_TEXT</option>
    				<option value="1">JGLOBAL_FULL_TEXT</option>
    			</field>
    		</fieldset>
    	</fields>
    </metadata>
  • <?php
    /**
     * @package     Joomla.Site
     * @subpackage  com_content
     *
     * @copyright   Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
     * @license     GNU General Public License version 2 or later; see LICENSE.txt
     */
    
    defined('_JEXEC') or die;
    
    // Create a shortcut for params.
    $params = $this->item->params;
    JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
    $canEdit = $this->item->params->get('access-edit');
    $info    = $params->get('info_block_position', 0);
    
    // Check if associations are implemented. If they are, define the parameter.
    $assocParam = (JLanguageAssociations::isEnabled() && $params->get('show_associations'));
    
    ?>
    <?php if ($this->item->state == 0 || strtotime($this->item->publish_up) > strtotime(JFactory::getDate())
    	|| ((strtotime($this->item->publish_down) < strtotime(JFactory::getDate())) && $this->item->publish_down != JFactory::getDbo()->getNullDate())) : ?>
    	<div class="system-unpublished">
    <?php endif; ?>
    
    <?php echo JLayoutHelper::render('joomla.content.blog_style_default_item_title', $this->item); ?>
    
    <?php if ($canEdit || $params->get('show_print_icon') || $params->get('show_email_icon')) : ?>
    	<?php echo JLayoutHelper::render('joomla.content.icons', array('params' => $params, 'item' => $this->item, 'print' => false)); ?>
    <?php endif; ?>
    
    <?php // Todo Not that elegant would be nice to group the params ?>
    <?php $useDefList = ($params->get('show_modify_date') || $params->get('show_publish_date') || $params->get('show_create_date')
    	|| $params->get('show_hits') || $params->get('show_category') || $params->get('show_parent_category') || $params->get('show_author') || $assocParam); ?>
    
    <?php if ($useDefList && ($info == 0 || $info == 2)) : ?>
    	<?php // Todo: for Joomla4 joomla.content.info_block.block can be changed to joomla.content.info_block ?>
    	<?php echo JLayoutHelper::render('joomla.content.info_block.block', array('item' => $this->item, 'params' => $params, 'position' => 'above')); ?>
    <?php endif; ?>
    <?php if ($info == 0 && $params->get('show_tags', 1) && !empty($this->item->tags->itemTags)) : ?>
    	<?php echo JLayoutHelper::render('joomla.content.tags', $this->item->tags->itemTags); ?>
    <?php endif; ?>
    
    <?php echo JLayoutHelper::render('joomla.content.intro_image', $this->item); ?>
    
    <?php if (!$params->get('show_intro')) : ?>
    	<?php // Content is generated by content plugin event "onContentAfterTitle" ?>
    	<?php echo $this->item->event->afterDisplayTitle; ?>
    <?php endif; ?>
    
    <?php // Content is generated by content plugin event "onContentBeforeDisplay" ?>
    <?php echo $this->item->event->beforeDisplayContent; ?>
    
    <?php echo $this->item->introtext; ?>
    
    <?php if ($info == 1 || $info == 2) : ?>
    	<?php if ($useDefList) : ?>
    		<?php // Todo: for Joomla4 joomla.content.info_block.block can be changed to joomla.content.info_block ?>
    		<?php echo JLayoutHelper::render('joomla.content.info_block.block', array('item' => $this->item, 'params' => $params, 'position' => 'below')); ?>
    	<?php endif; ?>
    	<?php if ($params->get('show_tags', 1) && !empty($this->item->tags->itemTags)) : ?>
    		<?php echo JLayoutHelper::render('joomla.content.tags', $this->item->tags->itemTags); ?>
    	<?php endif; ?>
    <?php endif; ?>
    
    <?php if ($params->get('show_readmore') && $this->item->readmore) :
    	if ($params->get('access-view')) :
    		$link = JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid, $this->item->language));
    	else :
    		$menu = JFactory::getApplication()->getMenu();
    		$active = $menu->getActive();
    		$itemId = $active->id;
    		$link = new JUri(JRoute::_('index.php?option=com_users&view=login&Itemid=' . $itemId, false));
    		$link->setVar('return', base64_encode(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid, $this->item->language)));
    	endif; ?>
    
    	<?php echo JLayoutHelper::render('joomla.content.readmore', array('item' => $this->item, 'params' => $params, 'link' => $link)); ?>
    
    <?php endif; ?>
    
    <?php if ($this->item->state == 0 || strtotime($this->item->publish_up) > strtotime(JFactory::getDate())
    	|| ((strtotime($this->item->publish_down) < strtotime(JFactory::getDate())) && $this->item->publish_down != JFactory::getDbo()->getNullDate())) : ?>
    </div>
    <?php endif; ?>
    
    <?php // Content is generated by content plugin event "onContentAfterDisplay" ?>
    <?php echo $this->item->event->afterDisplayContent; ?>
    





Fehler melden

Bitte beachte unsere Datenschutzerklärung

Alle mit * markierten Felder werden benötigt um eine E-Mail zu senden.