Git Product home page Git Product logo

Comments (4)

ego008 avatar ego008 commented on June 7, 2024

如果在公共局域(顶栏、侧栏、底部)添加就使用下面判断
{{if ne .PageName "article_detail"}}
https://github.com/ego008/goyoubbs/blob/master/controller/article.go#L478

如果只想在帖内页面私有局域(帖子内容、回复)输出则可以直接修改模版
https://github.com/ego008/goyoubbs/blob/master/view/default/desktop/article.html
https://github.com/ego008/goyoubbs/blob/master/view/default/mobile/article.html

from goyoubbs.

Yakumo-Yukari avatar Yakumo-Yukari commented on June 7, 2024

{{if ne .PageName "article_detail"}}

谢谢老大 我改成 {{if eq .PageName "article_detail"}}就可以在帖内显示了,

老大 现在使用的数据库有文档吗 我想给每个话题加入一个logo图片,我要怎么添加这个字段呢?

第二个问题是老大 我想在首页和分类列表页调用标签但是我把

{{if .Aobj.Tags}} <p class="mytag float-left">{{.Aobj.TagStr}}</p>{{end}}

直接加入category.html里面却获取不到标签

image

from goyoubbs.

ego008 avatar ego008 commented on June 7, 2024

数据库使用方法参考 https://github.com/ego008/youdb/blob/master/example/main.go
其实就是用json 存储数据。

可在 https://github.com/ego008/goyoubbs/blob/master/model/article.go#L13
这个article model 里添加Logo的属性/字段

必须设置Aobj.Tags,或者自己添加一个变量供模版调用....

PS: 快过年了,你怎么还那么用功。

from goyoubbs.

Yakumo-Yukari avatar Yakumo-Yukari commented on June 7, 2024

数据库使用方法参考 https://github.com/ego008/youdb/blob/master/example/main.go
其实就是用json 存储数据。

可在 https://github.com/ego008/goyoubbs/blob/master/model/article.go#L13
这个article model 里添加Logo的属性/字段

必须设置Aobj.Tags,或者自己添加一个变量供模版调用....

PS: 快过年了,你怎么还那么用功。

老大为什么不在帖子里面加一个分享插件呢 这样就可以方便分享到微博 微信 QQ 贴吧等平台了

PS:233 老大新年快乐,总是麻烦你有点不好意思呢,因为放假了想学点东西然后用youbbs做一个二次元社区。

from goyoubbs.

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.