
.tplファイルからブロックを直接呼び出す
右図のように新規作成したブロックをテンプレートファイル(○○○○.tpl)から直接呼び出す場合も以下の様なコードを使う。
EC-CUBEのバージョンは2.11.4です。
1 | <!--{include_php file= "`$smarty.const.TEMPLATE_REALDIR`frontparts/bloc/recommend_pc.tpl" }--> |
参考:パス関連のSmartyタグ一覧
EC-CUBEはVer2.11以降は内部構造も変更があり、それに共なってSmartyタグも幾つか変更されている。
02 | /html/user_data/packages/ default / |
04 | <!--{ $smarty . const .USER_TEMPLATE_REALDIR}--> |
05 | html/user_data/packages/ |
07 | <!--{ $smarty . const .TOP_URLPATH}--> |
10 | <!--{ $smarty . const .ROOT_URLPATH}--> |
13 | <!--{ $smarty . const .HTML_REALDIR}--> |
16 | <!--{ $smarty . const .HTTPS_URL}--> |
19 | <!--{ $smarty . const .P_DETAIL_URLPATH}--> |
20 | /html/products/detail.php?product_id= |
22 | <!--{ $smarty . const .IMAGE_SAVE_URLPATH}--> |
23 | /html/upload/save_image/ |
25 | <!--{ $smarty . const .DATA_REALDIR}--> |
28 | <!--{ $smarty . const .CLASS_REALDIR}--> |
31 | <!--{ $smarty . const .CLASS_EX_REALDIR}--> |
34 | <!--{ $smarty . const .TEMPLATE_REALDIR}--> |
35 | /data/Smarty/templates/ default / |
37 | <!--{ $smarty . const .TEMPLATE_ADMIN_REALDIR}--> |
38 | data/Smarty/templates/admin/ |
40 | <!--{ $smarty . const .TEMPLATE_TEMP_REALDIR}--> |
41 | html/upload/temp_template/ |
43 | <!--{ $smarty . const .GRAPH_URLPATH}--> |
44 | /html/upload/graph_image/ |
46 | <!--{ $smarty . const .IMAGE_TEMP_URLPATH}--> |
47 | /html/upload/temp_image/ |
49 | <!--{ $smarty . const .CART_URLPATH}--> |
52 | <!--{ $smarty . const .ADMIN_LOGIN_URLPATH}--> |
55 | <!--{ $smarty . const .ADMIN_SYSTEM_URLPATH}--> |
58 | <!--{ $smarty . const .ADMIN_PRODUCTS_URLPATH}--> |
59 | /html/shopmng/products/ |
61 | <!--{ $smarty . const .ADMIN_ORDER_URLPATH}--> |
64 | <!--{ $smarty . const .MOBILE_IMAGE_URLPATH}--> |
65 | /html/upload/mobile_image/ |
67 | <!--{ $smarty . const .MOBILE_TOP_URLPATH}--> |
70 | <!--{ $smarty . const .MOBILE_CART_URLPATH}--> |
73 | <!--{ $smarty . const .MOBILE_P_DETAIL_URLPATH}--> |
74 | /html/products/detail.php?product_id= |