Jump to content

Forum related content from database category


Recommended Posts

I am trying to setup the website in a way that related content from database entries are shows in forums, topics and the other way around.

So, let's say there is a forum called Marriage and then an articles database which has a category of Marriage. How I would display marriage articles within marriage topics?

Thank you.

Link to comment
Share on other sites

What I'm referring to is within Pages, you can have information posted in a database synced to a forum.  However you can only do that at the database level...  not within specific forums within a database.  

In the example below, if an entry is created in the database, a topic is created within the specified forum that shows each field you allow to be displayed.   

Could contain: Page, Text

But again...  this is only able to be specified at the database level.  That means if you have multiple categories, they would ALL post into that forum.  

Edited by Randy Calvert
Link to comment
Share on other sites

9 hours ago, virap1 said:

How I would display marriage articles within marriage topics?

You can’t. 

You could however create “landing pages“ for each topic, where you add feed blocks from the separate areas. So you could have “lastest marriage articles”, “latest marriage forum topics” and things like that together. And from there people could click through to get to Pages or the Forums. 

Link to comment
Share on other sites

By showing separate code for certain forums I could set up a block for each forum which will pull the records from the corresponding databases and show them within forum topics. So the marriage plugin will display marriage database records in marriage forum etc.

Link to comment
Share on other sites

4 hours ago, virap1 said:

Is there a way to modify that guides code so it works with the current version of invision? Thanks.

I would expect the code to still be correct. You might have made a mistake while setting it up. If not, I would start by outputting all the variables from the wrapper block to see if they are populated as expected. 

Link to comment
Share on other sites

@opentype thank you. You were correct, the syntax in the guide still works and I was implementing it in a wrong way.

The problem I have now is that the ID variable is the topic id, how can I change it so I get the forum id instead.

so the $id here {block="article_{$id}"} should be the forum id.

{{if request.app == 'forums' && request.module == 'forums'}}
	{{$id = \IPS\Request::i()->id;}}
	{block="article_{$id}"}
{{endif}}

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

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