Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请教一个关于template的问题 #23

Open
kiits opened this issue Jan 31, 2019 · 6 comments
Open

请教一个关于template的问题 #23

kiits opened this issue Jan 31, 2019 · 6 comments

Comments

@kiits
Copy link

kiits commented Jan 31, 2019

{% for tag in tag_list %}

你好,我没有完全拷贝你的项目,在我修改的时候发现这个right.html被index.html加载,但是view.py中index函数只返回了一个 return render(request, 'blog/index.html', {"article_list": article_list, "source_id": "index"})
这句return中并没有传递tag_list,那这个标签list是怎么加载的呢?

@jhao104
Copy link
Owner

jhao104 commented Jan 31, 2019

django-blog/templates/blog/right.html

Line 116 in 1965475

{% for tag in tag_list %}
你好,我没有完全拷贝你的项目,在我修改的时候发现这个right.html被index.html加载,但是view.py中index函数只返回了一个 return render(request, 'blog/index.html', {"article_list": article_list, "source_id": "index"})
这句return中并没有传递tag_list,那这个标签list是怎么加载的呢?

这是自定义上下文,

代码在这里 https://github.com/jhao104/django-blog/blob/master/blog/context_processors.py

setting.py中注册

'blog.context_processors.sidebar'

@kiits
Copy link
Author

kiits commented Feb 1, 2019

感谢感谢,还是django学艺不精呀 :)
image
还有一个前端问题我不知道是不是Chrome的版本问题,我朋友可以正常显示,我的将页面滚动到一定位置rgba的透明度效果就看不出来了

@jhao104
Copy link
Owner

jhao104 commented Feb 1, 2019

没看出来啥问题,看图片是正常的

@kiits
Copy link
Author

kiits commented Feb 1, 2019

dgeqyp0q1r47 t n_k sp30
ya 9n7 6qcs97 bjneorf
这样滚动到下面

@jhao104
Copy link
Owner

jhao104 commented Feb 1, 2019

上面部分本来就是这样透明的 😅

@kiits
Copy link
Author

kiits commented Feb 1, 2019

嗯嗯,对,前面的背景图上有个白色的透明的颜色,滚动到下面就只剩背景图了,透明白色颜色不见了,这是在哪里实现的?我想设置成不管怎么滚动都有白色透明的颜色,调了半天都不成功。。。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants