Skip to main content
Topic: How to deal with first/last_post in GenericBoards.template (Read 2466 times) previous topic - next topic - Topic derived from Which template file to append...
0 Members and 1 Guest are viewing this topic.

How to deal with first/last_post in GenericBoards.template

Welcome. :)
If at some point you have any code you want to share, feel free to. O:-)

Quote from: Atlas – I do have a question, however. @emanuele I can access...
Code: [Select]
$topic['first_post']['icon_url']
...on the MessageIndex.template, I'm also trying to access this on the GenericBoards.template, I've tried may variations of...
Code: [Select]
$board['last_post']['icon_url']
...to no avail. Any suggestions?
I'd have preferred a new topic for the question, but okay. :P
Depends from where do you want to access it and how you want to change it.
If you can give some more hints I can provide you with a better answer. :)
Last Edit: May 16, 2017, 07:10:18 am by emanuele
Bugs creator.
Features destroyer.
Template killer.

Re: How to deal with first/last_post in GenericBoards.template

Reply #1

@emanuele
file: GenericBoards.template
immediately after::
Code: [Select]
<p class="board_lastpost">

Is it possible to get both the latest reply's message icon and the OP message icon?

Re: How to deal with first/last_post in GenericBoards.template

Reply #2

Okay, better go to a new topic now. :)

Sorry, I used a poor wording for the question, but anyway I think I can give you an answer anyway.
The boards data used in the function are passed as parameter. Usually (e.g. in BoardIndex and in MesasgeIndex for child boards) these data come from https://github.com/elkarte/Elkarte/blob/v1.0.10/sources/subs/BoardsList.class.php
This class provides the last posts, but it doesn't fetch the message icon, and it doesn't fetch the OP at all.
So, if you want that data... well, there is a bit of work to do. :)
Bugs creator.
Features destroyer.
Template killer.

Re: How to deal with first/last_post in GenericBoards.template

Reply #3

Thanks for the info, i might extend this in the future for semantic purposes. I'd like to allow users to add a class such as: Question, Answer or perhaps TechArticle to a "Topic" or a "Reply" simply by selecting the appropriate icon. If i did this i would want that data available everywhere a topic/reply shows up, so yep, back-burner for now.