主题列表预览(TLP)

@merefield

我安装了 Topic List Previews (TLP) 插件,并希望在搜索结果页面上显示主题缩略图预览,但它不起作用,只显示主题的“图块”和摘要。但在其他页面(如 /new 和 /latest)上缩略图可以正常显示。我尝试修改 TLP 配置,但所有更改都未成功。我注意到此页面提到了另一个插件(discourse-topic-previews-sidecar),因此我怀疑问题是由于未安装它。但是,安装该插件后,搜索结果页面仍然没有显示缩略图。

我有几个问题:

  1. 仅安装 TLP 是否足以在搜索结果中启用缩略图预览,还是我需要 TLP 和 discourse-topic-previews-sidecar?

  2. 搜索结果是否需要任何特殊的 TLP 配置?为什么我的设置没有生效?

  3. 我希望在搜索结果页面上拥有像这个网站一样的缩略图预览。我应该如何配置?您能否详细描述关键配置步骤?

附件是我的当前配置截图。

TLP 配置

[
	{
		"setting": "topic_list_tiles_topic_lists",
		"value": "latest|new|unread|top|tag|activity-topics|activity-portfolio|latest-mobile|new-mobile|unread-mobile|top-mobile|tag-mobile|activity-topics-mobile|activity-portfolio-mobile"
	},
	{
		"setting": "topic_list_tiles_categories",
		"value": ""
	},
	{
		"setting": "topic_list_tiles_tags",
		"value": ""
	},
	{
		"setting": "topic_list_thumbnails_topic_lists",
		"value": "latest|new|unread|top|tag|suggested|agenda|activity-topics|activity-portfolio|latest-mobile|new-mobile|unread-mobile|top-mobile|tag-mobile|suggested-mobile|agenda-mobile|activity-topics-mobile|activity-portfolio-mobile"
	},
	{
		"setting": "topic_list_thumbnails_categories",
		"value": "42"
	},
	{
		"setting": "topic_list_thumbnails_tags",
		"value": ""
	},
	{
		"setting": "topic_list_excerpts_topic_lists",
		"value": "latest|new|unread|top|tag|suggested|agenda|activity-topics|activity-portfolio|latest-mobile|new-mobile|unread-mobile|top-mobile|tag-mobile|agenda-mobile|activity-topics-mobile|activity-portfolio-mobile"
	},
	{
		"setting": "topic_list_excerpts_categories",
		"value": ""
	},
	{
		"setting": "topic_list_excerpts_tags",
		"value": ""
	},
	{
		"setting": "topic_list_actions_topic_lists",
		"value": "latest|new|unread|top|tag|suggested|agenda|activity-topics|activity-portfolio|latest-mobile|new-mobile|unread-mobile|top-mobile|tag-mobile|agenda-mobile|activity-topics-mobile|activity-portfolio-mobile"
	},
	{
		"setting": "topic_list_actions_categories",
		"value": ""
	},
	{
		"setting": "topic_list_actions_tags",
		"value": ""
	},
	{
		"setting": "topic_list_set_category_defaults",
		"value": false
	},
	{
		"setting": "topic_list_dominant_color_background",
		"value": "tiles only"
	},
	{
		"setting": "topic_list_show_like_on_current_users_posts",
		"value": true
	},
	{
		"setting": "topic_list_tiles_larger_featured_tiles",
		"value": true
	},
	{
		"setting": "topic_list_tiles_wide_format",
		"value": false
	},
	{
		"setting": "topic_list_portfolio",
		"value": true
	},
	{
		"setting": "topic_list_portfolio_filter_type",
		"value": "tag"
	},
	{
		"setting": "topic_list_portfolio_filter_parameter",
		"value": ""
	},
	{
		"setting": "topic_list_default_thumbnail",
		"value": ""
	},
	{
		"setting": "topic_list_default_thumbnail_fallback",
		"value": false
	},
	{
		"setting": "topic_list_thumbnail_resolution_level",
		"value": 3
	},
	{
		"setting": "topic_list_thumbnail_width",
		"value": 150
	},
	{
		"setting": "topic_list_thumbnail_height",
		"value": 100
	},
	{
		"setting": "topic_list_thumbnail_width_mobile",
		"value": 50
	},
	{
		"setting": "topic_list_thumbnail_height_mobile",
		"value": 60
	},
	{
		"setting": "topic_list_thumbnail_first_x_rows",
		"value": 0
	},
	{
		"setting": "topic_list_featured_images",
		"value": false
	},
	{
		"setting": "topic_list_featured_images_resolution_level",
		"value": 2
	},
	{
		"setting": "topic_list_featured_images_category",
		"value": false
	},
	{
		"setting": "topic_list_featured_images_from_current_category_only",
		"value": true
	},
	{
		"setting": "topic_list_featured_images_tag",
		"value": ""
	},
	{
		"setting": "topic_list_featured_images_tag_show",
		"value": true
	},
	{
		"setting": "topic_list_featured_images_count",
		"value": 0
	},
	{
		"setting": "topic_list_featured_images_order",
		"value": "latest"
	},
	{
		"setting": "topic_list_featured_width",
		"value": 0
	},
	{
		"setting": "topic_list_featured_height",
		"value": 250
	},
	{
		"setting": "topic_list_featured_height_mobile",
		"value": 150
	},
	{
		"setting": "topic_list_featured_title",
		"value": ""
	},
	{
		"setting": "topic_list_featured_excerpt",
		"value": 100
	},
	{
		"setting": "topic_list_featured_details_always_show",
		"value": "only on hover"
	},
	{
		"setting": "topic_list_test_image_url_timeout",
		"value": 5000
	},
	{
		"setting": "topic_list_fps_search_grid",
		"value": true
	},
	{
		"setting": "topic_list_fps_search_blurb",
		"value": true
	},
	{
		"setting": "topic_list_fps_search_author",
		"value": true
	}
]

你好

我想我的问题可能与TLP有关,但不确定。我昨天将Discourse更新到了最新版本,从那时起,在移动设备上,缩略图出现在顶部而不是左侧(仅限移动设备,无法通过开发者工具重现)。

论坛:cwowd
(可能与之前的“错误”无关,如果Glimmer模式设置为自动或启用,没有区别)

1 个赞

如果您清除了“主题列表”设置,您应该能够关闭不需要的功能,例如:

有用于缩略图、摘要、操作等的选项。

无法重现。最新 TLP 格式完美。删除所有其他主题/主题组件后重试。

很可能您有其他活动的东西存在冲突。

或者您的移动缩略图尺寸过大。

谢谢你的尝试 :wink:

缩略图大小:我试了一下,它们在左侧显示正确,宽度为 12 像素。不用说,在这种情况下它们是看不见的。

如果我理解得没错,会“添加”一列在左侧显示最后一条消息作者的图标(而我们应该显示分配给帖子的缩略图)。由于空间不足,缩略图最终会显示在帖子标题的上方,而不是按预期对齐到左侧。

1 个赞

应该看起来像这样。但是的。谷歌(就我而言)只给了我这么大的宽度 :sweat_smile:

如果您想要更大的图像,请在移动设备上切换到图块视图?

这曾经是我多年来非常满意的工作方式 :wink:

更新到 3.5.0.beta2-dev 破坏了某些东西,但我弄不清楚是什么。或者为什么这个该死的 author 列又回来了(从开发工具那里得不到任何帮助,当它模拟手机显示时一切正常)

如果没有缩略图,它应该显示头像。

在最新版本上我没有看到任何问题? (只要缩略图足够小 :slight_smile:

事实上,我期望这个 TC 比以前更稳定,因为它现在可以使用新的官方 API 进行覆盖,而不依赖于模板替换。

我必须移除所有移动页面的 TLP。

次要问题是开发者工具无法模拟真实的移动页面(例如,我的在“移动视图”开发者工具中仍然有缩略图,而 TLP 仅针对桌面页面激活)

您能总结一下原因吗?我的意思是,我已经在现有的空间上尽力而为了?

如之前所述 (Topic List Previews (TLP) - #594 by Thierry_Trégaro),自上次 Discourse 更新以来,缩略图在移动设备上显示在标题上方(而不是左侧),在左侧留下了过多的空白。

遗憾的是,别无选择,只能降级为成员图片。

我已暂时关闭此视图的图块。我没看到有什么问题。该网站截至昨天的信息是最新的。

Pixel 6a

缩略图必须与头像大小相似,这样才能正确布局……

……或者切换到图块视图。

能够使用开发者工具……所以,举个例子,我尝试在 mobile-latest 上再次激活,这是我得到的结果。

如果我将缩略图设置为 10px。

找不到不显示左侧那一列的方法……

您是否正在覆盖主题 3 中的设置?

无论如何,您的设置有些奇怪。

这就像您没有使用相同的模板一样。

这是具有相同尺寸的 starzen:

啊!这可能是一个 bug,抱歉!

如果我禁用“默认图片”,就会出现问题。我想知道这是否有关联?

好的,试试这个更新:

如果您认为 Topic List Previews 很棒,并且我做得很好,您可以 买我一杯咖啡 :coffee:

感谢您的耐心!由于我必须为新 API 和即将到来的限制进行完全重写,出现了一些新错误。

未见变化。供参考,这是在浅色主题上未添加任何其他组件的情况

笔记本电脑视图

移动视图

在阅读了您的帖子后,我也尝试使用了一个默认图片(来自 ionic)。没有真正改变(除了它正确地移除了作者的图片)。

我可以调整左侧的显示(在我的 CSS 中添加了

.mobile-view .topic-list .right {
    margin-left: 60px !important;
}

看起来好一些,但缩略图仍然在标题的顶部。

编辑:不,在我弄清楚这一点后,我终于用一点 CSS 网格解决了我的问题。不完美但还可以。

顺便说一句,我有一个请求:如果能够为新主题(而不是新回复)(或者任何论坛喜欢的名称^^)添加摘要,那就太好了。

我无法重现您的问题,即使将缩略图宽度推至 90px:

(尽管这对于日期和计数来说太宽了)。

您确定没有其他活动的组件在干扰吗?

TLP 开箱即用,即使在非常狭窄的情况下也能正常工作:

我最终找到了问题所在,应该已经修复了。默认缩略图逻辑中存在一个错误。

2 个赞

我看到一些 PreviewsThumbnail 实例化没有 @url
这是故意的吗?

1 个赞