Jump to content

Linking to Topic


PrettyPixels

Recommended Posts

Posted

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?

Posted

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. 

  • 3 weeks later...
Posted

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

Posted

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.

Posted

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?

 

Posted
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 

 

 

 

Posted
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()"}

Posted

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.

Posted

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.

Posted
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. 

Posted
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.

Posted

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:

3rdlink.thumb.jpg.e0f577e98f0f2972934bda

Any ideas?

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...