
在EyouCMS中,調用當前頁的URL有以下幾種方法:
{$eyou.http_true}
<!-- 調用當前頁的完整URL(包含域名) -->
{$eyou.http_url}
<!-- 調用當前頁的完整URL -->
<script>
// 在Javascript中獲取當前URL
var currentUrl = window.location.href;
var currentPath = window.location.pathname;
</script><!-- 列表頁中調用當前欄目URL -->
<a href="{$eyou.field.typeurl}">當前欄目</a>
<!-- 或者使用 -->
<a href="{$field.typeurl}">當前欄目</a><!-- 內容頁中調用當前內容URL -->
<a href="{$eyou.field.arcurl}">當前內容</a>
<!-- 或者使用 -->
<a href="{$field.arcurl}">當前內容</a><!-- 獲取當前頁面URL(通用方法) -->
{$eyou.http_true}{$eyou.server.REQUEST_URI}
<!-- 或者使用php原生方式 -->
<?php echo $_SERVER['REQUEST_URI']; ?><!-- 分享當前頁面 -->
<a href="javascript:;" onclick="shareToWeibo('{$eyou.http_true}{$eyou.server.REQUEST_URI}')">分享到微博</a>
<!-- 生成二維碼 -->
<div class="qrcode" data-url="{$eyou.http_true}{$eyou.server.REQUEST_URI}"></div>
<!-- 面包屑導航 -->
當前位置:<a href="{$eyou.field.typeurl}">{$eyou.field.typename}</a> > 當前內容{$eyou.field.typeurl}{$eyou.field.arcurl}{$eyou.http_true}結合服務器變量本文鏈接:http://m.373753.com/xinwendongtai/2098.html
版權聲明:站內所有文章皆來自網絡轉載,只供模板演示使用,并無任何其它意義!