Giter Club home page Giter Club logo

Comments (5)

ScarletDor avatar ScarletDor commented on June 9, 2024 1

手动的话: 把不同分类的模板文件以分类缩略名命名,如default.phptechnology.php(缩略名请在后台——管理——分类中查看),然后在当前模板目录下建立一个名为 category 的文件夹,把不同分类的模板文件放进该文件夹,这样,在访问分类页面时,会自动调用分类对应缩略名的分类模板。

这种很不方便,如果能在后台设置中,自由的为当前分类选择模板就好了。对于主题开发者,这种功能也很方便,总不能让使用者自己建文件夹吧qaq

from typecho.

Moidea avatar Moidea commented on June 9, 2024 1

如果不想手动的话,这里提供一个这折中方案也是我自己目前在使用的方法,就是主题设置里读取全部分类,然后通过js控制拖拽来分配不同分类的mid,在分类页面读取主题设置的mid来使用不同模板

1572795457

如果大家有更好的方案也欢迎分享一下

from typecho.

xiamuguizhi avatar xiamuguizhi commented on June 9, 2024

手动的话: 把不同分类的模板文件以分类缩略名命名,如default.phptechnology.php(缩略名请在后台——管理——分类中查看),然后在当前模板目录下建立一个名为 category 的文件夹,把不同分类的模板文件放进该文件夹,这样,在访问分类页面时,会自动调用分类对应缩略名的分类模板。

from typecho.

ScarletDor avatar ScarletDor commented on June 9, 2024

如果不想手动的话,这里提供一个这折中方案也是我自己目前在使用的方法,就是主题设置里读取全部分类,然后通过js控制拖拽来分配不同分类的mid,在分类页面读取主题设置的mid来使用不同模板

1572795457

如果大家有更好的方案也欢迎分享一下

思路很不错,感觉很可行,很感谢!

from typecho.

cuixiping avatar cuixiping commented on June 9, 2024

如果不想手动的话,这里提供一个这折中方案也是我自己目前在使用的方法,就是主题设置里读取全部分类,然后通过js控制拖拽来分配不同分类的mid,在分类页面读取主题设置的mid来使用不同模板

@Moidea 能否分享一下主题设置页怎么获取分类的mid和名称等数据的代码?

from typecho.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.