Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted November 27, 20159 yr In Pages, you have the option to post a topic to a specific forum each time a new record is added. I see that the created topic links back to the database record, but not vice versa. How can I automatically link from the database record to its created topic?
November 27, 20159 yr That is not a feature you could just switch on. It would require coding in the templates. Why do you want that in the first place? Normally you have the synced comments under the article anyway, so there is no need to send users to the forum first, when they can comment directly.
December 17, 20159 yr I would also like to know how to accomplish this. @PrettyPixels did you end up figuring this out? On 2015-11-27 at 2:23 PM, opentype said: That is not a feature you could just switch on. It would require coding in the templates. Why do you want that in the first place? Normally you have the synced comments under the article anyway, so there is no need to send users to the forum first, when they can comment directly. Because if you don't allow comments and have the option "Use forum for comments" set to "off/no", then there is no way to comment on the article directly, and without a link to the generated forum topic, users have no way of easily adding to the discussion without searching for the topic. (some people prefer to use the forum only for comments to avoid duplicate content) With a link back to the forum topic, users can get to the topic in one click, and it will increase engagement. I know some plugins have this functionality, so it can't be that difficult to add. Anyone know how to do this, or can point me in the right direction? Thanks
December 17, 20159 yr You can enable comments on pages database records without needing a forum topic to be created. Comments can be posted directly to your articles. Make sure you have given the permission for members to add comments in the record category permission matrix or in the database permission matrix if you are not overriding permissions in the category.
December 17, 20159 yr Thanks Kevin, I saw that option but in my specific case, I still want to keep all of the discussion in the forum - although I can see how this would work very well for other admins. Any ideas?
December 17, 20159 yr On 11/27/2015 at 7:08 PM, PrettyPixels said: In Pages, you have the option to post a topic to a specific forum each time a new record is added. I see that the created topic links back to the database record, but not vice versa. How can I automatically link from the database record to its created topic? you can add the link to the topic via the record template the variable to use for the url is record_topicid
December 17, 20159 yr 54 minutes ago, sound said: you can add the link to the topic via the record template the variable to use for the url is record_topicid Good call. Try this template tag to get the url: {expression="\IPS\forums\Topic::load( $record->record_topicid )->url()"}
December 17, 20159 yr There's a topic method on that model for ease of access you can use actually: {$record->topic()->url()}
December 17, 20159 yr Thanks for the help guys! I got it to work 2 different ways: <a href='index.php?showtopic={$record->record_topicid}'>Discussion Topic</a> <a href='{$record->topic()->url()}'>Discussion Topic</a> Both of the above worked inserted into the records template.
December 17, 20159 yr You know if you store the comments in the forums, the comment box is directly under the article, and when they post, it posts to the article and the forum topic correct? And vice versa. Just checking.
December 17, 20159 yr 30 minutes ago, chilihead said: You know if you store the comments in the forums, the comment box is directly under the article, and when they post, it posts to the article and the forum topic correct? Yes, it SHOWS in both places. It isn’t stored two times of course.
December 17, 20159 yr Yup. Just wondering if the OP knows, as why do the members need to "find the topic" to discuss.
December 17, 20159 yr 35 minutes ago, chilihead said: You know if you store the comments in the forums, the comment box is directly under the article, and when they post, it posts to the article and the forum topic correct? And vice versa. Just checking. I have "Post topic" checked, and "Use forum for comments" unchecked to avoid the duplicate content.
December 20, 20159 yr If you would like to link back to the topic, and include the number of replies, you can insert this: <a href='{$record->topic()->url()}'>{lang="replies_number" pluralize="$record->topic()->mapped('num_comments') - 1"} in Discussion Topic</a> It will show a link like this: 2 Replies in Discussion Topic Just thought I would leave that here in case anybody wanted to use it. Now if only I can figure out how to get that link into the user feedback menu as a tab: Any ideas?
Archived
This topic is now archived and is closed to further replies.