Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt November 11, 2024
PrettyPixels Posted November 27, 2015 Posted November 27, 2015 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?
opentype Posted November 27, 2015 Posted November 27, 2015 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.
openfire Posted December 17, 2015 Posted December 17, 2015 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
Kevin Carwile Posted December 17, 2015 Posted December 17, 2015 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.
openfire Posted December 17, 2015 Posted December 17, 2015 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?
sound Posted December 17, 2015 Posted December 17, 2015 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
Kevin Carwile Posted December 17, 2015 Posted December 17, 2015 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()"}
Marcher Technologies Posted December 17, 2015 Posted December 17, 2015 There's a topic method on that model for ease of access you can use actually: {$record->topic()->url()}
openfire Posted December 17, 2015 Posted December 17, 2015 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.
PrettyPixels Posted December 17, 2015 Author Posted December 17, 2015 Awesome! Thanks so much for all the help. I can't wait to try this out.
chilihead Posted December 17, 2015 Posted December 17, 2015 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.
opentype Posted December 17, 2015 Posted December 17, 2015 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.
chilihead Posted December 17, 2015 Posted December 17, 2015 Yup. Just wondering if the OP knows, as why do the members need to "find the topic" to discuss.
openfire Posted December 17, 2015 Posted December 17, 2015 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.
openfire Posted December 20, 2015 Posted December 20, 2015 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?
Recommended Posts
Archived
This topic is now archived and is closed to further replies.