筍子工作雜記

八月 10, 2007

樣版中的路徑問題

Filed under: xoops — shinnlu @ 2:08 下午

這一陣子美工告訴我一個困擾他很久的問題
他做樣版時,假設樣版名稱是 default,如果遇到大改版,為了防止改壞掉的情況,都會把原始樣版保留,並把 default 目錄複製一份成為 default1,而對 default1 做修改,這時候會遇到一個問題
<{foreach item=block from=$xoops_lblocks}>
<{include file="default/theme_blockleft.html"}>
<{/foreach}>
上面紅色的部份是樣版的路徑,只要樣版路徑改變,他就需要手動把 default 改為 default1,下次則需要將 default1 改為 default2,其實解決方法很簡單,只需要在樣版中加入下面這一行,此行程式的用意是把目前樣版路徑指定給 themename 成為一個 smart 變數
<{assign var='themename' value=$xoTheme->path}>
樣版中的路徑即可使用以下的方式
<{foreach item=block from=$xoops_lblocks}>
<{include file="$themename/theme_blockleft.html"}>
<{/foreach}>

如果是 Xoops 2.2x 因為沒有 xoTheme 物件,則要使用以下的方式去拼出樣版路徑
<{assign var='themename1' value=/themes/$xoops_theme/}>
<{assign var='themename' value=$xoops_rootpath$themename1}>

而使用方式一樣

23 則迴響 »

  1. yandanxvurulmus.yCh7SuC7W7TV

    迴響 by food porn — 十二月 30, 2023 @ 1:49 上午

  2. xyandanxvurulmus.hx550A64pEjq

    迴響 by electrosonde — 十二月 30, 2023 @ 4:05 上午

  3. xbunedirloooo.tZkUIn9D4sFI

    迴響 by offscourings — 十二月 30, 2023 @ 5:13 上午

  4. dyslogy xyandanxvurulmus.kEtsAT2Gewn8

    迴響 by dyslogy — 十二月 30, 2023 @ 4:09 下午

  5. seks siteleri vurgunyedim.INBi9z2lyVhj

    迴響 by house porn — 一月 16, 2024 @ 11:10 下午

  6. viagra yaralandinmieycan.PKRaVadGFW9g

    迴響 by watch porn video — 一月 17, 2024 @ 2:56 下午

  7. bahis siteleri porn citixx.z6UVkGRmWy0i

    迴響 by sexx — 一月 20, 2024 @ 4:19 下午

  8. porno hyuqgzhqt.EiqKM9AvP6ww

    迴響 by porno izle — 一月 20, 2024 @ 4:42 下午

  9. escort siteleri ewrjghsdfaa.xCIvVVTVlNHw

    迴響 by sexx — 一月 20, 2024 @ 4:52 下午

  10. bahis porno wrtgdfgdfgdqq.f0lO53JEzbli

    迴響 by eski rahatiniz olmayacak — 一月 20, 2024 @ 5:14 下午

  11. am siteleri wrtgdfgdfgdqq.5ld3kOK9ufph

    迴響 by bahis siteleri sikis — 一月 20, 2024 @ 5:33 下午

  12. bahis siteleri sikis pompadirha.ZsH8t2q5xNva

    迴響 by BİZİ SİK BİZ BUNU HAK EDİYORUZ — 二月 2, 2024 @ 7:32 下午

  13. fuck asillartaklitler.RHlcdZxqNO7I

    迴響 by escort — 二月 2, 2024 @ 7:47 下午

  14. porn hephupx.PsCoJ7lJj701

    迴響 by bahis siteleri incest category — 二月 3, 2024 @ 12:30 上午

  15. amciik siteleri hepxhupx.oZHJLTS6Qkst

    迴響 by porno izle — 二月 3, 2024 @ 8:03 下午

  16. BİZİ SİK BİZ BUNU HAK EDİYORUZ juljulfbi.p5RebXz4om34

    迴響 by childrens sex — 二月 3, 2024 @ 8:58 下午

  17. porn bjluajszz.4yuEvhDrVtwu

    迴響 by watch porn video — 二月 5, 2024 @ 2:59 下午

  18. watch porn video bxjluajsxzz.z8GHHatSvhDI

    迴響 by seks siteleri — 二月 5, 2024 @ 3:18 下午

  19. fuck 0qbxjluaxcxjsxzz.PRlS6vhhUuLy

    迴響 by porno izle — 二月 5, 2024 @ 3:38 下午

  20. xxx hdporn.com gghkyogg.iYMxWhZWvyI

    迴響 by sex video 4 k — 三月 13, 2024 @ 3:12 下午

  21. http://www.porn hd. com ggjennifegg.eBpNPGlcgmO

    迴響 by hd sex video 4k — 三月 13, 2024 @ 9:07 下午

  22. xxx hdporn.com ggjinnysflogg.r5ZmPc43YH0

    迴響 by porn full hd sex — 三月 13, 2024 @ 11:36 下午

  23. fashionflag sex hd video download fashionflag.2Sm0XIn5Ryu

    迴響 by fashionflag best 4k porn websites — 三月 27, 2024 @ 4:15 下午

此篇文章迴響的訂閱源料 TrackBack URL

發表迴響

Powered by WordPress