• Home
  • Categories
  • Recent
  • Popular
  • Top
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
v3.5.1 Latest
Buy Hosting

[Solved] recent posts displays *threads*, not posts

Scheduled Pinned Locked Moved Bug Reports
22 Posts 3 Posters 5.1k Views
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    Giorgio Chiodi
    replied to julian on last edited by
    #13

    @julian eh I know I'm a pain in the ass, but now the thread post is not displayed. Could we have both the post text and the thread title?

    1 Reply Last reply
    0
  • G Offline
    G Offline
    Giorgio Chiodi
    replied to julian on last edited by Giorgio Chiodi
    #14

    @julian Ok I edited line 12 in recentposts.tpl and replaced it with

    <a href="{relative_path}/topic/{posts.topic.slug}#{posts.pid}">[[category:posted]] in {posts.topic.title}</a>

    I'd also like to do it on the homepage, but {categories.topic_title} doesn't work

    1 Reply Last reply
    0
  • julianJ Offline
    julianJ Offline
    julian GNU/Linux
    wrote on last edited by
    #15

    @giorgio-chiodi Are you referring to the recent topics widget?

    G 1 Reply Last reply
    0
  • G Offline
    G Offline
    Giorgio Chiodi
    replied to julian on last edited by
    #16

    @julian Hello Julian, yes I've modified the recentposts.tpl file to add the topic title in the recent posts widget
    I'd like to do the same thing on the homepage, I don't know what variable to fill in

    1 Reply Last reply
    0
  • julianJ Offline
    julianJ Offline
    julian GNU/Linux
    wrote on last edited by
    #17

    Hm... so the "recent posts" widget is not showing the title, and the "recent topics" widget is not showing the post text?

    Perhaps @baris can help you 🙂

    G 1 Reply Last reply
    0
  • G Offline
    G Offline
    Giorgio Chiodi
    replied to julian on last edited by Giorgio Chiodi
    #18

    @julian No wait now I'm confused. 🙂
    I wanted to show the post content in the "recent posts" widget, and now it is possible with the latest update.
    I have lost the ability to read also the topic title, which I fixed by manually adding {posts.topic.title} in the tpl file.
    What I'd like to add now is the same functionality {posts.topic.title} in the home page, but I tried adding it and it doesn't work.

    1 Reply Last reply
    0
  • barisB Offline
    barisB Offline
    <baris> NodeBB
    wrote on last edited by
    #19

    Try

    <!-- BEGIN posts -->
    	<div class="category-box">
    		<div class="post-preview">
                                    {categories.posts.topic.title}
    				<img src="{categories.posts.picture}" class="pull-left" />
    			<p class=""><strong>{categories.posts.username}</strong>: {categories.posts.content}</p>
    		</div>
    	</div>
    <!-- END posts -->
    

    in home.tpl

    G 1 Reply Last reply
    0
  • G Offline
    G Offline
    Giorgio Chiodi
    replied to <baris> on last edited by
    #20

    @baris yesssss! 😄

    1 Reply Last reply
    0
  • barisB Offline
    barisB Offline
    <baris> NodeBB
    wrote on last edited by
    #21

    You can see all the available data to the template by going to api/home. For example on this site http://community.nodebb.org/api/home. You would need to paste it into something like jsonlint or inspect in the network tab to see formatted.

    G 1 Reply Last reply
    0
  • G Offline
    G Offline
    Giorgio Chiodi
    replied to <baris> on last edited by
    #22

    @baris awesome!

    1 Reply Last reply
    0

Copyright © 2023 NodeBB | Contributors
  • Login

  • Don't have an account? Register

  • Login or register to search.
Powered by NodeBB Contributors
  • First post
    Last post
0
  • Home
  • Categories
  • Recent
  • Popular
  • Top
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development