ElkArte Community

Project Support => Support => Topic started by: emanuele on May 16, 2017, 02:25:07 am

Title: How to deal with first/last_post in GenericBoards.template
Post by: emanuele on May 16, 2017, 02:25:07 am
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. :)
Title: Re: How to deal with first/last_post in GenericBoards.template
Post by: Atlas on May 16, 2017, 02:48:03 am
@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?
Title: Re: How to deal with first/last_post in GenericBoards.template
Post by: emanuele on May 16, 2017, 07:19:01 am
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. :)
Title: Re: How to deal with first/last_post in GenericBoards.template
Post by: Atlas on May 16, 2017, 08:51:31 am
Thanks for the info, i might extend this in the future for semantic purposes. I'd like to allow users to add a class (https://en.wikipedia.org/wiki/Web_Ontology_Language#Classes) such as: Question (http://schema.org/Question), Answer (http://schema.org/Answer) or perhaps TechArticle (http://schema.org/TechArticle) to a "Topic (http://schema.org/DiscussionForumPosting)" or a "Reply (http://schema.org/Comment)" 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.