我有3套URL(索引页面,详细信息页面和评论页面)。对于详细信息页面和审阅页面,将显示元描述,但不在索引页面中。
@if(strpos(Route::getFacadeRoot()->current()->uri(), 'reviews') !== false && isset($movie_review->description))
<meta name="description" content="{{isset($movie->title)?'Watch '.$movie->title.' online. '.$movie_review->description}}">
@elseif(strpos(Route::getFacadeRoot()->current()->uri(), 'detail') !== false && isset($movie->overview))
<meta name="description" content="{{isset($movie->title)?'Watch '.$movie->title.' online. '.$movie->overview}}"> \
**@elseif(strpos(Route::getFacadeRoot()->current()->uri(), 'index') !== false)
<meta name="description" content="{'This is index page description!'}">**
@endif
答案 0 :(得分:0)
将index
替换为/
,如下所示:
@elseif(strpos(Route::getFacadeRoot()->current()->uri(), '/') !== false)
<meta name="description" content="This is index page description!">
@endif