Habe auch das Problem dass kein Detailinhalt vorhanden ist, die Weiterlesen-Buttons jedoch trotzdem angezeigt werden.
Code:
Array
(
[id] => 80
[pid] => 2
[tstamp] => 1514387225
[headline] => Headline
[alias] => alias
[author] =>
[date] =>
[time] => 1504774980
[subheadline] =>
[teaser] =>
Teaser lorem ipsum...
[addImage] =>
[singleSRC] => P? |???\@??.l/
[alt] => A-Chem Group
[size] => a:3:{i:0;s:3:"300";i:1;s:3:"300";i:2;s:4:"crop";}
[imagemargin] => a:5:{s:6:"bottom";s:0:"";s:4:"left";s:0:"";s:5:"right";s:0:"";s:3:"top";s:0:"";s:4:"unit";s:0:"";}
[imageUrl] =>
[fullsize] =>
[caption] =>
[floating] => above
[addEnclosure] =>
[enclosure] => Array
(
)
[source] => internal
[jumpTo] => 32
[articleId] => 0
[url] =>
[target] =>
[cssClass] =>
[noComments] =>
[featured] =>
[published] => 1
[start] =>
[stop] =>
[meta_title] =>
[lazyDisable] =>
[sharebuttons_networks] =>
[sharebuttons_theme] =>
[sharebuttons_template] => sharebuttons_default
[addYouTube] =>
[youtube] =>
[autoplay] =>
[addPreviewImage] =>
[posterSRC] =>
[youtubeFullsize] =>
[youtubeLinkText] =>
[videoDuration] =>
[addPlayButton] =>
[languageMain] => 0
[tags] => Array
(
[0] => Americas
)
[class] => odd
[newsHeadline] => Headline
[subHeadline] =>
[hasSubHeadline] =>
[linkHeadline] => Headline
[more] => Weiterlesen … Titel
[link] => de/link
[archive] => Contao\NewsArchiveModel Object
(
[arrData:protected] => Array
(
[id] => 2
[tstamp] => 1501841969
[title] => Standorte DE
[jumpTo] => 29
[protected] =>
[groups] =>
[allowComments] =>
[notify] => notify_admin
[sortOrder] => ascending
[perPage] => 0
[moderate] =>
[bbcode] =>
[requireLogin] =>
[disableCaptcha] =>
[sharebuttons_networks] =>
[sharebuttons_theme] =>
[sharebuttons_template] => sharebuttons_default
[master] => 0
)
[arrModified:protected] => Array
(
)
[arrRelations:protected] => Array
(
[jumpTo] => Array
(
[table] => tl_page
[field] => id
[type] => hasOne
[load] => eager
)
[groups] => Array
(
[table] => tl_member_group
[field] => id
[type] => hasMany
[load] => lazy
)
[master] => Array
(
[table] => tl_news_archive
[field] => id
[type] => hasOne
)
)
[arrRelated:protected] => Array
(
[jumpTo] => Contao\PageModel Object
(
[blnDetailsLoaded:protected] => 1
[arrData:protected] => Array
(
[id] => 29
[pid] => 41
[sorting] => 640
[tstamp] => 1513783194
[title] => Standorte
[alias] => standorte
[type] => regular
[pageTitle] =>
[language] => de
[robots] => noindex,nofollow
[description] =>
[redirect] => permanent
[jumpTo] => 0
[url] =>
[target] =>
[dns] =>
[staticFiles] =>
[staticPlugins] =>
[fallback] =>
[adminEmail] =>
[dateFormat] => d.m.Y
[timeFormat] => H:i
[datimFormat] => Y-m-d H:i
[createSitemap] =>
[sitemapName] =>
[useSSL] =>
[autoforward] =>
[protected] =>
[groups] =>
[includeLayout] =>
[layout] => 1
[mobileLayout] => 0
[includeCache] =>
[cache] =>
[includeChmod] =>
[cuser] => 0
[cgroup] => 0
[chmod] => a:9:{i:0;s:2:"u1";i:1;s:2:"u2";i:2;s:2:"u3";i:3;s:2:"u4";i:4;s:2:"u5";i:5;s:2:"u6";i:6;s:2:"g4";i:7;s:2:"g5";i:8;s:2:"g6";}
[noSearch] =>
[cssClass] =>
[sitemap] => map_never
[hide] =>
[guests] =>
[tabindex] => 0
[accesskey] =>
[published] => 1
[start] =>
[stop] =>
[cookiebar_enable] =>
[cookiebar_message] =>
[cookiebar_jumpTo] => 0
[cookiebar_position] => top
[cookiebar_placement] => body_end
[cookiebar_button] =>
[cookiebar_combineAssets] =>
[ga_analyticsid] =>
[ga_anonymizeip] =>
[ga_ignoreadmins] =>
[ga_ignoremembers] =>
[ga_externaltracking] =>
[ga_addlinktracking] =>
[ga_setdomainname] =>
[ga_titlelinktracking] =>
[ga_bounceseconds] => 0
[ga_eventtracking] =>
[ogTagsEnable] =>
[ogTags] =>
[ogType] => website
[ogImage] =>
[ogAudio] =>
[ogVideo] =>
[dlh_googlemaps_apikey] =>
[youtube_template] => youtube_default
[youtubePrivacy] =>
[youtubePrivacyTemplate] => youtubeprivacy_default
[languageMain] => 0
[languageRoot] => 0
[languageQuery] =>
[addFontIcon] =>
[fontIcon] =>
[cssStyleSelector] =>
[geo_single_page] =>
[geo_child_page] =>
[geo_single_choose] => a:1:{i:0;s:2:"ip";}
[geo_child_choose] =>
[mainAlias] => unternehmen
[mainTitle] => Unternehmen
[mainPageTitle] => Unternehmen
[parentAlias] => unternehmen
[parentTitle] => Unternehmen
[parentPageTitle] => Unternehmen
[folderUrl] => unternehmen/
[rootId] => 1
[rootAlias] => alias
[rootTitle] => Titel
[rootPageTitle] => Titel
[domain] =>
[rootLanguage] => de
[rootIsPublic] => 1
[rootIsFallback] => 1
[rootUseSSL] =>
[rootFallbackLanguage] => de
[trail] => Array
(
[0] => 1
[1] => 41
[2] => 29
)
[subpages] => 0
)
[arrModified:protected] => Array
(
[protected] =>
[groups] =>
[layout] => 0
[mobileLayout] => 0
[cache] => 0
[language] =>
[dateFormat] =>
[timeFormat] =>
[datimFormat] =>
)
[arrRelations:protected] => Array
(
[jumpTo] => Array
(
[table] => tl_page
[field] => id
[type] => hasOne
[load] => lazy
)
[groups] => Array
(
[table] => tl_member_group
[field] => id
[type] => hasMany
[load] => lazy
)
[layout] => Array
(
[table] => tl_layout
[field] => id
[type] => hasOne
[load] => lazy
)
[mobileLayout] => Array
(
[table] => tl_layout
[field] => id
[type] => hasOne
[load] => lazy
)
[cuser] => Array
(
[table] => tl_user
[field] => id
[type] => hasOne
[load] => lazy
)
[cgroup] => Array
(
[table] => tl_user_group
[field] => id
[type] => hasOne
[load] => lazy
)
)
[arrRelated:protected] => Array
(
)
[blnPreventSaving:protected] => 1
)
)
[blnPreventSaving:protected] =>
)
[count] => 2
[text] => 1
[hasText] => 1
[hasTeaser] => 1
[hasMetaFields] =>
[numberOfComments] =>
[commentCount] =>
[timestamp] => 1504774980
[datetime] => 2017-09-07T09:03:00+00:00
[sharebuttons] =>
[showTags] => 1
[showTagClass] => 1
[taglist] => Array
(
[0] => Array
(
[url] => Americas
[tag] => Americas
[class] => Americas
)
)
)
Ich möchte den Weiterlesen-Button nur einblenden, wenn Detailinhalt vorhanden ist.
Dazu sollte ja folgender Code zuständig sein:
Code:
<?php if ($this->hasText || $this->hasTeaser): ?>
<p class="more"><?= $this->more ?></p>
<?php endif; ?>
Wenn jedoch stets "1" rückgegeben wird, wird eben auch der Link ausgegeben.
Lesezeichen